Skip to content
rwsu edited this page Feb 9, 2013 · 2 revisions

Deployments

Create a new deployment

Request

curl -X POST https://localhost/conductor/api/deployments

<deployment>
  <name>deployment1</name>
  <pool id='1'/>
  <frontend_realm id='1'/> <!-- optional, auto select if not specified-->
  <deployable id='1'/>
  <partial_launch>0</partial_launch> <!-- ignore instance errors during launch -->
</deployment>

Response

<deployment id='1' href='https://localhost/conductor/api/deployments/1'>
  <name>deployment1</name>
  <state_machine id='1' href='http://localhost/conductor/state_machines/1'>
  <state id='3' href='http://localhost/conductor/state_machines/1/states/3'>
    <value>new</value>
    <description>The state in which the deployment is new</description>
    <transitions>
      <state id='1' href='http://localhost/conductor/state_machines/1/states/1'>
    </transitions>
  </state>
  <pool id='1' href='https://localhost/conductor/api/pools/1'></pool>
  <frontend_realm id='1' href='https://localhost/conductor/api/frontend_realms/1'></frontend_realm>
  <instances>
  </instances>
  <global_uptime></global uptime>
  <uptime_1st_instance_running></global uptime>
  <scheduled_for_deletion>false</scheduled_for_deletion>
  <uuid>67160b40-1e5d-11e2-8ad5-52540053d8d3</uuid>
  <deployable_xml>
    <deployable version="1.0" name="f16-dep">
      <description/>
      <assemblies>
        <assembly name="f16" hwp="small-x86_64">
          <image id="51a42ec2-1e5d-11e2-8ad5-52540053d8d3"/>
        </assembly>
      </assemblies>
    </deployable>
  </deployable_xml>
</deployment>

List deployments

Request

Show all deployments

curl -X GET --user admin:password --header "Accept: application/xml" -k  https://localhost/conductor/api/deployments

Or list deployments for a specific pool

curl -X GET --user admin:password --header "Accept: application/xml" -k  https://localhost/conductor/api/pools/1/deployments

Response

<deployments>
  <deployment id='1' href='https://localhost/conductor/api/deployments/1'>
    <!-- snip (full details for deployment here) -->
  </deployment>
  <deployment id='2' href='https://localhost/conductor/api/deployments/2'>
    <!-- snip (full details for deployment here) -->
  </deployment>
</deployments>

Show a deployment’s details

Request

curl -X GET --user admin:password --header "Accept: application/xml" -k  https://localhost/conductor/api/deployments/1

Response

<deployment id='1' href='https://localhost/conductor/api/deployments/1'>
  <name>webserver-deployment</name>
  <state_machine id='1' href='http://localhost/conductor/state_machines/1'>
  <state id='1' href='http://localhost/conductor/state_machines/1/states/1'>
    <value>running</value>
    <description>The state in which the deployment is running</description>
    <transitions>
      <state id='2' href='http://localhost/conductor/state_machines/1/states/2'>
    </transitions>
  </state>
  <pool id='1' href='https://localhost/conductor/api/pools/1'></pool>
  <frontend_realm id='1' href='https://localhost/conductor/api/frontend_realms/1'></frontend_realm>
  <instances>
    <instance id='1' href='https://localhost/conductor/api/deployments/1/instances/1'></instance>
  </instances>
  <uptime_all>5 minutes</uptime_all>
  <uptime_1st_instance_running>5 minutes</global uptime>
  <scheduled_for_deletion>false</scheduled_for_deletion>
  <uuid>67160b40-1e5d-11e2-8ad5-52540053d8d3</uuid>
  <deployable_xml>
    <deployable version="1.0" name="f16-dep">
      <description/>
      <assemblies>
        <assembly name="f16" hwp="small-x86_64">
          <image id="51a42ec2-1e5d-11e2-8ad5-52540053d8d3"/>
        </assembly>
      </assemblies>
    </deployable>
  </deployable_xml>
</deployment>

Updates - name and state

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.

Changing the deployment’s name

Request

curl -X PUT https://localhost/conductor/api/deployments/1

<deployment id='1'>
  <name>eastcoast-webserver1</name>
  <!-- other fields left unchanged have been omitted for brevity -->
</deployment>

Response

<deployment id='1' href='https://localhost/conductor/api/deployments/1'>
  <name>eastcoast-webserver1</name>
  <!--snip-->
</deployment>

Moving a deployment from running to stopped

Enqueues a background job to stop the deployment.

Request

curl -X PUT https://localhost/conductor/api/deployments/1

<deployment id='1'>
  <state id='2' href='http://localhost/conductor/state_machines/1/states/2'/>

  <!-- other fields left unchanged have been omitted for brevity -->
</deployment>

Response

Status Code: 202

<deployment id='1' href='https://localhost/conductor/api/deployments/1'>
  <name>eastcoast-webserver1</name>
  <state id='1' href='http://localhost/conductor/state_machines/1/states/1'>
    <value>running</value>
    <description>The state in which the deployment is running</description>
    <transitions>
      <state id='2' href='http://localhost/conductor/state_machines/1/states/2'>
    </transitions>
  </state>
  <!--snip-->
</deployment>

Delete

Request

curl -X DELETE --user admin:password --header "Accept: application/xml" -k  https://localhost/conductor/api/deployments/1

Response

If success, return 204 No Content.

If failure,

<error>
  <codee>RecordNotFound</codee>
  <message>Couldn't find Deployment with ID=1</message>
</error>
Clone this wiki locally