Skip to content
Matt Wagner edited this page Oct 25, 2012 · 1 revision

Pools

Create a new pool

Request

Unlimited quota is given if a quota is not specified.\

curl -X POST --user admin:password --header "Content-Type: application/xml" \
--header "Accept: application/xml" -k  https://localhost/conductor/api/pools \
--data "<pool><name>pool1name</name><pool_family_id>1</pool_family_id><enabled>true</enabled></pool>"

Response

Response showing unlimited quota.

<pool id="1" href="https://localhost/conductor/api/pools/1">
  <name>pool1name</name>
  <pool_family id="1" href="https://localhost/conductor/api/pool_families/1">pool family 1 name</pool_family>   
  <quota maximum_running_instances='unlimited'></quota>
  <enabled>true</enabled>
</pool>

Request

An example where quota is specified. Here quota is set to a maximum of 100 running instances.\

curl -X POST --user admin:password --header "Content-Type: application/xml" \
--header "Accept: application/xml" -k  https://localhost/conductor/api/pools \
--data "<pool><name>pool1name</name><pool_family_id>1</pool_family_id><enabled>true</enabled>
<quota maximum_running_instances='100'></quota></pool>" 

Response

Response showing the specified quota of 100.

<pool id="1" href="https://localhost/conductor/api/pools/1">
  <name>pool1name</name>
  <pool_family id="1" href="https://localhost/conductor/api/pool_families/1">pool family 1 name</pool_family>   
  <quota maximum_running_instances='100'></quota>
  <enabled>true</enabled>
</pool>

List all pools

Request

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

Response

<pools>
<pool href='http://localhost:3000/api/pools/1' id='1'></pool>
<pool href='http://localhost:3000/api/pools/3' id='3'></pool>
<pool href='http://localhost:3000/api/pools/2' id='2'></pool>
</pools>

Show a single pool’s details

Request

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

Response

<pool id="1" href="https://localhost/conductor/api/pools/1">
  <name>pool1name</name>
  <pool_family id="1" href="https://localhost/conductor/api/pool_families/1">pool family 1 name</pool_family>   
  <enabled>true</enabled>
  <quota maximum_running_instances='100'></quota>
  <!-- TODO add deployments and catalogs
  <deployments>
    <deployment id="1" href="https://localhost/conductor/api/deployments/1">deployment1</deployment>
    ...
  </deployments>
  -->
</pool>

Update a pool

Request

curl -X PUT --user admin:password --header "Content-Type: application/xml" \
--header "Accept: application/xml" -k  https://localhost/conductor/api/pools/1 \
--data "<pool><name>updated-name</name><pool_family_id>1</pool_family_id><enabled>false</enabled>
<quota maximum_running_instances='200'></quota></pool>" 

Response

<pool id="1" href="https://localhost/conductor/api/pools/1">
  <name>updated-name</name>
  <pool_family id="1" href="https://localhost/conductor/api/pool_families/1">pool family 1 name</pool_family>   
  <enabled>false</enabled>
  <quota maximum_running_instances='200'></quota>
  <!-- TODO add deployments and catalogs
  <deployments>
    <deployment id="1" href="https://localhost/conductor/api/deployments/1">deployment1</deployment>
    ...
  </deployments>
  -->
</pool>

Delete a pool

Request

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

Response

If success,

<pool id="1">
 <status>DELETED</status>
</pool>

If failure,

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