Previous Topic: srv ObjectNext Topic: reboot Method (srv Object)


list_map 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 &map.

Description

Retrieve list of components running on each server

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

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Retrieve list of components running on each server.

GET http://192.168.123.200/api/v1/srv/list_map?vdc=mygrid 
Sample Output
XML:
<server> 
   <name>srv1</name> 
   <bw_alloc>720000000</bw_alloc> 
   <bw_free>1280000000</bw_free> 
   <component controller></component controller> 
   <component WS_API.main.api_srv> 
      <bw>250000000</bw> 
      <cpu>0.40</cpu> 
      <mem>536870912</mem> 
       <mem_service>0</mem_service> 
      <state>running</state> 
   </component WS_API.main.api_srv> 
   . 
   . 
   . 
   <cpu_alloc>1.69</cpu_alloc> 
   <cpu_free>2.21</cpu_free> 
   <enabled>1</enabled> 
   <mem_alloc>1610612736</mem_alloc> 
   <mem_free>1246756864</mem_free> 
   <role>primary</role> 
   <state>up</state> 
</server>
JSON:
{ 
   "state" : "up", 
   "cpu_alloc" : "1.69", 
   "mem_alloc" : "1610612736", 
   "enabled" : "1", 
   "component controller" : {}, 
   "name" : "srv1", 
   "component WS_API.main.api_srv" : { 
      "bw" : "250000000", 
      "cpu" : "0.40", 
      "mem" : "536870912", 
      "state" : "running", 
      "mem_service" : "0" 
   }, 
   . 
   . 
   . 
   "cpu_free" : "2.21", 
   "bw_free" : "1280000000", 
   "mem_free" : "1246756864", 
   "role" : "primary", 
   "bw_alloc" : "720000000" 
} 
HTTP Error Codes
404

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

info Method (srv Object)
Description

Retrieve information for a server

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

Name of the server

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Retrieve information for server.

