HP CloudSystem Enterprise Started Guide

HPCloud Service Automation
For the Windows ® and Linux operating systems
Software Version: 4.10
APIReference
Document Release Date: July 2014
Software Release Date: July 2014
Legal Notices
Warranty
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.
Copyright Notice
© Copyright 2010-2014 Hewlett-Packard Development Company, L.P.
Trademark Notices
Adobe™ is a trademark of Adobe Systems Incorporated.
Microsoft® and Windows® are U.S. registered trademarks of Microsoft Corporation.
Oracle and Java are registeredtrademarks of Oracle and/or its affiliates.
RED HAT READY™ Logoand RED HAT CERTIFIED PARTNER™ Logo are trademarks of R ed Hat, Inc.
This product includes an interfaceof the 'zlib' general purpose compressionl ibrary, w hich is Copyright © 1995-2002Jean-loup Gailly and Mark Adler.
Documentation Updates
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:
http://h20229.www2.hp.com/passport-registration.html
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

Contents 3
HP CSA 4.x API Reference Introduction 8
Chapter 1: Artifact API 9
URIs 9
Artifact 9
Group 9
ResourceProvider 10
Service Offering 10
Artifact types 10
Create an artifact 11
View an artifact 12
Update an artifact 14
Delete an artifact 17
Retrieve a predefined view for an artifact 17
Retrieve resolved properties for an artifact 19
List active groups associated with an organization 22
Add groups to an organization 23
Update group display name, distinguished name 25
Delete or disassociate group from an organization 26
List resource providers 27
Add document to service offering 28
Delete document from service offering 30
Update document in service offering 31
Publish service offerings to catalog 31
Unpublish service offerings from catalog 33
Retrieve artifact state and status 35
Artifact views 36
Chapter 2: Availablevalues API 42
Chapter 3: Catalog API 44
HP Cloud Service Automation (4.10) Page 3 of 150
APIReference Contents
URIs 44
Catalog 44
Category 44
Offering 44
Request 45
Approval 45
Approval policy 46
Subscription 46
Resource Subscription 46
Instance 46
List catalogs 47
Get catalog details 49
Create catalog categories 50
Update catalog categories 52
Delete catalog category 53
List offerings in the catalog 54
Get offering details 55
List requests in the catalog 56
Deprecation Notice 56
Submit a request 58
Get request details 60
Cancel a request 63
Retire a request 63
List approvals in the catalog 64
Deprecation Notice 64
Get approval details 65
Update approval decision using an external approval system 65
Update approval decision using CSA approval process 66
Update catalog approval policies 68
Update service offerings approval policy 69
List subscriptions in the catalog 71
HP Cloud Service Automation (4.10) Page 4 of 150
APIReference Contents
Chapter 4: Export API 77
Chapter 5: Import API 79
Chapter 6: Importzip API 82
Deprecation Notice 71
Get subscription details 72
List instances in the catalog 74
Deprecation Notice 74
Get instance details 75
Retire an approval 75
Get resource subscription details 76
Deprecation Notice 82
Chapter 7: Import_result API 85
Chapter 8: Lifecycle engine API 87
Get details for a lifecycle execution record 87
Get latest lifecycle execution record for a service instance 89
Schedule lifecycle transition for service instance 89
Chapter 9: Login API 91
URIs 91
Get userIdentifier 91
Get userIdentifier for user name with slash 92
Chapter 10: Notification API 94
URIs 94
View list of notification objects 94
Send notification 96
Chapter 11: Organization API 99
URIs 99
View a list of organizations 100
View an organization 102
List organization's approval policies 105
Create approval policy 107
Update approval policy 110
HP Cloud Service Automation (4.10) Page 5 of 150
APIReference Contents
Chapter 12: orgInformation API 117
Chapter 13: Processinstances API 118
Delete approval policy 112
Retrieve organization LDAP access point information 113
List most requested, recently requested, or new offerings 114
URIs 118
Process Instance structure 118
Retrieve a process instance 119
Create a process instance 121
Update a process instance 122
Execute a process instance 125
Chapter 14: Search API 126
Chapter 15: User API 127
URIs 127
Request 127
Approval 127
Subscription 128
Instance 129
List service requests for subscription 129
List active requests for user 130
Get count of requests for user 132
Cancel multiple service requests 133
Delete multiple service requests 134
List approvals for approver 136
Get count of approvals for user 137
Delete multiple approval requests 137
List subscriptions for user 138
Get count of subscriptions for user 140
Get list of recent or expiring soon subscriptions for user 141
Delete multiple subscriptions 141
List instances for user 143
HP Cloud Service Automation (4.10) Page 6 of 150
APIReference Contents
Chapter 16: Utilization API 145
Chapter 17: Values for the detail parameter 147
Chapter 18: Values for the scope parameter 148
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 HPCloud Service Automation API Quick Start for information on communication with CSA using RESTful calls.
Caution: This document includes information only on the RESTAPIs introduced in CSA 3.x, and that are still available in CSA 4.x. Information on RESTAPIs 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
URI Method Parameters Description
/artifact POST userIdentifier "Create an artifact" on page 11
/artifact/<artifact_id> GET userIdentifier,
scope, detail, view
/artifact/<artifact_id> PUT userIdentifier,
scope, view
/artifact/<artifact_id> DELETE userIdentifier "Delete an artifact" on page 17
/artifact/fastview/<artifact_ id>
/artifact/<artifact_ id>/resolveProperties
GET userIdentifier,view "Retrieve a predefined view for
GET userIdentifier,
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
URI Method Parameters Description
/artifact/<organization_ id>/group
/artifact/<organization_ id>/group
GET userIdentifier "List active groups associated with
an organization" on page 22
POST userIdentifier "Add groups to an organization" on
page 23
HP Cloud Service Automation (4.10) Page 9 of 150
APIReference
URI Method Parameters Description
/artifact/<organization_ id>/group/<grou_id>
/artifact/<organization_ id>/group/<group_id>
PUT userIdentifier "Update group display name,
distinguished name" on page 25
DELETE userIdentifier "Delete or disassociate group from an
organization" on page 26
ResourceProvider
URI Method Parameters Description
/artifact GET userIdentifier, artifactType "List resource providers" on page 27
Service Offering
URI Method Parameters Description
/artifact/<service_offering_ id>/document
/artifact/<service_offering_ id>/document
POST userIdentifier "Add document to service
offering" on page 28
DELETE userIdentifier "Delete document from
service offering" on page 30
/artifact/<service_offering_ id>/document/<document_id>
/artifact/<catalog_id>/publish POST userIdentifier "Publish service offerings to
/artifact/<catalog_id>/unpublish POST userIdentifier "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.
POST userIdentifier "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 type GET POST PUT DELETE
Approval process X
HP Cloud Service Automation (4.10) Page 10 of 150
APIReference
Artifact type GET POST PUT DELETE
Approval template X
Approver X
Catalog X X X X
Document X X X
Group X
Named approver approval template X
Organization X X X X
Person X
Resource binding X X
Resource environment X
Resource offering X X X
Resource pool X X X X
Resource provider X X X X
Resource subscription X X
Service component X X X X
Service blueprint X X X X
Service instance X X
Service offering X X X X
Service request X
Subscription X

