Use this object to manage components on a VDC.
|
Method |
Description |
|
Retrieve list of application components |
|
|
Retrieve component information |
|
|
Run a shell command on a specified application component |
|
|
Start a component |
|
|
Stop a component |
|
|
Continue starting of component |
|
|
Restart a component |
Retrieve list of application components
/api/v2/comp/list?app=application&vdc=controller-name
Name of the application
Name of the target virtual data center
synchronous
GET
Retrieve list of components in application test.
GET http://192.168.123.200/api/v2/comp/list?app=test&vdc=mygrid
<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>
{
"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"
}
Entity vdc mygrid not found - A VDC name was specified that is not configured in the WS_API application.
Missing required arguments (app). - Argument app=app is missing from the request.
Failed to list components for application 'test' - it is not installed. - An invalid application name was specified in the request.
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.
Retrieve component information
/api/v2/comp/info?app=application&comp=component&vdc=controller-name
Name of the application
Name of the component
Name of the target virtual data center
synchronous
GET
Retrieve information for main.LUX5 in application test.
GET http://192.168.123.200/api/v2/comp/info?app=test&comp=main.LUX5&vdc=mygrid
<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>
{
"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"
}
Entity vdc mygrid not found - A VDC name was specified that is not configured in the WS_API application.
Missing required arguments (app). - Argument app=app missing in the request.
Missing required arguments (comp). - Argument comp=comp missing in the request.
Failed to display info for component test:main.srv - does not exist. - Application/component specified in the request is invalid or not running.
Run a shell command on a specified application component.
/api/v2/comp/exec?app=test&comp=component&cmd=command&vdc=controller-name
Name of the application
Name of the component
Shell command to run.
Name of the target virtual data center
synchronous
GET
Run the ‘vmstat’ command on component test::mon.
GET http://192.168.123.200/api/v2/comp/exec?app=test&comp=main.mon&cmd=’vmstat’&vdc=mygrid
Entity vdc mygrid not found - A VDC name was specified that is not configured in the WS_API application.
Missing required arguments (app). - Argument app=app missing in the request.
Missing required arguments (comp). - Argument comp=comp missing in the request.
Application test does not exist. - An invalid application name was specified in the request.
Component main.mon does not exist. - An invalid component name was specified in the request.
Note: The command will not run unless an ACL is set on the application that contains the target component to authorize the user representing the Web Services API to control the application.
Start a component
/api/v2/comp/start?app=application&comp=component&vdc=controller-name
Name of the application
Name of the component
Name of the target virtual data center
asynchronous
GET
Start main.LUX5 in application test.
GET http://192.168.123.200/api/v2/comp/start?app=test&comp=main.LUX5&vdc=mygrid
<job>be805915-76b2-48c8-b8a0-b881cca66da6</job>
{
"job" : "be805915-76b2-48c8-b8a0-b881cca66da6"
}
Entity vdc mygrid not found - A VDC name was specified that is not configured in the WS_API application.
Missing required arguments (app). - Argument app=app missing in the request.
Missing required arguments (comp). - Argument comp=comp missing in the request.
Note: To get the status of job, issue a /api/v2/job/info? request with the job_id returned above as the argument. For more information about how to obtain the job status, refer to the job object.
Stop a component
/api/v2/comp/stop?app=application&comp=component&vdc=controller-name
Name of the application
Name of the component
Name of the target virtual data center
asynchronous
GET
Stop main.LUX5 in application test.
GET http://192.168.123.200/api/v2/comp/stop?app=test&comp=main.LUX5&vdc=mygrid
<job>be805915-76b2-48c8-b8a0-b881cca66da6</job>
{
"job" : "be805915-76b2-48c8-b8a0-b881cca66da6"
}
Entity vdc mygrid not found - A VDC name was specified that is not configured in the WS_API application.
Missing required arguments (app). - Argument app=app missing in the request.
Missing required arguments (comp). - Argument comp=comp missing in the request.
Note: To get the status of job, issue a /api/v2/job/info? request with the job_id returned above as the argument. For more information about how to obtain the job status, refer to the job object.
Continue starting of a component
/api/v2/comp/continue?app=application&comp=component&vdc=controller-name
Name of the application
Name of the component
Name of the target virtual data center
asynchronous
GET
Continue starting of main.LUX5 in application test.
GET http://192.168.123.200/api/v2/comp/continue?app=test&comp=main.LUX5&vdc=mygrid
<job>be805915-76b2-48c8-b8a0-b881cca66da6</job>
{
"job" : "be805915-76b2-48c8-b8a0-b881cca66da6"
}
Entity vdc mygrid not found - A VDC name was specified that is not configured in the WS_API application.
Missing required arguments (app). - Argument app=app missing in the request.
Missing required arguments (comp). - Argument comp=comp missing in the request.
Note: To get the status of job, issue a /api/v2/job/info? request with the job_id returned above as the argument. For more information about how to obtain the job status, refer to the job object.
Restart a component
/api/v2/comp/restart?app=application&comp=component&vdc=controller-name
Name of the application
Name of the component
Name of the target virtual data center
asynchronous
GET
Restart main.LUX5 in application test.
GET http://192.168.123.200/api/v2/comp/restart?app=test&comp=main.LUX5&vdc=mygrid
<job>be805915-76b2-48c8-b8a0-b881cca66da6</job>
{
"job" : "be805915-76b2-48c8-b8a0-b881cca66da6"
}
Entity vdc mygrid not found - A VDC name was specified that is not configured in the WS_API application.
Missing required arguments (app). - Argument app=app missing in the request.
Missing required arguments (comp). - Argument comp=comp missing in the request.
Note: To get the status of job, issue a /api/v2/job/info? request with the job_id returned above as the argument. For more information about how to obtain the job status, refer to the job object.
|
Copyright © 2013 CA Technologies.
All rights reserved.
|
|