GET http://192.168.123.200/api/v1/srv/info?srv=srv1&vdc=mygrid 
Sample Output
XML:
<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>
JSON:
{ 
   "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.

400.4

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

404.1

Entity not found - Failed to display info for server srv - it doesn't exist. An invalid server name was specified in the request.

info_verbose Method (srv Object)

Note: This method has been deprecated and is included here for compatibility with existing user scripts.

Description

Retrieve verbose information for a server

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

Name of the server

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Show verbose information for srv1.

GET http://192.168.123.200/api/v1/srv/info_verbose?srv=srv1&vdc=mygrid 
Sample Output
XML:
<server>
   <name>srv1</name>
   <bw_alloc>350000000</bw_alloc>
    <bw_free>1650000000</bw_free>
   <bw_reserved>0</bw_reserved>
   <bw_total>2000000000</bw_total>
    <cpu_alloc>0.55</cpu_alloc>
   <cpu_bogomips>4019</cpu_bogomips>
   <cpu_free>1.35</cpu_free>
    <cpu_freq>2009</cpu_freq>
   <cpu_load>0.10</cpu_load>
   <cpu_phy_total>2</cpu_phy_total>
    <cpu_reserved>0.10</cpu_reserved>
   <cpu_total>2</cpu_total>
   <cpu_type>AMD Opteron(tm) Processor 246 </cpu_type>
   <disk_free>1421930467533</disk_free>
   <disk_reserved>10737418240</disk_reserved>
    <disk_total>1493697126400</disk_total>
   <enabled>1</enabled>
   <ha_role>primary</ha_role>
    <hvm_support>0</hvm_support>
   <mem_alloc>738197504</mem_alloc>
   <mem_free>11534336</mem_free>
    <mem_reserved>1395654656</mem_reserved>
   <mem_service>0</mem_service>
   <mem_total>2145386496</mem_total>
   <n_disks>1</n_disks>
   <state>up</state>
</server>
JSON:
{
   "cpu_freq" : "2009",
   "cpu_type" : "AMD Opteron(tm) Processor 246 ",
   "cpu_bogomips" : "4019",
   "state" : "up",
   "cpu_total" : 2",
   "cpu_alloc" : "0.55",
   "mem_alloc" : "738197504",
   "hvm_support" : "0",
   "enabled" : "1",
   "bw_total" : "2000000000",
   "cpu_reserved" : "0.10",
   "mem_total" : "2145386496",
   "name" : "srv1",
   "disk_reserved" : "10737418240",
   "disk_total" : "1493697126400",
   "cpu_phy_total" : "2",
   "cpu_free" : "1.35",
   "ha_role" : "primary",
   "mem_reserved" : "1395654656",
   "mem_service" : "0",
   "bw_free" : "1650000000",
   "disk_free" : "1421930467533",
   "bw_reserved" : "0",
   "mem_free" : "11534336",
   "cpu_load" : "0.38",
   "bw_alloc" : "350000000",
   "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.

400.4

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

info_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 a server

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

Name of the server

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Retrieve extended information for srv1.

GET http://192.168.123.200/api/v1/srv/info_extended?srv=srv1&vdc=mygrid 
Sample Output
XML:
<server>
   <name>srv1</name>
   <bios_date>03/23/2006</bios_date>
  <bios_vendor>HP</bios_vendor> 
  <bios_version>2.16 </bios_version> 
  <boot_id>1dd11bbb-0a09-410f-b602-b264ee60f8fc</boot_id> 
  <bw_alloc>350000000</bw_alloc>
    <bw_free>1650000000</bw_free>
   <bw_reserved>0</bw_reserved>
   <bw_total>2000000000</bw_total>
    <cpu_alloc>0.55</cpu_alloc>
   <cpu_bogomips>4019</cpu_bogomips>
   <cpu_free>1.35</cpu_free>
    <cpu_freq>2009</cpu_freq>
   <cpu_load>0.10</cpu_load>
   <cpu_phy_total>2</cpu_phy_total>
    <cpu_reserved>0.10</cpu_reserved>
   <cpu_total>2</cpu_total>
   <cpu_type>AMD Opteron(tm) Processor 246 </cpu_type>
   <disk_free>1421930467533</disk_free>
   <disk_reserved>10737418240</disk_reserved>
    <disk_total>1493697126400</disk_total>
   <enabled>1</enabled>
   <ha_role>primary</ha_role>
    <hvm_support>0</hvm_support>
   <mem_alloc>738197504</mem_alloc>
   <mem_free>11534336</mem_free>
    <mem_reserved>1395654656</mem_reserved>
   <mem_service>0</mem_service>
   <mem_total>2145386496</mem_total>
   <motherboard_manufacturer>Wistron Corporation</motherboard_manufacturer> 
  &ly;motherboard_model>K85NL</motherboard_model> 
  <motherboard_version>-1</motherboard_version> 
  <n_disks>1</n_disks> 
   <power_control_enabled>0</power_control_enabled> 
  <state>up</state> 
  <uid>6dc242e202d44eaba074dda981bcf139</uid> 
  <uptime>545854</uptime> 
</server>
JSON:
   "cpu_freq" : "2009",
    "bios_version" : "2.16 "," 
   cpu_type" : "AMD Opteron(tm) Processor 246 ",
   "cpu_bogomips" : "4019",
   "state" : "up",
   "cpu_total" : 2",
    "bios_vendor" : "HP",
   "cpu_alloc" : "0.55",
   "mem_alloc" : "738197504",
   "hvm_support" : "0",
   "enabled" : "1",
   "bw_total" : "2000000000",
   "cpu_reserved" : "0.10",
   "motherboard_manufacturer" : "Wistron Corporation", 
   "uid" : "6dc242e202d44eaba074dda981bcf139", 
   "mem_total" : "2145386496",
   "power_control_enabled" : "0", 
   "name" : "srv1", 
   "disk_reserved" : "10737418240",
   "disk_total" : "1493697126400",
   "cpu_phy_total" : "2",
   "motherboard_version" : "-1 ",
   "cpu_free" : "1.35",
   "ha_role" : "primary",
   "mem_reserved" : "1395654656",
   "mem_service" : "0",
   "bw_free" : "1650000000",
   "disk_free" : "1421930467533",
   "bw_reserved" : "0",
   "mem_free" : "11534336",
   "cpu_load" : "0.38",
   "bw_alloc" : "350000000",
   "n_disks" : "1" 
   "motherboard_model" : "K85NL", 
} 
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 (srv). - Argument srv=srv-name was not specified.

404.1

Entity not found - Failed to display info for server srv - it doesn't exist. An invalid server name was specified in the request.