Previous Topic: get_acl Method (app Object)Next Topic: exec Method (comp Object)


comp Object

Method

Description

list

Retrieve list of application components

info

Retrieve component information

exec

Log in an application component and run a specified shell command.

start

Start a component

stop

Stop a component

continue

Continue starting of component

restart

Restart a component

list Method (comp Object)
Description

Retrieve list of application components

Syntax
/api/v1/comp/list?app=application&vdc=controller-name 
Arguments
app

Name of the application

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Retrieve list of components in application test.

GET http://192.168.123.200/api/v1/comp/list?app=test&vdc=mygrid 
Sample Output
XML:
<application>
   <name>Lamp</name>
   <components>
       <component>
         <name>main.admin</name>
         <bw>50000000</bw>
         <cpu>0.05</cpu>
         <mem>67108864</mem>
         <server>srv2</server>
         <state>running</state>
      </component>
      <component>
          <name>main.config</name>
         <bw>150000000</bw>
          <cpu>0.20</cpu>
         <mem>268435456</mem>
          <server>srv3</server>
         <state>running</state>
      </component>
      <component>
         <name>main.dbase</name>
         <bw>100000000</bw>
         <cpu>0.40</cpu>
         <mem>536870912</mem>
         <server>srv1</server>
         <state>running</state>
      </component>
         .
         .
         .
   </components>
</application>
JSON:
{
   "component" : [
       {
         "bw" : "50000000",
   nbsp;     "cpu" : "0.05",
         "name" : "main.admin",
         "mem" : "67108864",
         "server" : "srv2",
         "state" : "running"
       },
      {
   
      "bw" : "150000000",
         "cpu" : "0.20",
         "name" : "main.config",
         "mem" : "268435456",
         "server" : "srv3",
         "state" : "running"
       },
      {
         "bw" : "100000000",
         "cpu" : "0.40",
         "name" : "main.dbase",
         "mem" : "536870912",
         "server" : "srv1",
         "state" : "running"
       },
      .
      .
      .
   ],
   "name" : "Lamp"
} 

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 (app). - Argument app=app is missing from the request.

404.1

Failed to list components for application 'test' - it is not installed. - An invalid application name was specified in the request.

404.1

Failed to list components for application 'ws_api' - get info failed - may be due to it not running. Component list is requested for an application in stopped state.

info Method (comp Object)
Description

Retrieve component information

Syntax
/api/v1/comp/info?app=application&comp=component&vdc=controller-name 
Arguments
app

Name of the application

comp

Name of the component

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Retrieve information for main.LUX5 in application test.

GET http://192.168.123.200/api/v1/comp/info?app=test&comp=main.LUX5&vdc=mygrid 
Sample Output
XML:
<component> 
   <name>main.vds64_centos50</name> 
   <bw>250000000</bw> 
   <class>.LUX5</class> 
   <console_options>ssh:22,text</console_options> 
   <cpu>0.25</cpu> 
   <dflt_ip>10.144.12.1</dflt_ip> 
   <mem>268435456</mem> 
   <mem_service>0</mem_service> 
   <os_guess>Linux</os_guess> 
   <os_kernel>Linux 2.6.18.8-xenU #1 SMP Mon Aug 18 14:00:41 PDT 2008</os_kernel> 
   <os_name>!CentOS</os_name> 
   <os_type>Linux</os_type> 
   <os_version>5</os_version> 
   <pv_driver>unknown</pv_driver> 
   <server>srv1</server> 
   <state>running</state> 
   <t_start>1271891904</t_start> 
   <t_state_chg>1271891904</t_state_chg> 
</component> 
JSON:
{ 
   "os_guess" : "Linux", 
   "state" : "running", 
   "pv_driver" : "unknown", 
   "os_version" : "5", 
   "server" : "srv1", 
   "os_type" : "Linux", 
   "t_state_chg" : "1272066766", 
   "console_options" : "ssh:22,text", 
   "dflt_ip" : "10.144.12.1", 
   "cpu" : "0.25", 
   "os_name" : "CentOS", 
   "name" : "main.vds64_centos50", 
   "mem_service" : "0", 
   "bw" : "250000000", 
   "os_kernel" : "Linux 2.6.18.8-xenU #1 SMP Mon Aug 18 14:00:41 PDT 2008", 
   "t_start" : "1272066766", 
   "mem" : "268435456", 
   "class" : ".VDS64_CENTOS50" 
} 

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 (app). - Argument app=app missing in the request.

400.4

Missing required arguments (comp). - Argument comp=comp missing in the request.

404.1

Failed to display info for component test:main.srv - does not exist. - Application/component specified in the request is invalid or not running.