Previous Topic: Valid Web API ObjectsNext Topic: srv Object


vdc Object

Use this object to view details of one or more VDC Virtual Data Centers managed by the 'WS_API'.

Method

Description

info

Retrieve grid information

info_verbose

Retrieve detailed grid information

list

Retrieve grids configured to work with the WS_API

get

Retrieve grid configuration parameter(s)

get_acl

Retrieve grid ACL (or portion of grid ACL) relating to a particular principal

set

Set grid configuration parameter(s)

put_acl

Replace the entire grid ACL

modify_acl

Replace that portion of the grid ACL which relates to the owner or a principal

reboot

Reboot a grid.

shutdown

Shut a grid down.

power_cycle

power-cycle a grid.

info Method (vdc Object)
Description

Retrieve grid information

Syntax
/api/v2/vdc/info?vdc=controller-name 
Arguments
vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Get information.

GET http://192.168.123.200/api/v2/vdc/info?vdc=mygrid 
Sample Output
XML:
<grid> 
   <name>mygrid</name> 
   <app_running>2</app_running> 
   <bw_alloc>570000000</bw_alloc> 
   <bw_free>1430000000</bw_free> 
   <bw_reserved>0</bw_reserved> 
   <bw_total>2000000000</bw_total> 
   <controller_uptime>1496456</controller_uptime> 
   <cpu_alloc>1.94</cpu_alloc> 
   <cpu_free>1.96</cpu_free> 
   <cpu_load>0.03</cpu_load> 
   <cpu_reserved>0.00</cpu_reserved> 
   <cpu_total>4.00</cpu_total> 
   <description></description> 
   <disk_free>1148779407545</disk_free> 
   <disk_n>1</disk_n> 
   <disk_reserved>10737418240</disk_reserved> 
   <disk_total>1493697126400</disk_total> 
   <ha_state>checking...</ha_state> 
   <last_failed_srv>srv1</last_failed_srv> 
   <last_srv_failure_time>270003032</last_srv_failure_time> 
   <mem_alloc>2147483648</mem_alloc> 
   <mem_free>679477248<mem_free> 
   <mem_reserved>1431306240</mem_reserved> 
   <mem_service>34603008</mem_service> 
   <mem_total>4292870144</mem_total> 
   <srv_enabled>1</srv_enabled> 
   <srv_running>1</srv_running> 
   <srv_total>1</srv_total> 
   <system_uptime>1496636</system_uptime> 
   <version>2.8.9 hf3561 e3624</version> 
</grid>
JSON:
{ 
   "disk_n" : "1", 
   "cpu_total" : "4.00", 
   "cpu_alloc" : "1.94", 
   "last_srv_failure_time" : "1270003032", 
   "mem_alloc" : "2147483648", 
   "app_running" : "2", 
   "srv_running" : "1", 
   "bw_total" : "2000000000", 
   "cpu_reserved" : "0.00", 
   "version" : "2.8.9 hf3561 e3624", 
   "mem_total" : "4292870144", 
   "name" : "mygrid", 
   "disk_reserved" : "10737418240", 
   "disk_total" : "1493697126400", 
   "system_uptime" : "1496641", 
   "srv_enabled" : "1", 
   "cpu_free" : "1.96", 
   "description" : "", 
   "mem_reserved" : "1431306240", 
   "mem_service" : "34603008", 
   "controller_uptime" : "1496462", 
   "bw_free" : "1430000000", 
   "disk_free" : "1148779407545", 
   "ha_state" : "checking...", 
   "srv_total" : "1", 
   "last_failed_srv" : "srv1", 
   "bw_reserved" : "0", 
   "cpu_load" : "0.42", 
   "mem_free" : "679477248", 
   "bw_alloc" : "570000000" 
} 
HTTP Error Codes
404

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

info_verbose Method (vdc Object)

Note: This method has been deprecated and is included here for compatibility with existing user scripts. New users should use the option flag &verbose.

Description

Retrieve detailed grid information

