Node activity functions


2019 Release 02 added REST APIs for the following node activities:

The base URL for the API is:

https://<managerHostName>/bda/rest/api


Approve node

Use the following procedure for approving nodes to BDA manager.

Warning

Note

Use a comma to separate multiple node IDs, as shown in this example:

node_id=9ede95f64413b275,a2df6912d7f0b8a4,76bfc387ab2f2693

To approve multiple nodes, see Examples.

Syntax

/1.0/node/approve

Method

POST

Required parameters

  • node_id—Use the value from the dstate file of the Agent node.
  • domain—Use the domain of the BDA Manager grid that you are using.

Optional parameters

None

Response

{
    "status": "success",
    "status_code": 200,
    "data": "Node Approved to /LINUX/OEL6/"
}

Examples

  • To approve the 9ede95f64413b275 node under my_domain:

    curl -k -H "x-auth-token: ad7aaa89fbf0ef648ddd1607007e819f" --data "node_id=9ede95f64413b275&domain=my_domain" https://my.bda.manager.com/bda/rest/api/1.0/node/approve
  • To approve multiple nodes:

    curl -k -H "x-auth-token: ad7aaa89fbf0ef648ddd1607007e819f" --data "node_id=9ede95f64413b275,a2df6912d7f0b8a4,76bfc387ab2f2693&domain=my_domain" https://my.bda.manager.com/bda/rest/api/1.0/node/approve 

Move node

Use the following procedure to move nodes from one domain to another. You can also use a template to move the nodes. The template consists of node_fqn and domain tags.

Syntax

/1.0/node/move

Method

POST

Required parameters

  • node_fqn—Use the node_id along with it's domain for this parameter.
  • domain—This is the destination domain to which the node will move.
  • template—You must add a template in the Manager. This template consists of node_fqn and domain tags.

    Information

    Following is an example of a template:

    <xml>
      <candidate>
          <node_fqn>/LINUX/RHEL7/SINGLE/76bfc387ab2f2693</node_fqn>
          <domain>/LINUX/RHEL7</domain>
      </candidate>
      <candidate>
          <node_fqn>/LINUX/RHEL6/SINGLE/a2df6912d7f0b8a4</node_fqn>
          <domain>/LINUX/RHEL6</domain>
      </candidate>
    </xml>

Optional parameters

None

Responses

  • For passing values directly:

    {
        "status": "success",
        "status_code": 200,
        "data": {
            "/LINUX/OEL6/76bfc387ab2f2693": "Node successfully moved"
        }
    }
  • For passing values through a template:

    {
        "status": "success",
        "status_code": 200,
        "data": {
            "/LINUX/RHEL7/SINGLE/76bfc387ab2f2693": "Node successfully moved",
            "/LINUX/RHEL6/SINGLE/a2df6912d7f0b8a4": "Node successfully moved"
        }
    }

Examples

  • To move the 512a6e1de64bba51 node to the my_domain domain from the /LINUX/RHEL6/SINGLE/ domain:

    curl -k -H "x-auth-token: ad7aaa89fbf0ef648ddd1607007e819f" --data "node_fqn=/LINUX/RHEL6/SINGLE/512a6e1de64bba51&domain=my_domain" https://my.bda.manager.com/bda/rest/api/1.0/node/move
  • To move nodes by using a template:

    curl -k -H "x-auth-token: ad7aaa89fbf0ef648ddd1607007e819f" --data "template=/home/move_node.txt" https://my.bda.manager.com/bda/rest/api/1.0/node/move

Reboot node

Use the following procedure to reboot nodes. You can reboot a node directly or use a template to do so. The template consists of node_fqn and hostname tags.

Syntax

/1.0/node/reboot

Method

POST

Required parameters

  • node_fqn—Use the node_id along with it's domain for this parameter.
  • hostname—Use the host name of the Agent node.
  • template—You must add a template in the Manager. This template consists of node_fqn and hostname tags.

    Information
    Example

    Following is an example of a template:

    <xml>
      <candidate>
          <node_fqn>/LINUX/RHEL7/76bfc387ab2f2693</node_fqn>
          <hostname>rh7-si-615.gridapp-dev.com</hostname>
      </candidate>
      <candidate>
          <node_fqn>/LINUX/RHEL6/a2df6912d7f0b8a4</node_fqn>
          <hostname>rh6-si-456.gridapp-dev.com</hostname>
      </candidate>
    </xml>

Optional parameters

None

Responses

  • For passing values directly:

    {
        "status": "success",
        "status_code": 200,
        "data": {
            "rh7-si-615.gridapp-dev.com": "Please look  into job 458 for result"
        }
    }
  • For passing values through a template:

    {
        "status": "success",
        "status_code": 200,
        "data": {
            "rh7-si-615.gridapp-dev.com": "Please look  into job 484 for result",
            "rh6-si-456.gridapp-dev.com": "Please look  into job 485 for result"
        }
    }

