The only warranties for HP products andservices are set forth in the express warr anty statements accompanyingsuch products andservices. Nothingherein should be
construedas constitutingan additional warranty. HP shall not be l iable for technical or editorial errors or omissi ons contained herein.
The information contained herein is subject to change without notice.
Restricted Rights Legend
Confidential computer software. Valid l icensefrom HP r equired for possession, use or copying. Consistent wi th FAR 12.211and 12.212, Commercial Computer
Software, Computer Software Documentation, and Technical Data for C ommercial Items are licensedto the U.S. Government under vendor's standard commercial
license.
The title pageof this document contains the following identifying information:
l Software Version number, which indicates the software version.
l Document Release Date, which changes each time the document is updated.
l Software Release Date, which indicates the release date of this version of the software.
To check for recent updates or toverify that you are using the most r ecent edition of a document, go to: http: //h20230.www2.hp.com/selfsolve/manuals
This si te requires thatyouregister for an H P Passport and sign in. To register for an HP Passport ID, go to: htt p://h20229.www2.hp.com/passport-registration.html
Or click the New users- please register l ink on the HP Passport l ogin page.
Youw ill also receive updated or new editions if yousubscribe to the appropriate product support service. Contact your HP sales r epresentative for details.
Support
Visit the HP Software Support Online web si te at: htt p://www.hp.com/go/hpsoftwaresupport
This w eb site provides contact information and details about the products, services, and support that HP Software offers.
HP Software onlinesupport provides customer self-solve capabilities. It provides a fast andefficient way to access interactive technical support tools needed to m anage
your business. As avalued support customer, you can benefit by using the support web site to:
l Search for knowledge documents of i nterest
l Submit andtrack support cases and enhancement requests
l Download software patches
l Manage support contracts
l Look up HP support contacts
l Review information about available services
l Enter i ntodiscussions with other software customers
l Research and register for software tr aining
Most of the support areas r equire that you register as an HP Passport user and sign in. Many also r equire a support contract. To register for anHP Passport ID, goto:
To find m ore informationabout access levels, go to:
http://h20230.www2.hp.com/new_access_levels.jsp
HP Sof tware Solutions Now accesses the HPSW Solution andIntegrationPortal W eb site. This site enables you to explore H P Product Solutions to meet your
business needs, includes a full list of Integrations between HP Products, as well as a listing of ITIL Processes. The URL for this W eb site is
http://h20230.www2.hp.com/sc/solutions/index.jsp
HP Cloud Service Automation (4.10)Page 2 of 150
Contents
Contents3
HP CSA 4.x API Reference Introduction8
Chapter 1: Artifact API9
URIs9
Artifact9
Group9
ResourceProvider10
Service Offering10
Artifact types10
Create an artifact11
View an artifact12
Update an artifact14
Delete an artifact17
Retrieve a predefined view for an artifact17
Retrieve resolved properties for an artifact19
List active groups associated with an organization22
Add groups to an organization23
Update group display name, distinguished name25
Delete or disassociate group from an organization26
List resource providers27
Add document to service offering28
Delete document from service offering30
Update document in service offering31
Publish service offerings to catalog31
Unpublish service offerings from catalog33
Retrieve artifact state and status35
Artifact views36
Chapter 2: Availablevalues API42
Chapter 3: Catalog API44
HP Cloud Service Automation (4.10)Page 3 of 150
APIReference
Contents
URIs44
Catalog44
Category44
Offering44
Request45
Approval45
Approval policy46
Subscription46
Resource Subscription46
Instance46
List catalogs47
Get catalog details49
Create catalog categories50
Update catalog categories52
Delete catalog category53
List offerings in the catalog54
Get offering details55
List requests in the catalog56
Deprecation Notice56
Submit a request58
Get request details60
Cancel a request63
Retire a request63
List approvals in the catalog64
Deprecation Notice64
Get approval details65
Update approval decision using an external approval system65
Update approval decision using CSA approval process66
Update catalog approval policies68
Update service offerings approval policy69
List subscriptions in the catalog71
HP Cloud Service Automation (4.10)Page 4 of 150
APIReference
Contents
Chapter 4: Export API77
Chapter 5: Import API79
Chapter 6: Importzip API82
Deprecation Notice71
Get subscription details72
List instances in the catalog74
Deprecation Notice74
Get instance details75
Retire an approval75
Get resource subscription details76
Deprecation Notice82
Chapter 7: Import_result API85
Chapter 8: Lifecycle engine API87
Get details for a lifecycle execution record87
Get latest lifecycle execution record for a service instance89
Schedule lifecycle transition for service instance89
Chapter 9: Login API91
URIs91
Get userIdentifier91
Get userIdentifier for user name with slash92
Chapter 10: Notification API94
URIs94
View list of notification objects94
Send notification96
Chapter 11: Organization API99
URIs99
View a list of organizations100
View an organization102
List organization's approval policies105
Create approval policy107
Update approval policy110
HP Cloud Service Automation (4.10)Page 5 of 150
APIReference
Contents
Chapter 12: orgInformation API117
Chapter 13: Processinstances API118
Delete approval policy112
Retrieve organization LDAP access point information113
List most requested, recently requested, or new offerings114
URIs118
Process Instance structure118
Retrieve a process instance119
Create a process instance121
Update a process instance122
Execute a process instance125
Chapter 14: Search API126
Chapter 15: User API127
URIs127
Request127
Approval127
Subscription128
Instance129
List service requests for subscription129
List active requests for user130
Get count of requests for user132
Cancel multiple service requests133
Delete multiple service requests134
List approvals for approver136
Get count of approvals for user137
Delete multiple approval requests137
List subscriptions for user138
Get count of subscriptions for user140
Get list of recent or expiring soon subscriptions for user141
Delete multiple subscriptions141
List instances for user143
HP Cloud Service Automation (4.10)Page 6 of 150
APIReference
Contents
Chapter 16: Utilization API145
Chapter 17: Values for the detail parameter147
Chapter 18: Values for the scope parameter148
We appreciate your feedback!149
HP Cloud Service Automation (4.10)Page 7 of 150
HP CSA 4.x API Reference Introduction
The APIs for HP Cloud Service Automation (CSA) use a REST interface. See
http://en.wikipedia.org/wiki/Representational_state_transfer for general REST information. This
documentation assumes that you know how to use REST interfaces.
See the HPCloud Service Automation API Quick Start for information on communication with CSA
using RESTful calls.
Caution: This document includes information only on the RESTAPIs introduced in CSA 3.x,
and that are still available in CSA 4.x. Information on RESTAPIs introduced in CSA 4.x can be
found in the HP Cloud Service Automation API Quick Start.
The base URL for a CSA REST API is https://<host:port>/csa/rest, which is appended with the
specific URI for the API call. For example, to access the <example> API, you would use the URL:
https://<host:port>/csa/rest/<example>.
Because XML content passed into or returned by CSA REST API calls can be lengthy, example
XML content presented in this document will often be abbreviated to include just the more pertinent
XML content.
Note: Special or localized characters used in the URL of REST API calls must be encoded
before they are sent to the server.
Tip: You should only include one value for a Boolean property and the value must be either true
or false.
HP Cloud Service Automation (4.10)Page 8 of 150
Chapter 1: Artifact API
Description
Use this API to view, create, and modify CSA artifacts.
Base URL
https://<host>:<port>/csa/rest
URIs
The following URIs are appended to the base URL:
Artifact
URIMethodParametersDescription
/artifactPOSTuserIdentifier"Create an artifact" on page 11
/artifact/<artifact_id>GETuserIdentifier,
scope, detail, view
/artifact/<artifact_id>PUTuserIdentifier,
scope, view
/artifact/<artifact_id>DELETE userIdentifier"Delete an artifact" on page 17
/artifact/fastview/<artifact_
id>
/artifact/<artifact_
id>/resolveProperties
GETuserIdentifier,view"Retrieve a predefined view for
GETuserIdentifier,
propertyName
"View an artifact" on page 12
"Update an artifact" on page 14
an artifact" on page 17
"Retrieve resolved properties for
an artifact" on page 19
Group
URIMethodParametersDescription
/artifact/<organization_
id>/group
/artifact/<organization_
id>/group
GETuserIdentifier "List active groups associated with
an organization" on page 22
POSTuserIdentifier "Add groups to an organization" on
page 23
HP Cloud Service Automation (4.10)Page 9 of 150
APIReference
URIMethodParametersDescription
/artifact/<organization_
id>/group/<grou_id>
/artifact/<organization_
id>/group/<group_id>
PUTuserIdentifier "Update group display name,
distinguished name" on page 25
DELETE userIdentifier "Delete or disassociate group from an
organization" on page 26
ResourceProvider
URIMethodParametersDescription
/artifactGETuserIdentifier, artifactType"List resource providers" on page 27
/artifact/<catalog_id>/publishPOSTuserIdentifier "Publish service offerings to
/artifact/<catalog_id>/unpublishPOSTuserIdentifier "Unpublish service offerings
Note: You can view information about an artifact with GET /artifact/<artifact_id> or GET
/artifact/fastview/<artifact_id>. The fastview API can traverse associations, while the
standard artifact API only returns information for the artifact.
POSTuserIdentifier "Update document in service
offering" on page 31
catalog" on page 31
from catalog" on page 33
Artifact types
You can work with the following artifact types using the /artifact API. You can use them with the
methods marked in the table.
Artifact typeGETPOSTPUTDELETE
Approval processX
HP Cloud Service Automation (4.10)Page 10 of 150
APIReference
Artifact typeGETPOSTPUTDELETE
Approval templateX
ApproverX
CatalogXXXX
DocumentXXX
GroupX
Named approver approval templateX
OrganizationXXXX
PersonX
Resource bindingXX
Resource environmentX
Resource offeringXXX
Resource poolXXXX
Resource providerXXXX
Resource subscriptionXX
Service componentXXXX
Service blueprintXXXX
Service instanceXX
Service offeringXXXX
Service requestX
SubscriptionX
Create an artifact
Details
URI
MethodPOST
HP Cloud Service Automation (4.10)Page 11 of 150
/artifact
APIReference
URI
Parameters
Returns200 - Ok
/artifact
userIdentifier=<user_id>
Required; the user ID you want to use as credentials for this API call. See "Get
userIdentifier" on page 91 for the steps required to get the userIdentifier value.
401 - Not authorized
404 - Not found
500 - Server exception
View an artifact
Details
URI
MethodGET
Parameters
/artifact/<artifact_id>
userIdentifier=<user_id>
Required; the user ID you want to use as credentials for this API call. See "Get
userIdentifier" on page 91 for the steps required to get the userIdentifier value.
scope=[base|baseplusone|subtree|view]
Optional; default is base. If value is base, then the object is returned. If value is
baseplusone, then the object and its first level children are returned. If value is
subtree, then the object and all of its descendants are returned. If the value is vie,
then the view parameter is required.
detail=[required|basic|standard|template|full]
Optional; default is full. See "Values for the detail parameter" on page 147
Note: Some API calls do not support all possible values for this parameter.
detail=FULL, even as the default value, is not accepted for organization
artifacts because the volume of content returned can be excessively large.
Specify detail=BASIC to avoid an exception message.
view=<view_type>
Required when value for scope is view; if this parameter is defined, then the
value for scope is processed as if its value was view. The default is basicinfo. See
"Artifact views" on page 36 for a list of view types.
Required; the user ID you want to use as credentials for this API call. See "Get
userIdentifier" on page 91 for the steps required to get the userIdentifier value.
view=<view_type>&scope=view
Optional; Used to update artifacts based on pre-defined views. See "Artifact
views" on page 36 (description column) for a list of view types that support update
operation.
<_artifact_property>_action_=merge
Optional; use themerge option with the action meta tag query parameter to
update only a portion of the artifact. The action meta tag can either be specified
globally for the artifact by including parameter _action_=merge, or fora
specificpropertye.g., _property_values_action_=merge.
Returns200 - Ok
401 - Not authorized
404 - Not found
500 - Server exception
Note: To completely update the artifact, i.e., replace the persistent artifact, do notuse the view
or merge parameters andinclude all artifact content in the request body. Note that if only a
portion of the artifiact contentis sent in the request body, any unspecified content will be
removed from the artifact.
To update a portion of the artifact:
l Use a pre-defined view that contains a subset of the artifact properties; only that subset of
properties will be updated per the values specified in the request body.See"Artifact views"
on page 36for a list of view types.
l Use the merge option as described under Parameters.
Note: You can use the merge option with the view parameter to update only the view
properties for which you specify values in the request body.
Note: Collection specific behavior
When a merge option is specified on a collection, for example _property_values_action_
=merge, all collection items specified in the PUT request body are updated. Any other
collection items are left untouched.
For the property attribute of an artifact, the items of this collection attribute are matched by
name. For all other attributes, the collection items are matched by id.
Examples
The following examples demonstrate how to update an artifact.
HP Cloud Service Automation (4.10)Page 15 of 150
APIReference
This example shows how to change the finalize flag of a component using the view parameter.
The following URL was sent:
This example shows changing the display name of a resource provider. This example does not use
the view parameters. To use this approach, retrieve the artifact using GET artifact API, modify the
necessary value (in this example - displayName), and use that as the body of the PUT request to
update the artifact.
The following URL was sent:
Deletion is subject to a set of business rules which depend on the type of artifact. The business
rules for artifacts are explained in the table below. Note that consumption artifacts are not removed
from the database when they are deleted; instead, the artifact is marked as retired. Please refer to
the"Catalog API" on page 44 for retiring consumption artifacts.
Artifact typeDetails
Resource
provider
Service designCan be deleted when all associated service offerings or service instances are
/artifact/<artifact_id>
userIdentifier=<user_id>
Required; the user ID you want to use as credentials for this API call. See "Get
userIdentifier" on page 91 for the steps required to get the userIdentifier value.
401 - Not authorized
500 - Server exception
Can only be deleted if no active service subscriptions use the resource
provider.
retired.
Retrieve a predefined view for an artifact
Because the REST API presented here returns content ina different format when retrieving a single
result versus multiple results, and could thereby complicate your using the results, it is
recommended that the "View an artifact" on page 12API be used. Performance intensive
applications might stillchoose to use the following API.
HP Cloud Service Automation (4.10)Page 17 of 150
APIReference
Details
URI
MethodGET
Parameters
Returns200 - Ok
/artifact/fastview/<artifact_id>
userIdentifier=<user_id>
Required; the user ID you want to use as credentials for this API call. See "Get
userIdentifier" on page 91 for the steps required to get the userIdentifier value.
view=<view_type>
Required; see "Artifact views" on page 36 for a list of view types.
404 - Not found
500 - Server exception
Examples
The following URL was sent. Note that artifact_id is theID of any artifact that has an accesspoint.
You can filter the results by providing a value for a property in the URI. The query is then filtered
based on that property. You can use the properties listed in "Artifact views" on page 36.
Note: The property name that is specified in the URL must have the period (.) character
replaced with the underscore (_) character.
The following example shows the result when the previous example is filtered on a property name.
A propertycan have a source binding configuredthat indicates its value is to be retrieved from a
property on another artifact. The REST API discussed here provides a mechanism toretrieve the
value from the source property. As part of this retrieval, relevant tokens configured on properties are
also resolved.
HP Cloud Service Automation (4.10)Page 19 of 150
APIReference
There are two approaches to retrieving resolved properties:
l Retrieve all properties
l Retrieve a single named property
Details
URI
MethodGET
Parameters
Returns200 - Ok
/artifact/<artifact_id>/resolveProperties
userIdentifier=<user_id>
Required; the user ID you want to use as credentials for this API call. See "Get
userIdentifier" on page 91 for the steps required to get the userIdentifier value.
propertyName=<property_name>
Optional; the name of the property you want to retrieve. Only retrieves the value
for the property specified.
401 - Not authorized
404 - Not found
500 - Server exception
Examples
The following URL was used to retrieve all properties for an artifact:
Use this URI to delete a group or to disassociate it from an organization. If no organization is
associated with this group, the group will be deleted. Otherwise, the group will be disassociated
from the specified organization.
Details
URI
MethodDELETE
Parameters
Returns200 - Ok
/artifact/<organization_id>/group/<group_id>
userIdentifier=<user_id>
Required; the user ID you want to use as credentials for this API call. See "Get
userIdentifier" on page 91 for the steps required to get the userIdentifier value.
401 - Not authorized
404 - Object not found
500 - Server exception
To better demonstrate how to use this REST API URI, the following a python script attaches a text
file to a service offering. The script was created based on HTML documentation. You can find
information on html form content types at: http://www.w3.org/TR/html401/interact/forms.html#h-
17.13.4.2.
""" Sample python script that attaches a text file in the current directory to
an ACTIVE CSA service offering on a local host, with default credentials.
Script usage:
The following example attaches file doc.txt to the service offering with id 90ce
c0773c83a11a013c871e4c1a0503 using an admin user ID
90d96588360da0c701360da0f1d5f483
post-doc.py 90cec0773c83a11a013c871e4c1a0503 doc.txt 90d96588360da0c701360da0f1d
5f483
Tested with: ActivePython 3.2.2.3
"""
from xml.dom.minidom import parse, parseString
from http.client import HTTPSConnection
from base64 import b64encode
import mimetypes
HP Cloud Service Automation (4.10)Page 28 of 150
APIReference
import sys
def get_content_type(filename):
return mimetypes.guess_type(filename)[0] or 'application/octet-stream'
def get_file_contents(filename):
CRLF = '\r\n'
f = open(filename, 'r')
return CRLF.join(f.readlines())
Required; the user ID you want to use as credentials for this API call. See "Get
userIdentifier" on page 91 for the steps required to get the userIdentifier value.
401 - Not authorized
404 - Object not found
500 - Server exception
Example
The following URL was sent:
https://<host>:<port>/csa/rest/artifact/90cef5de3c63429f013c68b8cdda0bad/documen
t/90cef5de3c63429f013c68b8cdda0bad?userIdentifier=90cef5de3c63429f013c642c7fc708
ab