Previous Topic: disable Method (srv Object)Next Topic: power_cycle Method (srv Object)


set Method (srv Object)
Description

Set the server's role in the grid for controller high-availability

Syntax
/api/v1/srv/set?srv=srv&role=role&vdc=controller-name 
Arguments
srv

Name of the server

role

Server's HA role. Can be 'primary', 'secondary' or 'none'

vdc

Name of the target virtual data center

Options
role

Server's High Availability role. May be one of the following:

primary

Server that is currently running the CA AppLogic® grid controller

secondary

Server that may run the CA AppLogic® grid controller in case of a controller server failure

none

Server will never run the CA AppLogic® grid controller and does not participate in controller HA

ha_network

Enable/disable network HA for the server (both external and backbone)

ha_backbone

Enable/disable network HA on the backbone network

ha_external

Enable/disable network HA on the external network

backbone

specify which switch is active for the backbone network

external

Specify which switch is active for the external network

hypervisor_name

Name of the hypervisor

hypervisor_lic_key

Hypervisor license key

disk_ncq_enabled

Enable/disable NCQ

Transaction Type

asynchronous

Request Type

GET

Examples

Set role for srv1 to secondary.

GET http://192.168.123.200/api/v1/srv/set?srv=srv1&role=secondary&vdc=mygrid 
Sample Output
XML:
<opt></opt>
JSON:
{} 

HTTP Error Codes
404

Entity vdc mygrid not found - A VDC name was specified that is not configured in the WS_API application.

400.4

Missing required arguments (role). - Argument role=ha-role was not specified.

400.4

Missing required arguments (srv). - Argument srv=srv-name was not specified.

power_on Method (srv Object)
Description

Power on a server

Syntax
/api/v1/srv/power_on?srv=srv&vdc=controller-name 
Arguments
srv

Name of the server

&all

Power all servers on. Exclusive of the srv argument.

vdc

Name of the target virtual data center

Transaction Type

asynchronous

Request Type

GET

Examples

Power on srv1.

GET http://192.168.123.200/api/v1/srv/power_on?srv=srv1&vdc=mygrid 
Sample Output
XML:
<job>be805915-76b2-48c8-b8a0-b881cca66da7</job> 
JSON:
{
   "job" : "be805915-76b2-48c8-b8a0-b881cca66da7"
} 
HTTP Error Codes
404

Entity vdc mygrid not found - A VDC name was specified that is not configured in the WS_API application.

Notes

Only valid when "Power Control" is enabled

power_off Method (srv Object)
Description

Power off a server

Syntax
/api/v1/srv/power_off?srv=srv&vdc=controller-name 
Arguments
srv

Name of the server

&all

Power all servers off. Exclusive of the srv argument.

vdc

Name of the target virtual data center

Options
reason

Reason why the server is being rebooted.

Transaction Type

asynchronous

Request Type

GET

Examples

Power off srv1.

GET http://192.168.123.200/api/v1/srv/power_off?srv=srv1&vdc=mygrid 
Sample Output
XML:
<job>be805915-76b2-48c8-b8a0-b881cca66da8</job> 
JSON:
{
   "job" : "be805915-76b2-48c8-b8a0-b881cca66da8"
}
HTTP Error Codes
404

Entity vdc mygrid not found - A VDC name was specified that is not configured in the WS_API application.

Notes

Only valid when "Power Control" is enabled.