Examples

  • To reboot the 512a6e1de64bba51 node that was placed in the /LINUX/RHEL6/SINGLE/ domain:

    curl -k -H "x-auth-token: ad7aaa89fbf0ef648ddd1607007e819f" --data "node_fqn=/LINUX/RHEL6/SINGLE/512a6e1de64bba51&hostname=<agent_hostname>" https://my.bda.manager.com/bda/rest/api/1.0/node/reboot
  • To reboot nodes by using a template:

    curl -k -H "x-auth-token: ad7aaa89fbf0ef648ddd1607007e819f" --data "template=/home/reboot_node.txt" https://my.bda.manager.com/bda/rest/api/1.0/node/reboot

Rescan node

Use the following procedure to rescan Agents. You can rescan a node directly or use a template to do so. The template consists of node_fqn and hostname tags.

Syntax

/1.0/node/rescan

Method

POST

Required parameters

  • node_fqn—Use the node_id along with it's domain for this parameter.
  • hostname—Use the host name of the Agent node.
  • template—You must add a template in the Manager. This template consists of node_fqn and hostname tags.

    Information
    Example

    Following is an example of a template:

    <xml>
      <candidate>
          <node_fqn>/LINUX/RHEL7/76bfc387ab2f2693</node_fqn>
          <hostname>rh7-si-615.gridapp-dev.com</hostname>
      </candidate>
      <candidate>
          <node_fqn>/LINUX/RHEL6/a2df6912d7f0b8a4</node_fqn>
          <hostname>rh6-si-456.gridapp-dev.com</hostname>
      </candidate>
    </xml>

Optional parameters

None

Responses

  • For passing values directly:

    {
        "status": "success",
        "status_code": 200,
        "data": {
            "rh7-si-615.gridapp-dev.com": "Please look  into job 457 for result"
        }
    }
  • For passing values through a template:

    {
        "status": "success",
        "status_code": 200,
        "data": {
            "rh7-si-615.gridapp-dev.com": "Please look  into job 482 for result",
            "rh6-si-456.gridapp-dev.com": "Please look  into job 483 for result"
        }
    }

Examples

  • To rescan the 512a6e1de64bba51 node that was placed in the /LINUX/RHEL6/SINGLE/ domain:

    curl -k -H "x-auth-token: ad7aaa89fbf0ef648ddd1607007e819f" --data "node_fqn=/LINUX/RHEL6/SINGLE/512a6e1de64bba51&hostname=<agent_hostname>" https://my.bda.manager.com/bda/rest/api/1.0/node/rescan
  • To rescan nodes using a template:

    curl -k -H "x-auth-token: ad7aaa89fbf0ef648ddd1607007e819f" --data "template=/home/rescan_node.txt" https://my.bda.manager.com/bda/rest/api/1.0/node/rescan

Shutdown node

Use the following procedure to shut down a node. You can shut down multiple nodes by using a template in the API command data.

Syntax

/1.0/node/shutdown

Method

POST

Required parameters

  • node_fqn—Use the node_id along with it's domain for this parameter.
  • hostname—Use the host name of the Agent node.
  • template—You must add a template in the Manager. This template consists of node_fqn and hostname tags.

    Information
    Example

    Following is an example of a template:

    <xml>
      <candidate>
          <node_fqn>/LINUX/RHEL7/76bfc387ab2f2693</node_fqn>
          <hostname>rh7-si-615.gridapp-dev.com</hostname>
      </candidate>
      <candidate>
          <node_fqn>/LINUX/RHEL6/a2df6912d7f0b8a4</node_fqn>
          <hostname>rh6-si-456.gridapp-dev.com</hostname>
      </candidate>
    </xml>

Optional parameters

None

Responses

  • For passing values directly:

    {
        "status": "success",
        "status_code": 200,
        "data": {
            "rh7-si-615.gridapp-dev.com": "Please look  into job 459 for result"
        }
    }
  • For passing values through a template:

    {
        "status": "success",
        "status_code": 200,
        "data": {
            "rh7-si-615.gridapp-dev.com": "Please look  into job 486 for result",
            "rh6-si-456.gridapp-dev.com": "Please look  into job 487 for result"
        }
    }

Examples

  • To shut down the 512a6e1de64bba51 node placed in the /LINUX/RHEL6/SINGLE/ domain:

    curl -k -H "x-auth-token: ad7aaa89fbf0ef648ddd1607007e819f" --data "node_fqn=/LINUX/RHEL6/SINGLE/512a6e1de64bba51&hostname=<agent_hostname>" https://my.bda.manager.com/bda/rest/api/1.0/node/shutdown
  • To shut down nodes using a template:

    curl -k -H "x-auth-token: ad7aaa89fbf0ef648ddd1607007e819f" --data "template=/home/shutdown_node.txt" https://my.bda.manager.com/bda/rest/api/1.0/node/shutdown

Related topic


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC Database Automation 20.19