Create an artifact

Details
URI
Method POST
HP Cloud Service Automation (4.10) Page 11 of 150
/artifact
APIReference
URI
Parameters
Returns 200 - 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
Method GET
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.
Returns 200 - Ok
401 - Not authorized 500 - Server exception
HP Cloud Service Automation (4.10) Page 12 of 150
APIReference
Examples
Use the following URL:
https://<host>:<port>/csa/rest/artifact/90e72e4f3b00a69e013b0bf7ed55002e?userIde ntifier=<user_id>
The following XML was returned in the response:
<ResourceEnvironment>
<id>90e72e4f3b00a69e013b0bf7ed55002e</id> <objectId>90e72e4f3b00a69e013b0bf7ed55002e</objectId> <createdOn>2012-11-16T17:24:55.765-08:00</createdOn> <updatedOn>2012-11-16T17:24:55.765-08:00</updatedOn> <createdBy>
<id>90d96588360da0c701360da0f1d5f483</id> <objectId>90d96588360da0c701360da0f1d5f483</objectId> <isCriticalSystemObject>true</isCriticalSystemObject> <name>admin</name> <displayName>admin</displayName>
<disabled>false</disabled> </createdBy> <updatedBy>
<id>90d96588360da0c701360da0f1d5f483</id>
<objectId>90d96588360da0c701360da0f1d5f483</objectId>
<isCriticalSystemObject>true</isCriticalSystemObject>
<name>admin</name>
<displayName>admin</displayName>
<disabled>false</disabled> </updatedBy> <isCriticalSystemObject>false</isCriticalSystemObject> <description>TestEnv</description> <name>TestEnv_November 17, 2012 1:24:55 AM UTC</name> <displayName>TestEnv</displayName> <state>
<id>90d96588360da0c701360da0ef470038</id>
<objectId>90d96588360da0c701360da0ef470038</objectId>
<createdOn>2012-11-01T15:16:54.687-07:00</createdOn>
<isCriticalSystemObject>true</isCriticalSystemObject>
<description>Active</description>
<iconUrl>/csa/images/categories/artifact_state/active.png</iconUrl>
<name>ACTIVE</name>
<displayName>Active</displayName>
<disabled>false</disabled>
<categoryType>
<id>90d96588360da0c701360da0ef420037</id> <objectId>90d96588360da0c701360da0ef420037</objectId> <isCriticalSystemObject>true</isCriticalSystemObject> <name>ARTIFACT_STATE</name>
HP Cloud Service Automation (4.10) Page 13 of 150
APIReference
<displayName>Artifact State</displayName> <extensible>false</extensible>
</categoryType> </state> <artifactType>
<id>90d96588360da0c701360da0eedb0020</id>
<objectId>90d96588360da0c701360da0eedb0020</objectId>
<createdOn>2012-11-01T15:16:57.787-07:00</createdOn>
<isCriticalSystemObject>true</isCriticalSystemObject>
<description>Resource Environment</description>
<iconUrl>
/csa/images/categories/artifact_type/resource_environment.png </iconUrl> <name>RESOURCE_ENVIRONMENT</name> <displayName>Resource Environment</displayName> <disabled>false</disabled> <categoryType> <id>90d96588360da0c701360da0eeb40017</id>
<objectId>90d96588360da0c701360da0eeb40017</objectId>
<isCriticalSystemObject>true</isCriticalSystemObject>
<name>ARTIFACT_TYPE</name>
<displayName>Artifact Type</displayName>
<extensible>false</extensible> </categoryType>
</artifactType> <disabled>false</disabled> <numberOfProvider>0</numberOfProvider> <numberOfServiceDesign>0</numberOfServiceDesign> <numberOfCatalog>0</numberOfCatalog>
</ResourceEnvironment>

