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

Deployables

DRAFT

{{toc}}

Create a new deployable

Request

curl -X POST --user admin:password --header "Content-Type: application/xml" \
--header "Accept: application/xml" -k  https://localhost/conductor/api/deployable \
--data "<deployable> \
<name>deplname</name> \
<description>some text</description> \
<xml><![CDATA[ SOME VALID XML ]]></xml> \
<xml_filename>fname</xml_filename> \
</deployable>"

where SOME VALID XML is something like\

<?xml version="1.0" encoding="UTF-8" ?>
<deployable name="Redmine">
<description>Redmine is a web-based project management application</description>
<assemblies>
<assembly name="web" hwp="hwp1">
<image id="4fc38a0d-1383-4e1d-bc43-850e42541bc0">
</image>
</assembly>
<assembly name="database" hwp="hwp1">
<image id="4fc38a0d-1383-4e1d-bc43-850e42541bc0" build="bb7f6e3e-90cc-4072-afd0-030af99de555">
</image>
</assembly>
</assemblies>
</deployable>

which is the place where we run into a naming problem.

Response

<deployable id="1" href="https://localhost/conductor/api/deployable/1">
  <name>deplname</name>
  <description>some text</description>
  <xml><![CDATA[ SOME VALID XML ]]></xml>
  <xml_filename> fname </xml_filename>
  <owner id="2"></owner>
  <pool_family id="1" href="https://localhost/conductor/api/pool_families/1"></pool_family>
</deployable>

List all deployables

Request

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

Response

<deployables>
<deployable href='http://localhost:3000/api/deployables/1' id='1'></deployable>
<deployable href='http://localhost:3000/api/deployables/3' id='3'></deployable>
<deployable href='http://localhost:3000/api/deployables/2' id='2'></deployable>
</deployables>

Show a single deployable’s details

Request

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

Response

<deployable id="1" href="https://localhost/conductor/api/deployables/1">
  <name>delpname</name>
  <description>some text</description>
  <pool_family id="1" href="https://localhost/conductor/api/pool_family/1" />
  <catalogs>
    <catalog id="1" href="https://localhost/conductor/api/catalogs/1" />
  </catalogs>
</deployable>

Update a deployable

Request

curl -X PUT --user admin:password --header "Content-Type: application/xml" \
--header "Accept: application/xml" -k  https://localhost/conductor/api/deployables/1 \
--data "<deployable> \
<name>deplname</name> \
<description>some text</description> \
<xml><![CDATA[ SOME VALID XML ]]></xml> \
<xml_filename>fname</xml_filename> \
</deployable>"

Response

<deployable id="1" href="https://localhost/conductor/api/deployable/1">
  <name>deplname</name>
  <description>some text</description>
  <xml><![CDATA[ SOME VALID XML ]]></xml>
  <xml_filename> fname </xml_filename>
  <owner id="2"></owner>
</deployable>

Delete a deployable

Request

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

Response

If success,

<deplyable id="1">
 <status>DELETED</status>
</deployable>

If failure,

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