Syntax
/api/v2/vdc/info_verbose?vdc=controller-name 
Arguments
vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Get grid information.

GET http://192.168.123.200/api/v2/vdc/info_verbose?vdc=mygrid 
Sample Output
XML:
<grid> 
   <name>mygrid</name> 
   <app_running>2</app_running> 
   <bw_alloc>570000000</bw_alloc> 
   <bw_free>1430000000</bw_free> 
   <bw_reserved>0</bw_reserved> 
   <bw_total>2000000000</bw_total> 
   <controller_uptime>1496456</controller_uptime> 
   <cpu_alloc>1.94</cpu_alloc> 
   <cpu_free>1.96</cpu_free> 
   <cpu_load>0.03</cpu_load> 
   <cpu_reserved>0.00</cpu_reserved> 
   <cpu_total>4.00</cpu_total> 
   <description></description> 
   <disk_free>1148779407545</disk_free> 
   <disk_n>1</disk_n> 
   <disk_reserved>10737418240</disk_reserved> 
   <disk_total>1493697126400</disk_total> 
   <ha_state>checking...</ha_state> 
   <last_failed_srv>srv1</last_failed_srv> 
   <last_srv_failure_time>270003032</last_srv_failure_time> 
   <mem_alloc>2147483648</mem_alloc> 
   <mem_free>679477248<mem_free> 
   <mem_reserved>1431306240</mem_reserved> 
   <mem_service>34603008</mem_service> 
   <mem_total>4292870144</mem_total> 
   <srv_enabled>1</srv_enabled> 
   <srv_running>1</srv_running> 
   <srv_total>1</srv_total> 
   <system_uptime>1496636</system_uptime> 
   <version>2.8.9 hf3561 e3624</version> 
</grid>
JSON:
{ 
   "disk_n" : "1", 
   "cpu_total" : "4.00", 
   "cpu_alloc" : "1.94", 
   "last_srv_failure_time" : "1270003032", 
   "mem_alloc" : "2147483648", 
   "app_running" : "2", 
   "srv_running" : "1", 
   "bw_total" : "2000000000", 
   "cpu_reserved" : "0.00", 
   "version" : "2.8.9 hf3561 e3624", 
   "mem_total" : "4292870144", 
   "name" : "mygrid", 
   "disk_reserved" : "10737418240", 
   "disk_total" : "1493697126400", 
   "system_uptime" : "1496641", 
   "srv_enabled" : "1", 
   "cpu_free" : "1.96", 
   "description" : "", 
   "mem_reserved" : "1431306240", 
   "mem_service" : "34603008", 
   "controller_uptime" : "1496462", 
   "bw_free" : "1430000000", 
   "disk_free" : "1148779407545", 
   "ha_state" : "checking...", 
   "srv_total" : "1", 
   "last_failed_srv" : "srv1", 
   "bw_reserved" : "0", 
   "cpu_load" : "0.42", 
   "mem_free" : "679477248", 
   "bw_alloc" : "570000000" 
} 
HTTP Error Codes
404

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

list Method (vdc Object)
Description

Retrieve grids configured to work with the WS_API

Syntax
/api/v2/vdc/list 
Arguments

None

Transaction Type

synchronous

Request Type

GET

Examples

List grids.

GET http://192.168.123.200/api/v2/vdc/list 
Sample Output
XML:
<vdcs> 
   <vdc> 
      <name>mygrid</name> 
      <default>1</default> 
      <host>72.233.72.121</host> 
      <location>Dallas, TX, USA</location> 
   </vdc> 
</vdcs>
JSON:
{ 
   "vdc" : [ 
      { 
      "location" : "Dallas, TX, USA", 
      "name" : "mygrid", 
      "default" : 1, 
      "host" : "72.233.72.121" 
      } 
   ] 
} 
get Method (vdc Object)
Description

Retrieve grid configuration parameter(s)

Syntax
/api/v2/vdc/get?vdc=controller-name&prop=property-name
/api/v2/vdc/get?vdc=controller-name&all 
Arguments
vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Get all grid configuration information.