Update an artifact

Details
URI /artifact/<artifact_id>
Method PUT
HP Cloud Service Automation (4.10) Page 14 of 150
APIReference
URI /artifact/<artifact_id>
Parameters
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>&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 themerge 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 fora specificpropertye.g., _property_values_action_=merge.
Returns 200 - Ok
401 - Not authorized 404 - Not found 500 - Server exception
Note: To completely update the artifact, i.e., replace the persistent artifact, do notuse the view or merge parameters andinclude all artifact content in the request body. Note that if only a portion of the artifiact contentis 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 36for 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
APIReference
This example shows how to change the finalize flag of a component using the view parameter. The following URL was sent:
https://<host>:<port>/csa/rest/artifact/90e72e4f3af5c989013afb471ebc0264?userIde ntifier=&scope=view&view=componentfinalize
The following XML was sent in the request body:
<ServiceComponent>
<id>90e72e4f3af5c989013afb471ebc0264</id> <toFinalize>false</toFinalize>
</ServiceComponent>
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:
https://<host>:<port>/csa/rest/artifact/90e72e4f3b00a69e013b0c049ab00033?userIde ntifier=<user_id>
The following XML was sent in the request body:
<ResourceProvider>
<id>90e72e4f3b00a69e013b0c049ab00033</id> <objectId>90e72e4f3b00a69e013b0c049ab00033</objectId> <createdOn>2012-11-16T17:38:46.576-08:00</createdOn> <updatedOn>2012-11-16T17:38:46.576-08:00</updatedOn> <createdBy>
<id>90d96588360da0c701360da0f1d5f483</id>
... </createdBy> <updatedBy>
<id>90d96588360da0c701360da0f1d5f483</id>
... </updatedBy> <isCriticalSystemObject>false</isCriticalSystemObject> <description>TestProvider</description> <name>TestProvider_November 17, 2012 1:38:46 AM UTC</name> <displayName>TestProviderModified</displayName> <state>
<id>90d96588360da0c701360da0ef470038</id>
... </state> <artifactType>
<id>90d96588360da0c701360da0eed8001f</id>
... </artifactType> <disabled>false</disabled> <accessPoint>
<id>90e72e4f3b00a69e013b0c049a740032</id>
HP Cloud Service Automation (4.10) Page 16 of 150
APIReference
... </accessPoint> <providerType>
<id>90d96588360da0c701360da0eeac0016</id>
... </providerType> <numberOfResourceOffering>0</numberOfResourceOffering> <numberOfEnvironment>0</numberOfEnvironment> <numberOfPools>0</numberOfPools>
</ResourceProvider>

