Skip to main content

We've Moved!

Product Documentation has moved to docs.hitachivantara.com
Hitachi Vantara Knowledge

Triggering policies and operations with hdidcmd

Usage Example:hdidcmd allows REST commands to be sent to the master. This topic demonstrates how to trigger a policy operation via the REST interface using this command line tool. Access to the REST API is controlled by RBAC, therefore the user:
  1. Open a command prompt.
  2. Login to Protector using the following command to begin a session:

    hdidcmd --activity "Login"

    --space Authentication SpaceName

    --userName UserName

    --password Password

    --ip IpAddress

    --port <Port>

    Where:

    • AuthenticationSpaceName is the Authentication Space where Username can be authenticated.
    • UserName is the user name for the session. The specified UserName must have the Trigger Operations activity assigned to them and have visibility of the nodes, data flows and policies specified in the trigger command.
    • Password is the password for UserName
    • IpAddress is the IP address of the Master node
    • Port is the port used to connect to the master server. This value is optional
    NoteSessions are maintained on a 'per command prompt' basis. If no activity is detected after 2 hours then the session will be terminated.
  3. Trigger the required operation by specifying the data flow, source node, policy and operation using the following command:

    hdidcmd --activity "Trigger Operation"

    [--dataflowName dataflowName | --dataflowId dataflowId]

    [--sourceNodeName sourceNodeName | --sourecNodeId sourceNodeId]

    [--policyName PolicyName | --policyId policyId]

    [--operationName operationName | --operationId operationId]

    [--syncGroup syncGroup ]

    [--wait]

    The following names (found in the UI) can be specified:

    • dataflowName is the textual name of the data flow where sourceNodeName appears
    • sourceNodeName is the textual name of the source node where the operation is assigned
    • PolicyName is the textual name of the policy
    • operationName is the textual name of the operation within PolicyName
    • synchGroup is the textual name of the shedule that is used to synchronise a group of hardware based operations

    Alternatively the following IDs can be specified:

    • dataflowId
    • sourceNodeId
    • policyId
    • operationId

    These are determined using the following command:

    hdidcmd --activity "View Triggers"

    The --wait option causes the command to wait until all the jobs are either completed, failed or paused; i.e. in some state other than in progress.

  4. Logout from Protector using the following command to end the session:

    hdidcmd --activity "Logout"

hdidcmd --activity "Login" --space Master --userName "administrator" --password 3253GHrT3 --ip 192.168.45.149

Operation Successful!

hdidcmd --activity "View Triggers"
{
    "trigger": [
        {
            "id": "0",
            "policyId": "2deb212ef02445458a1da13230bcf8dc",
            "policyName": "myPathBackupPolicy",
            "operationId": 1,
            "operationName": "Backup",
            "dataflowName": "myOSHostToRepoDataFlow",
            "dataflowId": "7ef4f80e-81da-456d-b44b-07789f80b522",
            "sourceNodeId": "Client1@B2-289YQR-37XVXP-I2QLXH-B4IB2E[0-1-2]",
            "sourceNodeInstance": 19,
            "destinationNodeId": "myRepository@00-B36A96-A2E2B8-437AB6-0BEF11[0-1-10]",
            "destinationNodeInstance": 20,
            "moverType": "eMOVER_BATCH",
            "syncGroup": "",
            "dataOriginNodeInstance": 19,
            "dataOriginNodeId": "Client1@B2-289YQR-37XVXP-I2QLXH-B4IB2E[0-1-2]"
        }
    ],
    "pageInfo": {
        "totalCount": 1,
        "end": true
    }
}
Operation Successful!

hdidcmd --activity "Trigger Operation" --dataflowName "myOSHostToRepoDataFlow" --source
NodeName "Client1" --policyId "2deb212ef02445458a1da13230bcf8dc" --operationId 1
{
    "job": [
        {
            "id": "{6e127915-7553-464b-8511-0606b4bec3a4}"
        }
    ]
}
Operation Successful!

hdidcmd --activity "Logout"

Operation Successful!

 

  • Was this article helpful?