GET http://192.168.123.200/api/v2/vdc/get?vdc=mygrid&all
Sample Output
XML:
<configuration> 
  <recovery_password></recovery_password> 
</configuration> 
JSON:
{ 
   "configuration" : { 
      "recovery_password" : "" 
   } 
}

HTTP Error Codes
404

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

set Method (vdc Object)
Description

Set grid configuration parameter(s)

Syntax
/api/v2/vdc/set?vdc=controller-name&property-name=value
Arguments
property-name

Name of the property to set

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Set or change the recovery_password on grid mygrid

GET http://192.168.123.200/api/v2/vdc/set?vdc=mygrid&recovery_password=test12345
Sample Output
XML:
<message>Please reboot the grid controller for the password change to take effect.</message> 
JSON:
{ 
 "message" : "Please reboot the grid controller for the password change to take effect." 
}

HTTP Error Codes
404

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

404.1

Entity not found - Network HA-related settings may only be modified by a grid maintainer.

Notes

Most properties require maintainer access to set.

get_acl Method (vdc Object)
Description

Display the grid ACL, or display that portion of the grid ACL which relates to a particular principal.

Syntax
/api/v2/vdc/get_acl?vdc=controller-name 
Arguments
vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Example: Display ACL for vdc mygrid

GET http://192.168.123.200/api/v2/vdc/get_acl?vdc=mygrid
Sample Output
JSON:
{
   "acl" : {
      "owner" : {
         "id" : "a5cb10bc-7291-4a86-84f8-74419fc9ae63"
      },
      "entries" : [
         {
            "grid_administrator" : 1,
            "id" : "a5cb10bc-7291-4a86-84f8-74419fc9ae63"
         },
         {
            "grid_administrator" : 1,
            "id" : "8bc880d9-c86c-4d70-95b7-77438bf7d4d1"
         },
         {
            "app_developer" : 1,
            "id" : "4326b4d1-8896-4c92-931a-18a9fd6e0509"
         },
         {
            "app_developer" : 1,
            "id" : "afeb0c36-539f-4299-946b-820a0411f3de"
         }
      ]
   }
}

XML:
<acl>
  <entries>
    <entry>
      <grid_administrator>1</grid_administrator>
      <id>a5cb10bc-7291-4a86-84f8-74419fc9ae63</id>
    </entry>
    <entry>
      <grid_administrator>1</grid_administrator>
      <id>8bc880d9-c86c-4d70-95b7-77438bf7d4d1</id>
    </entry>
    <entry>
      <app_developer>1</app_developer>
      <id>4326b4d1-8896-4c92-931a-18a9fd6e0509</id>
    </entry>
    <entry>
      <app_developer>1</app_developer>
      <id>afeb0c36-539f-4299-946b-820a0411f3de</id>
    </entry>
  </entries>
  <owner>
    <id>a5cb10bc-7291-4a86-84f8-74419fc9ae63</id>
  </owner>
</acl>

HTTP Error Codes
400

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

404.1

Entity not found - Failed to retrieve application ACL - ACL does not contain principal local user 'test@3tera.com'.

- An invalid principal was specified

Notes

This API is available with WS_API_r6-1.0.6-1 and above.

put_acl Method (vdc Object)
Description

Replace the entire grid ACL.

Syntax
/api/v2/vdc/put_acl?owner=<owner>&acl=<ACLs>&vdc=controller-name 
Arguments
owner

A URL-encoded owner attribute of the grid ACL to the specified principal

acl

URL-encoded list of principals separated with a slash (/)

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Replace the entire ACL for vdc mygrid with an owner api@3tera.com

GET
http://192.168.123.200/api/v2/vdc/put_acl? owner=local%3Auser%3Aapi%403tera.com&acl=&vdc=mygrid

Replace the entire ACL for vdc mygrid with an owner api@3tera.com and principal local:user:api@3tera.com=app_developer