Delete an artifact

Details
URI
Method DELETE
Parameters
Returns 200 - Ok
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 type Details
Resource provider
Service design Can 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 ina 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 12API be used. Performance intensive applications might stillchoose to use the following API.
HP Cloud Service Automation (4.10) Page 17 of 150
APIReference
Details
URI
Method GET
Parameters
Returns 200 - 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 theID of any artifact that has an accesspoint.
https://<host>:port/csa/rest/artifact/fastview/90e72e4f3abe4bf4013ac24735730010? userIdentifier=<user_id>&view=accesspoint
The following XML was returned in the response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <resultView>
<resultMap>
<entry>
<key>accessPoint.uri</key>
<value xsi:type="xs:string">http://amz:443</value> </entry> <entry>
<key>accessPoint.password</key>
<value xsi:type="xs:string">amz</value> </entry> <entry>
<key>accessPoint.username</key>
<value xsi:type="xs:string">amz</value> </entry> <entry>
<key>accessPoint.category.name</key>
<value xsi:type="xs:string">URL</value> </entry>
</resultMap>
</resultView>
HP Cloud Service Automation (4.10) Page 18 of 150
APIReference
Filtering
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.
The following URL was sent:
https://<host>:<port>/csa/rest/artifact/fastview/90e72e4f3b00a69e013b0c049ab0003 ?userIdentifier=<user_id>&view=propertyinfo&property_name=propBLN
The following XML was returned in the response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <resultView>
<resultMap>
<entry>
<key>property.values.value</key>
<value xsi:type="xs:string">true</value> </entry> <entry>
<key>property.consumerVisible</key>
<value xsi:type="xs:boolean">true</value> </entry> <entry>
<key>property.displayName</key>
<value xsi:type="xs:string">Boolean property</value> </entry> <entry>
<key>property.valueType.name</key>
<value xsi:type="xs:string">BOOLEAN</value> </entry> <entry>
<key>property.name</key>
<value xsi:type="xs:string">propBLN</value>
</entry>
</resultMap>
</resultView>

Retrieve resolved properties for an artifact

