-
Notifications
You must be signed in to change notification settings - Fork 27
Instances
DRAFT
Request
Show me the instances in deployment 1.
curl -X GET --user admin:password--header “Accept: application/xml” -k [https://localhost/conductor/api/deployments/1/instances](https://localhost/conductor/api/deployments/1/instances)
Show me all instances I can see
curl -X GET --user admin:password--header “Accept: application/xml” -k [https://localhost/conductor/api/instances](https://localhost/conductor/api/instances)
Response
<instances>
<instance id='1' href='https://localhost/conductor/api/deployments/1/instances/1'></instance>
<instance id='2' href='https://localhost/conductor/api/deployments/1/instances/2'></instance>
<instance id='3' href='https://localhost/conductor/api/deployments/1/instances/3'></instance>
</instances>
Request
curl -X GET --user admin:password--header “Accept: application/xml” -k [https://localhost/conductor/api/deployments/1/instances/1](https://localhost/conductor/api/deployments/1/instances/1)
Response
deployment1-f16 inst3 running stopped reboot<hardware_profile id='1' href='https://localhost/conductor/api/hardware_profiles/1'/> <frontend_realm> <owner_id>1</owner_id>
<provider_account id='1' href='https://localhost/conductor/api/provider_accounts/1'/> <public_addresses/> <private_addresses/> <created_at>2012-10-25 04:35:28.608573</created_at> <updated_at>2012-10-25 04:35:35.976259</updated_at>
51a42ec2-1e5d-11e2-8ad5-52540053d8d3 67293e4a-1e5d-11e2-8ad5-52540053d8d<ssh_key_name>deployment1\_f16\_1351209384\_key\_23412322</ssh_key_name>
<history>
<entry>
<time>2012-10-25 23:56:21</time>
<message>created</message>
</entry>
<entry>
<time>2012-10-25 23:56:24</time>
<message>state changed to running</message>
</entry>
<history>
Name and state are the only fields that can be changed. All other fields are read-only. Changes to read-only fields will be ignored if it is something trivial like a create_at, or will result in an error message if say a change was made to associate with a different pool.
Request
curl -X PUT https://localhost/conductor/api/instances/1
<instance id='1'>
<name>new-instance-name</name>
<!-- unchanged fields omitted for brevity -->
</instance>
Response
<instance id='1' href='https://localhost/conductor/api/deployments/1/instances/1'>
<name>new-instance-name</name>
<external_key>inst3</external_key>
<state>running</state>
<hardware_profile id='1' href='https://localhost/conductor/api/hardware_profiles/1'/>
<!--snip-->
</instance>
Request
curl -X PUT https://localhost/conductor/api/instances/1
<instance id='1'>
<state>stopped</state>
<!-- unchanged fields omitted for brevity -->
</instance>
Response
The history indicates that an action to stop the instance has been queued.
Status code: 202
<instance id='1' href='https://localhost/conductor/api/deployments/1/instances/1'>
<name>new-instance-name</name>
<external_key>inst3</external_key>
<state>running</state>
<hardware_profile id='1' href='https://localhost/conductor/api/hardware_profiles/1'/>
<!--snip-->
<history>
<!--snip-->
<entry>
<time>2012-10-26 01:00:00</time>
<message>Instance new-instance-name stop action queued</message>
</entry>
</history>
</instance>
Request
curl -X PUT https://localhost/conductor/api/instances/1
<instance id='1'>
<state>reboot</state>
<!-- unchanged fields omitted for brevity -->
</instance>
Response
Status code: 202
<instance id='1' href='https://localhost/conductor/api/deployments/1/instances/1'>
<name>new-instance-name</name>
<external_key>inst3</external_key>
<state>running</state>
<hardware_profile id='1' href='https://localhost/conductor/api/hardware_profiles/1'/>
<!--snip-->
<history>
<!--snip-->
<entry>
<time>2012-10-26 01:00:00</time>
<message>reboot action queued</message>
</entry>
</history>
</instance>
This will queue the instance to reboot. The state never changes because reboots happen entirely on the cloud provider. From conductor’s perspective the instance is always running.