GET
http://192.168.123.200/api/v2/vdc/put_acl?owner=local%3Auser%3Aapi%403tera.com&acl=local%3Auser%3Aapi%403tera.com%3Dapp_developer&vdc=mygrid

Replace the entire ACL for vdc mygrid with an owner api@3tera.com and principal local:user:api@3tera.com=app_developer/local:user:test@3tera.com=monitor.

GET
http://192.168.123.200/api/v2/vdc/put_acl?owner=local%3Auser%3Aapi%403tera.com&acl=local%3Auser%3Aapi%403tera.com%3Dapp_developer%2Flocal%3Auser%3Atest%403tera.com%3Dmonitor&vdc=mygrid
HTTP Error Codes
400

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

400.4

Missing required arguments (owner)

- Argument owner=owner

Missing required arguments (acl)

- Argument acl=acl missing

404.1

Entity not found - Failed to put grid ACL - invalid principal data - principal local user 'test@3tera.com' does not exist.

- An invalid owner or acl was specified

Sample Output
JSON:
{
   "message" : ""
} 
XML:

<message></message>
Notes

This API is available with WS_API_r6-1.0.6-1 and above.

modify_acl Method (vdc Object)
Description

Replace that portion of the grid ACL which relates to the owner or a principal.

Syntax
/api/v2/vdc/modify_acl?acl=<ACLs>&vdc=controller-name
Arguments
acl

URL-encoded list of principals separated with a slash (/)

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Replace that portion of the grid ACL which relates to the local user 'api@3tera.com', providing grid_administrator access level permissions to this user

GET
http://192.168.123.200/api/v2/vdc/modify_acl?acl=local%3Auser%3Aapi%403tera.com%3Dgrid_administrator&vdc=mygrid
HTTP Error Codes
400

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

400.4

Missing required arguments (acl)

- Argument acl=acl missing

404.1

Entity not found - Failed to modify ACL - invalid principal data - principal local user 'test@3tera.com' does not exist.

- An invalid acl was specified

Sample Output
JSON:
{
   "message" : ""
} 
XML:

<message></message>
Notes

This API is available with WS_API_r6-1.0.6-1 and above.

reboot Method (vdc Object)
Description

Reboot a grid

Syntax

/api/v2/vdc/reboot?&vdc=controller-name

Arguments
vdc

Name of the target virtual data center

Options
reason

Reason why the grid is being rebooted.

Transaction Type

asynchronous

Request Type

GET

Examples

Reboot grid mygrid.

GET http://aux/api/v2/vdc/reboot?&vdc=mygrid&reason=maintenance
Sample Output
XML:
<job>be805915-76b2-48c8-b8a0-b881cca66d10</job>
JSON:
{
   "job" : "be805915-76b2-48c8-b8a0-b881cca66d10"
}

HTTP Error Codes
404

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

shutdown Method (vdc Object)
Description

Shut a grid down

Syntax

/api/v2/vdc/shutdown?&vdc=controller-name

Arguments
vdc

Name of the virtual data center to shutdown

Options
reason

Reason why the grid is being shutdown.

Transaction Type

asynchronous

Request Type

GET

Examples

Shut the grid mygrid down.

GET http://aux/api/v2/vdc/shutdown?&vdc=mygrid&reason=maintenance
Sample Output
XML:
<job>be805915-76b2-48c8-b8a0-b881cca66d11</job>
JSON:
{
   "job" : "be805915-76b2-48c8-b8a0-b881cca66d11"
}

HTTP Error Codes
404

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

power_cycle Method (vdc Object)
Description

Power cycle a grid

Syntax

/api/v2/vdc/power_cycle?&vdc=controller-name

Arguments
vdc

Name of the target virtual data center

Transaction Type

asynchronous

Request Type

GET

Examples

Power cycle the grid mygrid

GET http://192.168.123.200/api/v2/vdc/power_cycle?vdc=mygrid 
Sample Output
XML:
<job>be805915-76b2-48c8-b8a0-b881cca66d12</job>
JSON:
{
   "job" : "be805915-76b2-48c8-b8a0-b881cca66d12"
}

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.