A propertycan have a source binding configuredthat indicates its value is to be retrieved from a property on another artifact. The REST API discussed here provides a mechanism toretrieve 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
APIReference
There are two approaches to retrieving resolved properties:
l Retrieve all properties l Retrieve a single named property
Details
URI
Method GET
Parameters
Returns 200 - 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:
https://<host>:<port>/csa/rest/artifact/<id>/resolveProperties?userIdentifier=<u ser_id>
The following XML was returned in the response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Properties>
<property> ... </property> <property> ... </property> <property>
<id>90d9651a3684c7f0013684cafda80005</id> <createdOn>2012-04-05T16:15:57.480-07:00</createdOn> <updatedOn>2012-04-05T16:15:57.497-07:00</updatedOn> <isCriticalSystemObject>false</isCriticalSystemObject> <name>PARENT_SVC_COMPONENT_ID</name> <artifact>
<id>90d9651a3684c7f0013684cafda80008</id> <isCriticalSystemObject>false</isCriticalSystemObject> <name>TEST_CHILD_COMPONENT</name>
<disabled>false</disabled> </artifact> <propertyBindings>
<id>90d9651a3684c7f0013684cb28820009</id>
HP Cloud Service Automation (4.10) Page 20 of 150
APIReference
</property> <property> ... </property> <property> ... </property>
</Properties>
<createdOn>2012-04-05T16:16:08.450-07:00</createdOn>
<updatedOn>2012-04-05T16:16:08.450-07:00</updatedOn>
<propertyBindingType>
<name>SOURCE</name> <categoryType>
<name>PROPERTY_BINDING_TYPE</name>
...
</categoryType>
... </propertyBindingType> <artifact>90d9651a3684c7f0013684c91f8c0004</artifact> <artifactPropertyName>SVC_COMPONENT_ID</artifactPropertyName>
</propertyBindings> <scope> ... </scope> <valueType> ... </valueType> <values>
<id>90d9651a3684c7f0013684c91f8b0002</id> <createdOn>2012-04-05T16:13:55.083-07:00</createdOn> <updatedOn>2012-04-05T16:13:55.083-07:00</updatedOn> <value>90d9651a3684c7f0013684c91f8c0004</value>
</values> <maxOccurs>0</maxOccurs> <minOccurs>0</minOccurs> <orderIndex>0</orderIndex> <confidential>false</confidential> <encrypted>false</encrypted> <consumerReadOnly>false</consumerReadOnly> <consumerVisible>false</consumerVisible>
The following URL was used to retrieve a single property:
https://<host>:<port>/csa/rest/artifact/<id>/resolveProperties? userIdentifier=<user_id>&propertyName=PARENT_SVC_COMPONENT_ID
The following XML was returned in the response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Properties>
<property>
<id>90d9651a3684c7f0013684cafda80005</id> <name>PARENT_SVC_COMPONENT_ID</name>
...
</property>
</Properties>
HP Cloud Service Automation (4.10) Page 21 of 150
APIReference

List active groups associated with an organization

Details
URI
Method GET
Parameters
Returns 200 - Ok
/artifact/<organization_id>/group
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
Example
The following URL was sent:
https://<host>:<port>/csa/rest/artifact/8a81818f3d02fb7e013d0308891d0003/group?u serIdentifier=90d96588360da0c701360da0f1d5f483
The following XML was returned:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <GroupList>
<count>1</count> <limit>1</limit> <group>
<id>8a81818f3d02fb7e013d030af854000f</id> <isCriticalSystemObject>false</isCriticalSystemObject> <name>sc_February 22, 2013 5:54:43 PM UTC</name> <displayName>ServiceConsumer1</displayName> <state>...</state> <artifactType>...</artifactType> <disabled>false</disabled> <distinguishedName>
cn=ServiceConsumer,ou=ConsumerGroup,ou=CSAGroups </distinguishedName> <role>
... </role>
</group>
</GroupList>
HP Cloud Service Automation (4.10) Page 22 of 150
APIReference

Add groups to an organization

