“Submitting a Request” using the REST APIs in CSA
“Submit a Service Request” using CSA 3.x REST APIs
Introduction:
This document guides developers to use CSA 3.x REST API with examples to submit a service request.
API:
URI / /catalog/<catalog_id>/requestUse "List catalogs" in the “HP Cloud Service Automation API Reference”to get the catalog ID.
Method / POST
Parameters / userIdentifier=<user_id
Required; the user ID for which a request needs to be made. This user
should be a consumer user who has the necessary permissions for the offering
. See "Get userIdentifier" in the “HP Cloud Service Automation API Reference” for the steps required to getthe userIdentifier value.
Returns / 200 – Ok
401 - Not authorized
404 - Not found
500 - Server exception
The Post Body should have the following structure
ServiceRequest
description[ Description of the Request ] </description>
name [ Name of the Request ] </name>
displayName [ Display Name of the Request] </displayName
artifactContext
id [ Service Offering UUID] </id> <!—To be obtained from “List offerings in the catalog”in the “HP
Cloud Service Automation API Reference -->
</artifactContext
requestedAction
name>ORDER</name>
property
name>START_DATE</name>
values
value[ Subscription start Date ] </value> < !—e.g. 2014-07-25T16:50:14.000Z. Time should match the current system time -->
</values>
</property>
property
name>END_DATE</name>
values
value[ Subscription End Date ] </value>
</values>
</property>
property
name>SERVICE_NAME</name>
values
value[ Name of the Subscription ]</value>
</values>
</property>
property
name>SERVICE_DESCRIPTION</name>
values
value[ Description for the Subscription ] </value>
</values>
</property>
property
name>OPTION_MODEL</name>
values
optionModel <!--To be obtained from “Get offering Detail”REST API-->
name[ Name of the option Model ] </name>
optionSets
name[ Name of the optionSet] </name>
options
name[ Name of the option]</name>
isSelected[ true/ false] </isSelected
property
name[ Name of property ] </name>
values<value>[ Value of the property ] </value</values>
</property>
</options>
</optionSets
</optionModel
</property>
property
name>OWNER_GROUP</name>
values
value> [ DN of the Group for which group ownership needs to be provided ] <value> <!-- e.g.
<![CDATA[cn=Group1,cn=Users,dc=hp,dc=com]] -- >
</values>
/property>
</requestedAction
</ServiceRequest
OPTION MODEL DETAILS:
The “Option Model”and its details, can be taken from the “Get offering Detail” API response. The details of the API can be found in the “HP Cloud Service Automation API Reference” doc.
This is illustrated with an example below
Ifthe following optionModel is returned as a part of the “Get offering Detail”, the highlighted tags are the ones which are used to create the option model portion of the “Submit request” body.
optionModel
id>2c9042944767eb5801476890f61f020f</id>
objectId2c9042944767eb5801476890f61f020f</objectId
createdOn2014-07-24T16:59:54.637+05:30</createdOn
updatedOn2014-07-24T19:00:36.617+05:30</updatedOn
...isCriticalSystemObject>false</isCriticalSystemObject
name>OptionSet1</name>
optionSets
id>2c9042944767eb5801476890f61d020d</id>
objectId2c9042944767eb5801476890f61d020d</objectId
createdOn2014-07-24T16:59:54.640+05:30</createdOn
updatedOn2014-07-24T19:00:36.617+05:30</updatedOn
...isCriticalSystemObject>false</isCriticalSystemObject
description>Option Set Description</description>
iconUrl>/csa/images/library/default.png</iconUrl
name>BDB5DEBD-D9A5-2865-BA65-67F29A24C622</name>
displayNameOption Set Displayname</displayName
options
id>2c9042944767eb5801476890f61e020e</id>
objectId2c9042944767eb5801476890f61e020e</objectId
createdOn2014-07-24T16:59:54.640+05:30</createdOn
updatedOn2014-07-24T19:00:36.617+05:30</updatedOn
...isCriticalSystemObject>false</isCriticalSystemObject
description>optionSet1Description</description>
name>199B87A6-7E77-B2CC-F666-67F29A232BE0</name>
displayNameoptionSet1</displayName
consumerReadOnlyfalse</consumerReadOnly
consumerVisibletrue</consumerVisible
isSelectedtrue</isSelected
orderIndex0</orderIndex
...<property>
id>2c9042944767eb5801476890f6310212</id>
objectId2c9042944767eb5801476890f6310212</objectId
createdOn2014-07-24T16:59:54.640+05:30</createdOn
updatedOn2014-07-24T19:00:36.467+05:30</updatedOn
...isCriticalSystemObject>false</isCriticalSystemObject
name>optionSet1OptionOne</name>
displayNameoptionSet1OptionOne</displayName
enableValidationfalse</enableValidation
...<values>
id>2c9042944767eb5801476890f6310213</id>
createdOn2014-07-24T19:00:36.467+05:30</createdOn
updatedOn2014-07-24T19:00:36.467+05:30</updatedOn
...<value>VALUE1</value>
</values>
maxOccurs1</maxOccurs
minOccurs1</minOccurs
orderIndex0</orderIndex
confidential>false</confidential>
encrypted>false</encrypted>
consumerReadOnlyfalse</consumerReadOnly
consumerVisibletrue</consumerVisible
dynamicValueEnabledfalse</dynamicValueEnabled
measurable>false</measurable>
editable>true</editable>
</property>
</options>
maxOccurs1</maxOccurs
minOccurs1</minOccurs
orderIndex0</orderIndex
isInitialOrdertrue</isInitialOrder
consumerReadOnlyfalse</consumerReadOnly
consumerVisibletrue</consumerVisible
</optionSets
optionSets
id>2c9042944767eb5801476890f6350214</id>
objectId2c9042944767eb5801476890f6350214</objectId
createdOn2014-07-24T16:59:54.643+05:30</createdOn
updatedOn2014-07-24T19:00:36.617+05:30</updatedOn
...isCriticalSystemObject>false</isCriticalSystemObject
description>osTypeDsc</description>
iconUrl>/csa/images/library/default.png</iconUrl
name>51560C05-A78E-28BA-8DC3-680B1770B179</name>
displayNameosType</displayName
options
id>2c9042944767eb5801476890f6360215</id>
objectId2c9042944767eb5801476890f6360215</objectId
createdOn2014-07-24T16:59:54.643+05:30</createdOn
updatedOn2014-07-24T19:00:36.617+05:30</updatedOn
...isCriticalSystemObject>false</isCriticalSystemObject
description>windowsDsc</description>
name>DB88AF24-DEE9-8E3F-AB3E-680B17700608</name>
displayNamewindows</displayName
consumerReadOnlyfalse</consumerReadOnly
consumerVisibletrue</consumerVisible
isSelectedtrue</isSelected
orderIndex0</orderIndex
...childOptionSets
id>2c9042944767eb5801476890f63c0218</id>
objectId2c9042944767eb5801476890f63c0218</objectId
createdOn2014-07-24T16:59:54.643+05:30</createdOn
updatedOn2014-07-24T19:00:36.617+05:30</updatedOn
...isCriticalSystemObject>false</isCriticalSystemObject
description>sdTypeDsc</description>
iconUrl>/csa/images/library/default.png</iconUrl
name>6B9259E9-0763-FFB9-31DB-681442A8A997</name>
displayNamesdType</displayName
options
id>2c9042944767eb5801476890f63d0219</id>
objectId2c9042944767eb5801476890f63d0219</objectId
createdOn2014-07-24T16:59:54.640+05:30</createdOn
updatedOn2014-07-24T19:00:36.617+05:30</updatedOn
...isCriticalSystemObject>false</isCriticalSystemObject
description>staticDsc</description>
name>C24500A9-FF86-D453-65A8-681442A85838</name>
displayNamestatic</displayName
consumerReadOnlyfalse</consumerReadOnly
consumerVisibletrue</consumerVisible
isSelectedtrue</isSelected
orderIndex0</orderIndex
...<property>
id>2c9042944767eb5801476890f640021e</id>
objectId2c9042944767eb5801476890f640021e</objectId
createdOn2014-07-24T16:59:54.647+05:30</createdOn
updatedOn2014-07-24T19:00:36.480+05:30</updatedOn
...
isCriticalSystemObjectfalse</isCriticalSystemObject
description>ipDsc</description>
name>ip</name>
displayNameip</displayName
enableValidationfalse</enableValidation
...
values
id>2c9042944767eb5801476890f640021f</id>
createdOn2014-07-24T19:00:36.480+05:30</createdOn
updatedOn2014-07-24T19:00:36.480+05:30</updatedOn
...
<value>192.168.100.10</value>
</values>
maxOccurs1</maxOccurs
minOccurs1</minOccurs
orderIndex1</orderIndex
confidential>false</confidential>
encrypted>false</encrypted>
consumerReadOnlyfalse</consumerReadOnly
consumerVisibletrue</consumerVisible
dynamicValueEnabledfalse</dynamicValueEnabled
measurable>false</measurable>
editable>true</editable>
</property>
property
id>2c9042944767eb5801476890f63e021c</id>
objectId2c9042944767eb5801476890f63e021c</objectId
createdOn2014-07-24T16:59:54.643+05:30</createdOn
updatedOn2014-07-24T19:00:36.477+05:30</updatedOn
...
isCriticalSystemObjectfalse</isCriticalSystemObject
description>dnsDsc</description>
name>dns</name>
displayNamedns</displayName
enableValidationfalse</enableValidation
...
values
id>2c9042944767eb5801476890f63e021d</id>
createdOn2014-07-24T19:00:36.477+05:30</createdOn
updatedOn2014-07-24T19:00:36.477+05:30</updatedOn
...
<value>192.168.100.50</value>
</values>
maxOccurs1</maxOccurs
minOccurs1</minOccurs
orderIndex0</orderIndex
confidential>false</confidential>
encrypted>false</encrypted>
consumerReadOnlyfalse</consumerReadOnly
consumerVisibletrue</consumerVisible
dynamicValueEnabledfalse</dynamicValueEnabled
measurable>false</measurable>
editable>true</editable>
</property>
</options>
options
id>2c9042944767eb5801476890f6580220</id>
objectId2c9042944767eb5801476890f6580220</objectId
createdOn2014-07-24T16:59:54.647+05:30</createdOn
updatedOn2014-07-24T19:00:36.617+05:30</updatedOn
...
isCriticalSystemObjectfalse</isCriticalSystemObject
description>dhcpDsc</description>
name>44C0D910-FE01-A370-7495-6814E873B53E</name>
displayNamedhcp</displayName
consumerReadOnlyfalse</consumerReadOnly
consumerVisibletrue</consumerVisible
isSelectedfalse</isSelected
orderIndex1</orderIndex
...
</options>
maxOccurs1</maxOccurs
minOccurs1</minOccurs
orderIndex0</orderIndex
isInitialOrdertrue</isInitialOrder
consumerReadOnlyfalse</consumerReadOnly
consumerVisibletrue</consumerVisible
</childOptionSets
childOptionSets
id>2c9042944767eb5801476890f6800223</id>
objectId2c9042944767eb5801476890f6800223</objectId
createdOn2014-07-24T18:56:19.627+05:30</createdOn
updatedOn2014-07-24T19:00:36.617+05:30</updatedOn
...
isCriticalSystemObjectfalse</isCriticalSystemObject
description>nameSetDsc</description>
iconUrl>/csa/images/library/default.png</iconUrl
name>203CB9C7-5CEA-3D49-F56C-688A8F5AD9BB</name>
displayNamenameSet</displayName
options
id>2c9042944767eb5801476890f6810224</id>
objectId2c9042944767eb5801476890f6810224</objectId
createdOn2014-07-24T18:56:19.627+05:30</createdOn
updatedOn2014-07-24T19:00:36.617+05:30</updatedOn
...
isCriticalSystemObjectfalse</isCriticalSystemObject
description>Option Description</description>
name>B0A6F7FE-6CEF-D6C9-EAB9-688A8F5AF1FA</name>
displayNameOption Displayname</displayName
consumerReadOnlyfalse</consumerReadOnly
consumerVisibletrue</consumerVisible
isSelectedfalse</isSelected
orderIndex0</orderIndex
...
property
id>2c9042944767eb5801476890f6970227</id>
objectId2c9042944767eb5801476890f6970227</objectId
createdOn2014-07-24T18:56:19.627+05:30</createdOn
updatedOn2014-07-24T19:00:36.567+05:30</updatedOn
...
isCriticalSystemObjectfalse</isCriticalSystemObject
description>nameDsc</description>
name>name</name>
displayNamename</displayName
enableValidationfalse</enableValidation
...
values
id>2c9042944767eb5801476890f6970228</id>
createdOn2014-07-24T19:00:36.567+05:30</createdOn
updatedOn2014-07-24T19:00:36.567+05:30</updatedOn
...
<value>pr.csa.com</value>
</values>
maxOccurs1</maxOccurs
minOccurs1</minOccurs
orderIndex0</orderIndex
confidential>false</confidential>
encrypted>false</encrypted>
consumerReadOnlyfalse</consumerReadOnly
consumerVisibletrue</consumerVisible
dynamicValueEnabledfalse</dynamicValueEnabled
measurable>false</measurable>
editable>true</editable>
</property>
</options>
options
id>2c9042944767eb5801476890f6b20229</id>
objectId2c9042944767eb5801476890f6b20229</objectId
createdOn2014-07-24T18:56:19.627+05:30</createdOn
updatedOn2014-07-24T19:00:36.617+05:30</updatedOn
...
isCriticalSystemObjectfalse</isCriticalSystemObject
description>Option Description</description>
name>2F3C3730-E927-66CD-C0E4-688C483F62FD</name>
displayNameOption Displayname</displayName
consumerReadOnlyfalse</consumerReadOnly
consumerVisibletrue</consumerVisible
isSelectedtrue</isSelected
orderIndex1</orderIndex
...
property
id>2c9042944767eb5801476890f6b4022c</id>
objectId2c9042944767eb5801476890f6b4022c</objectId
createdOn2014-07-24T18:56:19.627+05:30</createdOn
updatedOn2014-07-24T19:00:36.597+05:30</updatedOn
...
isCriticalSystemObjectfalse</isCriticalSystemObject
description>domainDsc</description>
name>domain</name>
displayNamedomain</displayName
enableValidationfalse</enableValidation
...
values
id>2c9042944767eb5801476890f6b5022d</id>
createdOn2014-07-24T19:00:36.597+05:30</createdOn
updatedOn2014-07-24T19:00:36.597+05:30</updatedOn
...
value>csa.com</value>
</values>
maxOccurs1</maxOccurs
minOccurs1</minOccurs
orderIndex0</orderIndex
confidential>false</confidential>
encrypted>false</encrypted>
consumerReadOnlyfalse</consumerReadOnly
consumerVisibletrue</consumerVisible
dynamicValueEnabledfalse</dynamicValueEnabled
measurable>false</measurable>
editable>true</editable>
</property>
</options>
maxOccurs2147483647</maxOccurs
minOccurs0</minOccurs
orderIndex1</orderIndex
isInitialOrdertrue</isInitialOrder
consumerReadOnlyfalse</consumerReadOnly
consumerVisibletrue</consumerVisible
</childOptionSets
</options>
options
id>2c9042944767eb5801476890f6bc022e</id>
objectId2c9042944767eb5801476890f6bc022e</objectId
createdOn2014-07-24T16:59:54.640+05:30</createdOn
updatedOn2014-07-24T19:00:36.617+05:30</updatedOn
...
isCriticalSystemObjectfalse</isCriticalSystemObject
description>linuxDsc</description>
name>C1790E4D-2BED-4AE7-6282-680B6975AEAF</name>
displayNamelinux</displayName
consumerReadOnlyfalse</consumerReadOnly
consumerVisibletrue</consumerVisible
isSelectedfalse</isSelected
orderIndex1</orderIndex
...
property
id>2c9042944767eb5801476890f6be0231</id>
objectId2c9042944767eb5801476890f6be0231</objectId
createdOn2014-07-24T16:59:54.640+05:30</createdOn
updatedOn2014-07-24T19:00:36.607+05:30</updatedOn
...
isCriticalSystemObjectfalse</isCriticalSystemObject
description>gwDsc</description>
name>gw</name>
displayNamegw</displayName
enableValidationfalse</enableValidation
...
values
id>2c9042944767eb5801476890f6be0232</id>
createdOn2014-07-24T19:00:36.607+05:30</createdOn
updatedOn2014-07-24T19:00:36.607+05:30</updatedOn
...
<value>192.168.100.1</value>
</values>
maxOccurs1</maxOccurs
minOccurs1</minOccurs
orderIndex0</orderIndex
confidential>false</confidential>
encrypted>false</encrypted>
consumerReadOnlyfalse</consumerReadOnly
consumerVisibletrue</consumerVisible
dynamicValueEnabledfalse</dynamicValueEnabled
measurable>false</measurable>
editable>true</editable>
</property>
</options>
maxOccurs1</maxOccurs
minOccurs1</minOccurs
orderIndex1</orderIndex
isInitialOrdertrue</isInitialOrder
consumerReadOnlyfalse</consumerReadOnly
consumerVisibletrue</consumerVisible
</optionSets
artifactContainsDelegatedTopologies>false</artifactContainsDelegatedTopologies>
</optionModel
The final service request payload will be as shown:
ServiceRequest<description>A new Subscription </description>
<name>Subscription Request 1 </name>
displayName Subscription Request 1 </displayName
artifactContext
<id>2c9042944767eb5801476890f5c80207</id> <!—Service offering UUID -->
</artifactContext
requestedAction
<name>ORDER</name>
<property>
<name>START_DATE</name>
<values>
<value>2014-07-25T16:50:14.000Z</value>
</values>
</property>
<property>
<name>END_DATE</name>
<values>
<value>2014-07-26T16:50:14.000Z</value>
</values>
</property>
<property>
<name>SERVICE_NAME</name>
<values>
<value>Subscription 1</value>
</values>
</property>
<property>
<name>SERVICE_DESCRIPTION</name>
<values>
<value>A new Subscription 1</value>
</values>
</property>
<property>
<name>OPTION_MODEL</name>
<values>
optionModel
<name>OptionSet1</name>
optionSets
<name>BDB5DEBD-D9A5-2865-BA65-67F29A24C622</name>
<options>
<name>199B87A6-7E77-B2CC-F666-67F29A232BE0</name>
isSelected>true</isSelected
<property>
<name>optionSet1OptionOne</name>
<values<value>Hi</value</values>
</property>
</options>
</optionSets
optionSets
<name>51560C05-A78E-28BA-8DC3-680B1770B179</name>
<options>
<name>DB88AF24-DEE9-8E3F-AB3E-680B17700608</name>
isSelected>true</isSelected
childOptionSets
<name>6B9259E9-0763-FFB9-31DB-681442A8A997</name>
<options>
<name>44C0D910-FE01-A370-7495-6814E873B53E</name>
isSelected>false</isSelected
</options>
<options>
<name>C24500A9-FF86-D453-65A8-681442A85838</name>
isSelected>true</isSelected
<property>
<name>dns</name>
<values<value>192.168.100.50</value</values>
</property>
<property>
<name>ip</name>
<values<value>192.168.100.10</value</values>
</property>
</options>
</childOptionSets
childOptionSets
<name>203CB9C7-5CEA-3D49-F56C-688A8F5AD9BB</name>
<options>
<name>B0A6F7FE-6CEF-D6C9-EAB9-688A8F5AF1FA</name>
isSelected>true</isSelected
<property>
<name>name</name>
<values<value>pr.csa.com</value</values>
</property>
</options>
<options>
<name>2F3C3730-E927-66CD-C0E4-688C483F62FD</name>
isSelected>false</isSelected
</options>
</childOptionSets
</options>
<options>
<name>C1790E4D-2BED-4AE7-6282-680B6975AEAF</name>
isSelected>false</isSelected
</options>
</optionSets
</optionModel
</values>
</property>
</requestedAction
</ServiceRequest
To summarize
- For <optionModel> , specifiy the name ( /optionModel/name )
- For <optionSets> and <childOptionSets> , specify
- name (/optionModel/optionSets/name) and
- options (/optionModel/optionSets/Options)
- For Options, specify
- the name ( /option/name) ,
- isSelected (/option/isSelected) and
- Properties ( /option/property )
The option that is unselected should be specified with isSelected=false.
- For property, specify
- the name (/property/name) and
- values ( /property/values )
- For Values, specify the
- value ( /property/values/value )
1