Previous Topic: get_acl Method (vdc Object)Next Topic: list_map Method (srv Object)


srv Object

Use this object to manage servers of a VDC through its controller.

Method

Description

list

Retrieve list of servers

list_verbose

Retrieve information for all servers

list_extended

Retrieve extended information for all servers

list_map

Retrieve list of components running on each server

info

Retrieve information for a server

info_verbose

Retrieve verbose information for a server

info_extended

Retrieve extended information for a server

reboot

Reboot a server

shutdown

Shut a server down

enable

Enable a server for scheduling

disable

Disable a server for scheduling

set

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

power_on

Power on a server

power_off

Power off a server

power_cycle

Power cycle a server

identify

Identify server and NICs

list Method (srv Object)
Description

Retrieve a list of servers

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

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

List servers.

GET http://192.168.123.200/api/v1/srv/list?vdc=mygrid 
Sample Output
XML:
<servers>
   <server>
      <name>srv1</name>
      <bw_alloc>350000000</bw_alloc>
      <bw_free>1650000000</bw_free>
      <cpu_alloc>0.55</cpu_alloc>
      <cpu_free>1.35</cpu_free>
      <enabled>1</enabled>
      <mem_alloc>738197504</mem_alloc>
      <mem_free>11534336</mem_free>
      <role>primary</role>
       <state>up</state>
   </server>
   <server>
      <name>srv2</name>
      <bw_alloc>900000000</bw_alloc>
      <bw_free>1100000000</bw_free>
      <cpu_alloc>1.10</cpu_alloc>
      <cpu_free>0.90</cpu_free>
      <enabled>1</enabled>
      <mem_alloc>1476395008</mem_alloc>
      <mem_free>78643200</mem_free>
      <role>secondary</role>
      <state>up</state>
   </server>
   .
   .
   .
</servers>
JSON:
{
   "server" : [
      {
          "name" : "srv1",
         "cpu_free" : "1.35",
         "state" : "up",
         "bw_free" : "1650000000",
         "cpu_alloc" : "0.55",
         "mem_alloc" : "738197504",
         "mem_free" : "11534336",
         "role" : "primary",
         "bw_alloc" : "350000000",
         "enabled" : "1"
      },
       {
         "name" : "srv2",
         "cpu_free" : "0.90",
         "state" : "up",
         "bw_free" : "1100000000",
         "cpu_alloc" : "1.10",
         "mem_free" : "78643200",
         "mem_alloc" : "1476395008",
         "role" : "secondary",
         "bw_alloc" : "900000000",
         "enabled" : "1"
      },
      .
      .
      .
   ]
} 
HTTP Error Codes
404

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

list_verbose Method (srv 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 information for all servers

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

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

List servers.

GET http://192.168.123.200/api/v1/srv/list_verbose?vdc=mygrid 
Sample Output
XML:
<servers> 
   <server> 
      <name>srv1</name> 
      <bw_alloc>720000000</bw_alloc> 
      <bw_free>1280000000</bw_free> 
      <bw_reserved>0</bw_reserved> 
      <bw_total>2000000000</bw_total> 
      <cpu_alloc>1.69</cpu_alloc> 
      <cpu_bogomips>3991</cpu_bogomips> 
      <cpu_free>2.21</cpu_free> 
      <cpu_freq>1995</cpu_freq> 
      <cpu_load>0.06</cpu_load> 
      <cpu_phy_total>2</cpu_phy_total> 
      <cpu_reserved>0.10</cpu_reserved> 
      <cpu_total>4</cpu_total> 
      <cpu_type>Intel(R) Xeon(R) CPU 5130 @ 2.00GHz </cpu_type> 
      <disk_free>1143356945142</disk_free> 
      <disk_reserved>10737418240</disk_reserved> 
      <disk_total>1493697126400</disk_total> 
      <enabled>1</enabled> 
      <ha_role>primary</ha_role> 
      <hvm_support>1</hvm_support> 
      <mem_alloc>1610612736</mem_alloc> 
      <mem_free>1246756864</mem_free> 
      <mem_reserved>1435500544</mem_reserved> 
      <mem_service>0</mem_service> 
      <mem_total>4292870144</mem_total> 
      <n_disks>1</n_disks> 
      <state>up</state> 
   </server> 
   . 
   . 
   . 
</servers>
JSON:
{ 
   "server" : [" 
      { 
         "cpu_freq" : "1995", 
         "cpu_type" : "Intel(R) Xeon(R) CPU 5130 @ 2.00GHz ", 
         "cpu_bogomips" : "3991", 
         "state" : "up", 
         "cpu_total" : "4", 
         "cpu_alloc" : "1.69", 
         "mem_alloc" : "1610612736", 
         "hvm_support" : "1", 
         "enabled" : "1", 
         "bw_total" : "2000000000", 
         "cpu_reserved" : "0.10", 
         "mem_total" : "4292870144", 
         "name" : "srv1", 
         "disk_reserved" : "10737418240", 
         "disk_total" : "1493697126400", 
         "cpu_phy_total" : "2", 
         "cpu_free" : "2.21", 
         "ha_role" : "primary", 
         "mem_reserved" : "1435500544", 
         "mem_service" : "0", 
         "bw_free" : "1280000000", 
         "disk_free" : "1143356945142", 
         "bw_reserved" : "0", 
         "mem_free" : "1246756864", 
         "cpu_load" : "0.30", 
         "bw_alloc" : "720000000", 
         "n_disks" : "1" 
      . 
      . 
      . 
   ] 
} 

HTTP Error Codes
404

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

list_extended Method (srv Object)

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

Description

Retrieve extended information for all servers

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

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Show extended list of servers.

GET http://192.168.123.200/api/v1/srv/list_extended?vdc=mygrid 
Sample Output
XML:
<servers>
   <server>
      <name>srv1</name> 
       <bw_alloc>350000000</bw_alloc>
      <bw_free>1650000000</bw_free>
       <cpu_alloc>0.55</cpu_alloc>
      <cpu_free>1.35</cpu_free>
      <enabled>1</enabled>
      <mem_alloc>738197504</mem_alloc>
      <mem_free>11534336</mem_free>
      <role>primary</role>
      <state>up</state>
   </server>
   <server>
      <name>srv2</name>
      <bw_alloc>900000000</bw_alloc>
      <bw_free>1100000000</bw_free>
      <cpu_alloc>1.10</cpu_alloc>
      <cpu_free>0.90</cpu_free>
      <enabled>1</enabled>
       <mem_alloc>1476395008</mem_alloc>
      <mem_free>78643200</mem_free>
       <role>secondary</role>
      <state>up</state>
   </server>
  .
   .
   .
   </servers>
JSON:
{
   "server" : [
       {
         "name" : "srv1",
         "cpu_free" : "1.35",
         "state" : "up",
         "bw_free" : "1650000000",
         "cpu_alloc" : "0.55",
         "mem_alloc" : "738197504",
         "mem_free" : "11534336",
         "role" : "primary",
         "bw_alloc" : "350000000",
         "enabled" : "1"
      },
      {
         "name" : "srv2",
         "cpu_free" : "0.90",
         "state" : "up",
         "bw_free" : "1100000000",
         "cpu_alloc" : "1.10",
         "mem_free" : "78643200",
         "mem_alloc" : "1476395008",
         "role" : "secondary",
         "bw_alloc" : "900000000",
         "enabled" : "1"
      }, 
      .
      .
      .
   ]
} 
HTTP Error Codes
404

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