Details
URI
/artifact/<organization_id>/group
Method POST
Parameters
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.
Returns 200 - Ok
401 - Not authorized 404 - Object not found 500 - Server exception
Note that the role mustbe specifiedfor each group in the request body.Valid rolesare as follows. For Consumer type organizations:
l SERVICE_CONSUMER
For Provider type organizations:
l CONSUMER_SERVICE_ADMINISTRATOR l SERVICE_BUSINESS_MANAGER l SERVICE_DESIGNER l CSA_ADMIN l RESOURCE_SUPPLY_MANAGER l SERVICE_OPERATIONS_MANAGER
Example
The following URL was sent:
https://<host>:<port>/csa/rest/artifact/8a81818f3d1421e7013d1423635a0003/group?u serIdentifier=90d96588360da0c701360da0f1d5f483
The following XML was sent:
<GroupList>
<group>
<displayName>My-Group-Name</displayName> <distinguishedName>
cn=TestConsumer,ou=ConsumerGroup,ou=CSAGroups </distinguishedName> <role>
<name>SERVICE_CONSUMER</name> </role>
</group>
HP Cloud Service Automation (4.10) Page 23 of 150
APIReference
<group>
<displayName>Another-Group-Name</displayName> <distinguishedName>
cn=TestConsumer2,ou=ConsumerGroup,ou=CSAGroups </distinguishedName> <role>
<name>SERVICE_CONSUMER</name> </role>
</group>
</GroupList>
The following XML was returned:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <GroupList>
<count>2</count> <limit>2</limit> <group>
<isCriticalSystemObject>false</isCriticalSystemObject> <name>My-Group-Name</name> <displayName>My-Group-Name</displayName> <disabled>false</disabled> <distinguishedName>
cn=TestConsumer,ou=ConsumerGroup,ou=CSAGroups </distinguishedName> <role>
<isCriticalSystemObject>false</isCriticalSystemObject>
<name>SERVICE_CONSUMER</name>
<disabled>false</disabled> </role>
</group> <group>
<isCriticalSystemObject>false</isCriticalSystemObject> <name>Another-Group-Name</name> <displayName>Another-Group-Name</displayName> <disabled>false</disabled> <distinguishedName>
cn=TestConsumer2,ou=ConsumerGroup,ou=CSAGroups </distinguishedName> <role>
<isCriticalSystemObject>false</isCriticalSystemObject>
<name>SERVICE_CONSUMER</name>
<disabled>false</disabled> </role>
</group>
</GroupList>
HP Cloud Service Automation (4.10) Page 24 of 150
APIReference

Update group display name, distinguished name

Use this/artifact URIto update the group display name and/or distinguised name for the specified organization.
Details
URI
Method PUT
Parameters
Returns 200 - 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
Example
The following URL was sent:
https://<host>:<port>/csa/rest/artifact/8a81818f3d02fb7e013d0308891d0003group/8a 81818f3d1437e2013d1795d41107ea?userIdentifier=90d96588360da0c701360da0f1d5f483
The following XML was sent:
<GroupList>
<group>
<displayName>My-New-Group-Name</displayName> <distinguishedName>
cn=TestConsumer,ou=ConsumerGroup,ou=CSAGroups </distinguishedName>
</group>
</GroupList>
The following XML was returned:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Group>
<id>8a81818f3d1437e2013d1795d41107ea</id> <isCriticalSystemObject>false</isCriticalSystemObject> <name>sc_February 22, 2013 5:54:43 PM UTC</name> <displayName>My-New-Group-Name</displayName> <state>
<id>90d96588360da0c701360da0ef470038</id> <isCriticalSystemObject>false</isCriticalSystemObject> <name>ACTIVE</name>
HP Cloud Service Automation (4.10) Page 25 of 150
APIReference
<disabled>false</disabled>
</state> <artifactType>
<id>90d96588360da0c701360da0eeff002b</id> <isCriticalSystemObject>false</isCriticalSystemObject> <name>GROUP</name> <disabled>false</disabled>
</artifactType> <disabled>false</disabled> <distinguishedName>
cn=TestConsumer,ou=ConsumerGroup,ou=CSAGroups
</distinguishedName>
</Group>

Delete or disassociate group from an organization

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
Method DELETE
Parameters
Returns 200 - 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
Example
The following URL was sent:
https://<host>:<port>/csa/rest/artifact/8a81818f3d1421e7013d1423635a0003/group/8 a81818f3d1437e2013d1795d41107ea?userIdentifier=90d96588360da0c701360da0f1d5f483
The following XML was returned:
<messageList>
<messages>Removed role association for My-New-Group-Name</messages>
</messageList>
HP Cloud Service Automation (4.10) Page 26 of 150
APIReference

List resource providers

Details
URI
Method GET
Parameters
Returns 200 - 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.
artifactType=RESOURCE_PROVIDER
Required; the only valid value is RESOURCE_PROVIDER. Basic view information is provided in the return content.
401 - Not authorized 500 - Server exception
Example
The following URL was sent:
https://<host>:<port>/csa/rest/artifact?userIdentifier= 90d96588360da0c701360da0f1d5f483&artifactType=RESOURCE_PROVIDER
The following XML was returned in the response:
<ResourceProviderList>
<count>3</count> <limit>0</limit> <resourceProvider>
<id>90e72e583d4c6e77013d4c96b1ab0010</id> <objectId>90e72e583d4c6e77013d4c96b1ab0010</objectId> <isCriticalSystemObject>false</isCriticalSystemObject> <description>Sitescope A</description> <name>Sitescope_A_March 9, 2013 12:39:36 AM UTC</name> <displayName>Sitescope A</displayName> <disabled>false</disabled>
</resourceProvider> ...
</ResourceProviderList>
HP Cloud Service Automation (4.10) Page 27 of 150
APIReference

Add document to service offering

Details
URI
Method POST
Parameters
Returns 200 - Ok
/artifact/<service_offering_id>/document
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
Example
The following URL was sent with headers:
l Content-type: multipart/form-data l Content-Disposition: form-data; name="file" l Content-Type: application/octet-stream
https://<host>:<port>/csa/rest/artifact/90cef5de3c63429f013c68b8cdda0bad/documen t?userIdentifier=90cef5de3c63429f013c642c7fc708ab
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:
<scrip-name.py> <service offering uuid> <filename> <admin uuid>
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
APIReference
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())
def encode_multipart_formdata(filename):
BOUNDARY = '----------CSA_r0ck$_$' CRLF = '\r\n' L = [] L.append('--' + BOUNDARY) L.append('Content-Disposition: form-data; name="file"; filename="%s"' % file
name)
L.append('Content-Type: %s' % get_content_type(filename)) L.append('') L.append(get_file_contents(filename)) L.append('--' + BOUNDARY + '--') L.append('') body = CRLF.join(L) content_type = 'multipart/form-data; boundary=%s' % BOUNDARY return content_type, body
def addDocumentToOffering(offeringId, documentName, userId):
conn = HTTPSConnection("localhost:8444") userAndPass = b64encode(b"csaTransportUser:csaTransportUser").decode("asci
i")
post_url = "/csa/rest/artifact/" + offeringId + "/document?userIdentifier="+
userId
content_type, body = encode_multipart_formdata(documentName) content_length = str(len(body)) headers = {'Authorization' : 'Basic %s' % userAndPass,
'Content-Type' :'%s' % content_type, 'content-length' : str(len(b
ody)), 'Accept' : 'application/xml'}
conn.request('POST', post_url, body, headers=headers) res = conn.getresponse() data = res.read() print(data)
def main(offeringId, documentName, userId):
addDocumentToOffering(offeringId, documentName, userId)
if __name__ == "__main__":
offeringId = sys.argv[1] documentName = sys.argv[2] userId = sys.argv[3] main(offeringId, documentName, userId)
HP Cloud Service Automation (4.10) Page 29 of 150
APIReference

Delete document from service offering

Details
URI
Method DELETE
Parameters
Returns 200 - Ok
/artifact/<service_offering_id>/document/<document_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
Example
The following URL was sent:
https://<host>:<port>/csa/rest/artifact/90cef5de3c63429f013c68b8cdda0bad/documen t/90cef5de3c63429f013c68b8cdda0bad?userIdentifier=90cef5de3c63429f013c642c7fc708 ab
The following XML was returned:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Document>
<id>90cef5de3c63429f013c68d4146a0bce</id> <isCriticalSystemObject> false </isCriticalSystemObject> <name>Example Offering Doc.txt</name> <state>
... </state> <artifactType>
... </artifactType> <disabled>false</disabled> <url>/csa//document/download?id=90cef5de3c63429f013c68d4146a0bce</url> <content>Sample Doc Content</content> <mimeType>application/octet-stream</mimeType> <documentType>
...
</documentType>
</Document>
HP Cloud Service Automation (4.10) Page 30 of 150
Loading...
+ 120 hidden pages