66
HP Helion Codar Software Version: 1.00 API Quick Start Document Release Date: December 2014 Software Release Date: December 2014

HP Helion Codar… · Chapter 2: HP Helion Codar API documentation overview You can exercise all of the HP Helion Codar RESTful API calls programmatically and from an HTTP

  • Upload
    vantu

  • View
    222

  • Download
    0

Embed Size (px)

Citation preview

HP Helion CodarSoftware Version: 1.00

API Quick Start

Document Release Date: December 2014Software Release Date: December 2014

Legal Notices

WarrantyThe only warranties for HP products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP shall not be liable for technical or editorial errors or omissions contained herein.

The information contained herein is subject to change without notice.

Restricted Rights LegendConfidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license.

Copyright Notice© Copyright 2010-2014 Hewlett-Packard Development Company, L.P.

Trademark NoticesAdobe™ is a trademark of Adobe Systems Incorporated.

Microsoft® and Windows® are U.S. registered trademarks of Microsoft Corporation.

UNIX® is a registered trademark of The Open Group.

This product includes an interface of the 'zlib' general purpose compression library, which is Copyright © 1995-2002 Jean-loup Gailly and Mark Adler.

Documentation UpdatesThe title page of 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 to verify that you are using the most recent edition of a document, go to: http://h20230.www2.hp.com/selfsolve/manuals

This site requires that you register for an HP Passport and sign in. To register for an HP Passport ID, go to: http://h20229.www2.hp.com/passport-registration.html

Or click the New users - please register link on the HP Passport login page.

You will also receive updated or new editions if you subscribe to the appropriate product support service. Contact your HP sales representative for details.

SupportVisit the HP Software Support Online web site at: http://www.hp.com/go/hpsoftwaresupport

This web site provides contact information and details about the products, services, and support that HP Software offers.

HP Software online support provides customer self-solve capabilities. It provides a fast and efficient way to access interactive technical support tools needed to manage your business. As a valued support customer, you can benefit by using the support web site to:

l Search for knowledge documents of interest l Submit and track 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 into discussions with other software customers l Research and register for software training

Most of the support areas require that you register as an HP Passport user and sign in. Many also require a support contract. To register for an HP Passport ID, go to:

http://h20229.www2.hp.com/passport-registration.html

To find more information about access levels, go to:

http://h20230.www2.hp.com/new_access_levels.jsp

HP Software Solutions Now accesses the HPSW Solution and Integration Portal Web site. This site enables you to explore HP 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 Web site is http://h20230.www2.hp.com/sc/solutions/index.jsp

API Quick Start

HP Helion Codar (1.00) Page 2 of 66

ContentsChapter 1: Introduction 5

HP Helion Codar 5HP Helion Codar APIs 5

Chapter 2: HP Helion Codar API documentation overview 6

Chapter 3: API calls 9Application design APIs 9

List application designs 10Export an application design 10Import an application design 11Import a new application design 13Associate a design to HP Helion Codar 14Dissociate a design from HP Helion Codar 14Update an application design 15Delete an application design 16

Artifact APIs 16List active groups associated with an organization 17Add groups to an organization 18Update group display name, distinguished name 20Delete or disassociate group from an organization 21

Package APIs 22List packages 22Get package details 23Get package states 24Get package properties 25List infrastructure designs 25Create a package 26Create package with properties 27Promote a package 28Reject a package 29

Examples 29Deploy a package 29Update package name and description 30Update package component properties 31Delete package 32

Lifecycle APIs 33

API Quick Start

HP Helion Codar (1.00) Page 3 of 66

List lifecycle stages 33

Chapter 4: Retrieving information from HP Helion Codar using RESTful calls 35Communication with HP Helion Codar 35Executing RESTful calls 36

Exercising API calls using an HTTP client 36Exercising API calls using the interactive content 38Making API calls from an application 40

Appendix A: API return examples 40Export an application design example 41Import an application design example 47List packages example 59List infrastructure designs example 60Get package properties example 62

Send Documentation Feedback 65

API Quick Start

HP Helion Codar (1.00) Page 4 of 66

Chapter 1: IntroductionWelcome to the HP Helion Codar API Quick Start.

HP Helion CodarHP Helion Codar provides a model driven approach to DevOps. It facilitates continuous delivery where every change to a system is releasable and every code change can be deployed in production. HP Helion Codar enables automation of continuous delivery in that every code change triggers a build, which is deployed, automated unit tests are executed, and the application can be automatically deployed to an environment based on policies. Elements of the core HP Helion Codar value proposition include the following:

l Modeling the application and infrastructure to deliver infrastructure-as-code (IaaC) for fulfillment.

l Managing applications, versions, and packages across different lifecycle stages.

l Policy management for promotion of application packages through the lifecycle stages on different environments consistently in a repeatable manner.

For more information about HP Helion Codar, see the HP Helion Codar Concepts and Use Case white paper.

HP Helion Codar APIsHP Helion Codar provides a REST (REpresentational State Transfer) Application Programming Interface (API) that allows you to interact programmatically with HP Helion Codar functionality.

This API Quick Start is designed to help you learn the API by introducing the HP Helion Codar capabilities that can be accessed programmatically,explaining how to access them, and walking through several examples. This guide assumes that you:

1. Understand how to use a RESTful API. See http://en.wikipedia.org/wiki/Representational_state_transfer for general REST information.

2. Have installed and set up HP Helion Codar following the instructions in the HP Helion Codar Configuration and Integration white paper.

HP Helion Codar (1.00) Page 5 of 66

Chapter 2: HP Helion Codar API documentation overviewYou can exercise all of the HP Helion Codar RESTful API calls programmatically and from an HTTP client. You can find more information on HTTP clients in "Retrieving information from HP Helion Codar using RESTful calls" on page 35. HP Helion Codar also includes a framework for describing, producing, consuming and exercising these RESTful services. In addition to providing reference API documentation, this content provides an interactive environment where you can exercise API calls and view responses from your server.

The following is an example of content for an API call:

You can click on any method listed to get detailed content for that call, and an interactive "Try it out!" feature. The detailed content provides developers quick and easy access the following for each API call:

l Syntax

l Method (operation)

l Parameter descriptions

l Model and schema information

l Interactive "Try it out!" dialogs that let you submit calls to your server, see the results, and then understand how you need to construct REST URLs and any payloads.

HP Helion Codar (1.00) Page 6 of 66

Clicking on the first POST method in the above example displays the following:

See "Retrieving information from HP Helion Codar using RESTful calls" on page 35 for more information on executing an API call from this interactive content.

Flow of API callsThe following flow describes the steps for using HP Helion Codar APIs:

API Quick Start

HP Helion Codar (1.00) Page 7 of 66

You can start with the Import Design API. The Import Design API creates an application design by providing the application design in JSON format as input. If the design already exists, then an error is returned.

Next, you can associate the Codar Application tag on created designs. This associates a design to the HP Helion Codar pipeline management process by tagging the application design with the Codar Application tag.

Then you can use the Create Package API for the application design. The package is only created if the HP Helion Codar license is present and the design is associated to the Codar Application tag.

Once the package is created, you can use the Deploy Package API. You can also promote or reject packages using the APIs.

API Quick Start

HP Helion Codar (1.00) Page 8 of 66

Chapter 3: API callsThe following public API calls provide access to HP Helion Codar data. These calls are documented and can be exercised through a browser at: https://<host>:<port>/csa/apidocs.jsp, substituting the host and port information appropriate for your environment. API calls can also be exercised programmatically or through an HTTP client. See "Retrieving information from HP Helion Codar using RESTful calls" on page 35 for more information on how to exercise API calls.

Application design APIs

URI Method See also

/csa/api/codar/app-design/list GET "List application designs" on the next page

/csa/api/codar/app-design/{applicationDesignId} GET "Export an application design" on the next page

/csa/api/codar/app-design/import POST "Import an application design" on page 11

/csa/api/codar/app-design/importNew POST "Import a new application design" on page 13

/csa/api/codar/app-design/{applicationDesignId}/associateToCodar POST "Associate a design to HP Helion Codar" on page 14

/csa/api/codar/app-design/{applicationDesignId} PUT "Update an application design" on page 15

HP Helion Codar (1.00) Page 9 of 66

/csa/api/codar/app-design/{applicationDesignId} DELETE "Delete an application design" on page 16

List application designs

Retrieve a list of application designs.

URI Method Parameters Returns

http://[host]:[port]/csa/api/codar/app-design/list GET None 200 - successful400 - bad request401 - not authorized500 - internal server error

Examples

The following URL was sent:

https://localhost:8444/csa/api/codar/app-design/list

The following JSON was returned:

{ "@type" : "urn:x-hp:2013:software:cloud:topology_model:topologys", "@self" : "/csa/api/topology-model/topology", "@actual-count" : 1, "@start-index" : 0, "@total-count" : 1, "members" : [ { "@self" : "/csa/api/topology-model/topology/22b4706c-0849-4c35-b552-4e42c90ae5e4", "@type" : "urn:x-hp:2013:software:cloud:topology_model:topology", "groupId" : "com.hp.csa", "artifactId" : "81072ea2-2a7f-4fd7-b582-5e47b97fd0b9", "version" : "1.0.0" "displayName" : "Petclinic Application for AWS" } ] }

Export an application design

Export an application design by providing the application design ID. The application design is returned in JSON format.

API Quick Start

HP Helion Codar (1.00) Page 10 of 66

URI Method Parameters Returns

http://[host]:[port]/csa/api/codar/app-design/{applicationDesignId}

GET Design ID 200 - successful400 - bad request401 -not authorized404 - not found500 - internal server error

Examples

The following URL was sent:

https://localhost:8444/csa/api/codar/app-design/e57673db-0ee7-4061-8f9e-ffdcabc07b4c

The following JSON was returned:

{ "@self" : "/csa/api/topology-model/topology/e57673db-0ee7-4061-8f9e-ffdcabc07b4c", "@type" : "urn:x-hp:2013:software:cloud:topology_model:topology", "groupId" : "com.hp.csa", "artifactId" : "3eb835ae-750f-41c9-8861-de70a285ca40", "version" : "1.0.0", "displayName" : "Test_Design-1", "description" : "my design", "resources" : [ { "id" : "VcenterServer0001", "name" : "vCenter Server 1", ... (For complete output, see "Export an application design example" on page 41.) }

Import an application design

Create an application design by providing the application design in JSON format as input. If the design already exists, then an error is returned.

URI Method Parameters Returns

http://[host]:[port]/csa/api/codar/app-design/import

POST JSON 201 - successful400 - bad request401 - authorization failed500 - internal server error

API Quick Start

HP Helion Codar (1.00) Page 11 of 66

Examples

The following URL was sent:

https://localhost:8444/csa/api/codar/app-design/import

The following JSON was sent:

{ "@type" : "urn:x-hp:2013:software:cloud:topology_model:topology", "groupId" : "com.hp.csa", "artifactId" : "3eb835ae-750f-41c9-8861-de70a285ca43", "version" : "1.0.0", "displayName" : "Test_Design-2", "description" : "my design 02", "resources" : [ { "id" : "VcenterServer0001", "name" : "vCenter Server 1", "component" : { "@self" : "/csa/api/topology-model/component-type/b83f4e21-d8a9-4ff3-a76e-3a69775d1d86" }, ... (For complete output, see "Import an application design example" on page 47.) }

The following JSON was returned:

{ "@self" : "/csa/api/topology-model/topology/e57673db-0ee7-4061-8f9e-ffdcabc07b4c", "@type" : "urn:x-hp:2013:software:cloud:topology_model:topology", "groupId" : "com.hp.csa", "artifactId" : "3eb835ae-750f-41c9-8861-de70a285ca40", "version" : "1.0.0", "displayName" : "Test_Design-1", "description" : "my design", "resources" : [ { "id" : "VcenterServer0001", "name" : "vCenter Server 1", "component" : { "@self" : "/csa/api/topology-model/component-type/b83f4e21-d8a9-4ff3-a76e-3a69775d1d86" }, ... (For complete output, see "Import an application design example" on page 47.) }

API Quick Start

HP Helion Codar (1.00) Page 12 of 66

Import a new application design

Create a new application design if it does not exist. If the design exists, no error is displayed and the original design is returned.

URI Method Parameters Returns

http://[host]:[port]/csa/api/codar/app-design/importNew

POST JSON 201 - successful400 - bad request401 - authorization failed500 - internal server error

Examples

The following URL was sent:

https://localhost:8444/csa/api/codar/app-design/importNew

The following JSON was sent:

{ "@type" : "urn:x-hp:2013:software:cloud:topology_model:topology", "groupId" : "com.hp.csa", "artifactId" : "3eb835ae-750f-41c9-8861-de70a285ca43", "version" : "1.0.1", "displayName" : "Test_Design-2", "description" : "my design 02", ... (The remaining output is the same as "Import an application design example" on page 47.) }

The following JSON was returned:

{ "@self" : "/csa/api/topology-model/topology/e57673db-0ee7-4061-8f9e-ffdcabc07b4c", "@type" : "urn:x-hp:2013:software:cloud:topology_model:topology", "groupId" : "com.hp.csa", "artifactId" : "3eb835ae-750f-41c9-8861-de70a285ca40", "version" : "1.0.1", "displayName" : "Test_Design-1", "description" : "my design", ... (The remaining output is the same as "Import an application design example" on page 47) }

API Quick Start

HP Helion Codar (1.00) Page 13 of 66

Associate a design to HP Helion Codar

Associate an application design to the HP Helion Codar pipeline management process by tagging the application design with the Codar Application tag.

URI Method Parameters Returns

http://[host]:[port]/csa/api/codar/app-design/{applicationDesignId}/associateToCodar

POST JSON 200 - successful400 - bad request401 - authorization failed404 - Not found500 - internal server error

Examples

The following URL was sent:

https://localhost:8444/csa/api/codar/app-design/ae058bcc-4ad3-4e9a-8eb8-3ee98eef8d8f/associateToCodar

The following JSON was returned:

{"associatedTagId": "8a818cf8ara15bc772b0145cb6efjhg99","designId": "ae058bcc-4ad3-4e9a-8eb8-3ee98eef8d8f","designName": "MyDesign","associatedTagName": "Codar Application"}

Dissociate a design from HP Helion Codar

Dissociate an application design from the HP Helion Codar pipeline management process by removing the Codar Application tag from the application design.

URI Method Parameters Returns

http://[host]:[port]/csa/api/codar/app-design/{applicationDesignId}/dissociateFromCodarApplication

POST JSON 200 - successful400 - bad request404 - Not found

API Quick Start

HP Helion Codar (1.00) Page 14 of 66

Examples

The following URL was sent:

https://localhost:8444/csa/api/codar/app-design/440af252-741b-4f65-addf-8239f6feb8dd/dissociateFromCodarApplication

The following JSON was returned:

{"dissociatedTagId": "8a8185bb47b46bbe0147b4c4b8c00006","designId": "267fa378-7234-4e8d-b96d-97f62a448cbe","designName": "NewD","dissociatedTagName": "Codar Application"}

Update an application design

Update an application design by providing an application design ID and an application design in JSON format.

URI Method Parameters Returns

http://[host]:[port]/csa/api/codar/app-design/{applicationDesignId}

PUT Design ID 200 - successful400 - bad request401 - authorization failed404 - not found500 - internal server error

Examples

The following URL was sent:

https://localhost:8444/csa/apidocs.jsp/codar/app-design/e57673db-0ee7-4061-8f9e-ffdcabc07b4c

The following JSON was sent:

{ "@self" : "/csa/api/topology-model/topology/e57673db-0ee7-4061-8f9e-ffdcabc07b4c", "@type" : "urn:x-hp:2013:software:cloud:topology_model:topology", "groupId" : "com.hp.csa", "artifactId" : "3eb835ae-750f-41c9-8861-de70a285ca40", "version" : "1.0.0", "displayName" : "Test_Design-1",

API Quick Start

HP Helion Codar (1.00) Page 15 of 66

"description" : "my design updated", ... (The remaining output is the same as "Import an application design example" on page 47 with modified values.) }

The following JSON was returned:

{ "@self" : "/csa/api/topology-model/topology/e57673db-0ee7-4061-8f9e-ffdcabc07b4c", "@type" : "urn:x-hp:2013:software:cloud:topology_model:topology", "groupId" : "com.hp.csa", "artifactId" : "3eb835ae-750f-41c9-8861-de70a285ca40", "version" : "1.0.2", "displayName" : "Test_Design-1", "description" : "my design updated", ... (The remaining output is the same as "Import an application design example" on page 47.) }

Delete an application design

Delete an application design. Any package that is associated with this design is also deleted.

URI Method Parameters Returns

http://[host]:[port]/csa/api/codar/app-design/{applicationDesignId}

DELETE Design ID 200 - successful204 - no content400 - bad request401 - authorization failed404 - not found500 - internal server error

Examples

The following URL was sent:

https://localhost:8444/csa/api/codar/app-design/e57673db-0ee7-4061-8f9e-ffdcabc07b4c

Artifact APIs

URI Method See also

API Quick Start

HP Helion Codar (1.00) Page 16 of 66

/artifact/<organization_id>/group GET "List active groups associated with an organization" below

/artifact/<organization_id>/group POST "Add groups to an organization" on the next page

/artifact/<organization_id>/group/<grou_id>

PUT "Update group display name, distinguished name" on page 20

/artifact/<organization_id>/group/<group_id>

DELETE "Delete or disassociate group from an organization" on page 21

List active groups associated with an organization

List active groups associated with an organization

URI Method Parameters Returns

http://[host]:[port]/csa/rest/artifact/<organization_id>/group

GET userIdentifier=<user_id> Required; the user ID you want to use as credentials for this API call.

200 - successful 401 - not authorized 404 - object not found 500 - server exception

Example

The following URL was sent:

https://<host>:<port>/csa/rest/artifact/8a81818f3d02fb7e013d0308891d0003/group?userIdentifier=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><isCriticalSystemObject>false</isCriticalSystemObject> <name>sc_February 22, 2013 5:54:43 PM UTC</name> <displayName>CODAR_APPLICATION_DEVELOPER</displayName> <state>...</state> <artifactType>...</artifactType> <disabled>false</disabled> <distinguishedName>

API Quick Start

HP Helion Codar (1.00) Page 17 of 66

cn=CodarApplicationDeveloper,ou=CodarApplicationDeveloperGroup,ou=CodarGroups </distinguishedName> <role> ... </role> </group></GroupList>

Add groups to an organization

Add groups to an organization.

URI Method Parameters Returns

http://[host]:[port]/csa/rest/artifact/<organization_id>/group

POST userIdentifier=<user_id> Required; the user ID you want to use as credentials for this API call.

200 - successful401 - not authorized404 - object not found500 - internal server error

Note that the role must be specified for each group in the request body. Valid roles are as follows:

l CODAR_APPLICATION_ARCHITECT

l CODAR_APPLICATION_DEVELOPER

l CODAR_APPLICATION_QA

l CODAR_APPLICATION_RELEASE_MANAGER

Example

The following URL was sent:

https://<host>:<port>/csa/rest/artifact/8a81818f3d1421e7013d1423635a0003/group?userIdentifier=90d96588360da0c701360da0f1d5f483

The following XML was sent:

<GroupList> <group> <displayName>My-Group-Name</displayName> <distinguishedName> cn=TestConsumer,ou=CodarApplicationDeveloper,ou=CodarGroups </distinguishedName> <role>

API Quick Start

HP Helion Codar (1.00) Page 18 of 66

<name>CODAR_APPLICATION_DEVELOPER</name> </role> </group> <group> <displayName>Another-Group-Name</displayName> <distinguishedName> cn=TestConsumer2,ou=CodarApplicationDeveloper,ou=CodarGroups </distinguishedName> <role> <name>CODAR_APPLICATION_DEVELOPER</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=CodarApplicationDeveloper,ou=CodarGroups </distinguishedName> <role> <isCriticalSystemObject>false</isCriticalSystemObject> <name>CODAR_APPLICATION_DEVELOPER</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=CodarApplicationDeveloper,ou=CodarGroups </distinguishedName> <role> <isCriticalSystemObject>false</isCriticalSystemObject> <name>CODAR_APPLICATION_DEVELOPER</name> <disabled>false</disabled> </role> </group> </GroupList>

API Quick Start

HP Helion Codar (1.00) Page 19 of 66

Update group display name, distinguished name

Updates the group display name and/or distinguished name for the specified organization.

URI Method Parameters Returns

http://[host]:[port]/csa/rest/artifact/<organization_id>/group/<group_id>

PUT userIdentifier=<user_id> Required; the user ID you want to use as credentials for this API call.

200 - successful401 - not authorized404 - object not found505 - server exception

Example

The following URL was sent:

https://<host>:<port>/csa/rest/artifact/8a81818f3d02fb7e013d0308891d0003group/8a81818f3d1437e2013d1795d41107ea?userIdentifier=90d96588360da0c701360da0f1d5f483

The following XML was sent:

<GroupList> <group> <displayName>My-New-Group-Name</displayName> <distinguishedName> cn=TestConsumer,ou=CodarApplicationDeveloper,ou=CodarGroups </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> <disabled>false</disabled> </state>

API Quick Start

HP Helion Codar (1.00) Page 20 of 66

<artifactType> <id>90d96588360da0c701360da0eeff002b</id> <isCriticalSystemObject>false</isCriticalSystemObject> <name>GROUP</name> <disabled>false</disabled> </artifactType> <disabled>false</disabled> <distinguishedName> cn=TestConsumer,ou=CodarApplicationDeveloper,ou=CodarGroups </distinguishedName> </Group>

Delete or disassociate group from an organization

Deletes a group or to disassociates 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.

URI Method Parameters Returns

http://[host]:[port]/csa/rest/artifact/<organization_id>/group/<group_id>

DELETE userIdentifier=<user_id> Required; the user ID you want to use as credentials for this API call.

200 - successful401 - not authorized404 - object not found500 - server exception

Example

The following URL was sent:

https://<host>:<port>/csa/rest/artifact/8a81818f3d1421e7013d1423635a0003/group/8a81818f3d1437e2013d1795d41107ea?userIdentifier=90d96588360da0c701360da0f1d5f483

The following XML was returned:

<messageList> <messages>Removed role association for My-New-Group-Name</messages> </messageList>

API Quick Start

HP Helion Codar (1.00) Page 21 of 66

Package APIs

URI Method See also

/csa/api/codar/app-package GET "List packages" below

/csa/api/codar/app-package/{packageId} GET "Get package details" on the next page

/csa/api/codar/app-package/states GET "Get package states" on page 24

/csa/api/codar/app-package/properties GET "Get package properties" on page 25

/csa/api/codar/app-package/composition/{topologyId}/candidateTopology

GET "List infrastructure designs" on page 25

/csa/api/codar/app-package POST "Create a package" on page 26

/csa/api/codar/app-package/createWithProperties POST "Create package with properties" on page 27

/csa/api/codar/app-package/{packageId}/promote POST "Promote a package" on page 28

/csa/api/codar/app-package/{packageId}/reject POST "Reject a package" on page 29

/csa/api/codar/app-package/{packageId}/deploy POST "Deploy a package" on page 29

/csa/api/codar/app-package/{packageId} PUT "Update package name and description" on page 30

/csa/api/codar/app-package/{packageId}/properties PUT "Update package component properties" on page 31

/csa/api/codar/app-package/{packageId} DELETE "Delete package" on page 32

List packages

Retrieve a list of all packages for an application design.

URI Method Parameters Returns

http://[host]:[port]/csa/api/codar/app-package/list

GET None 200 - successful400 - bad request401 - authorization failed404 - not found500 - internal server error

API Quick Start

HP Helion Codar (1.00) Page 22 of 66

Examples

https://localhost:8444/csa/api/codar/app-package/list

The following JSON was returned:

{ "@total_results": 4, "@self": "/csa/api/package/", "@type": "urn:x-hp:2012:software:cloud:data_model:package", "members": [ { "@type": "urn:x-hp:2012:software:cloud:data_model:package", "name": "DEVELOPMENT", "color": "#D1AF89", "image": "images/applications/dev.png", ... (For complete output, see "List packages example" on page 59.) }

Get package details

Retrieves package details and topology and deployed instance details.

URI Method Parameters Returns

http://[host]:[port]/csa/api/codar/app-package/{packageId}

GET Package ID 200 - successful400 - bad request404 - not found

Examples

https://localhost:8444/csa/api/codar/app-package/5975ad69-0519-484b-bde3-30b936dd31b

The following JSON was returned:

{ "@self": "/csa/api/package/455274d8-80dc-4bff-a6cd-4d15408bffe0", "@type": "urn:x-hp:2012:software:cloud:data_model:package", "stage": "DEVELOPMENT", "state": "ACTIVE", "name": "Testmypack", "lastUpdated": "2014-08-22T10:55:28.059Z", "description": null, "topologyData": { "name": "TestMy App", "iconurl": "/csa/api/blobstore/Service_Design.png?tag=library",

API Quick Start

HP Helion Codar (1.00) Page 23 of 66

"version": "1.0.0" }, "instanceData": [ { "createdOn": "2014-08-22T10:55:06.416Z", "id": "6b5b532d-a498-4381-bcd2-4fbbe7e040a7", "status": "FAILED", "displayName": "Testmypack:Test" }, { "createdOn": "2014-08-22T10:55:06.416Z", "id": "afa50882-b72a-4fcc-8127-d51dc4f01e11", "status": "FAILED", "displayName": "Testmypack:Test" } ] }

Get package states

Retrieves package states.

URI Method Parameters Returns

http://[host]:[port]/csa/api/codar/app-package/states

GET None 200 - successful400 - bad request401 - not authorized404 - not found500 - Internal server error

Examples

The following URL was sent:

https://localhost:8444/csa/api/codar/app-package/states

The following JSON was returned:

{ "@total_results": 2, "@self": "/csa/api/package/states", "@type": "urn:x-hp:2012:software:cloud:data_model:packageState", "members": [ { "name": "ACTIVE" }, { "name": "REJECTED"

API Quick Start

HP Helion Codar (1.00) Page 24 of 66

] }

Get package properties

Retrieve the properties that are parametrized in the package for each component of the application design.

URI Method Parameters Returns

http://[host]:[port]/csa/api/codar/app-package/{packageId}/properties

GET Package ID 200 - successful400 - bad request404 - not found

Examples

The following URL was sent:

https://10.1.13.216:8444/csa/api/codar/app-package/70d8f028-5cfc-48f6-8799-78623eeff4f7/properties

The following Parameter was sent:

packageId

The following JSON was returned:

{ "members": [{ "icon": "pluginResources/topology/icons/SERVER.svg", "@self": "/csa/api/package/component/VcenterServerType__VERSION__04.20.0000__GROUPID__com.hp.csa.type0001", "description": "vCenter Server", "@type": "urn:x-hp:2012:software:cloud:data_model:package", "name": "vCenter Server", "provider": "VMWARE_VCENTER", "properties": [ ... (For complete output, see "Get package properties example" on page 62.) }

List infrastructure designs

Retrieve the infrastructure designs for a given partial design (Topology Composition) of the application design.

API Quick Start

HP Helion Codar (1.00) Page 25 of 66

URI Method Parameters Returns

http://[host]:[port]/csa/api/codar/app-package/composition/{topologyId}/candidateTopology

GET Topology ID 200 - successful400 - bad request404 - not found

Examples

The following URL was sent:

https://localhost:8444/csa/api/codar/app-package/composition/902442d3-700c-4b57-8abb-8d1a52ae3f3d/candidateTopology

The following JSON was sent:

{ "count": 5,"members" : [ {"@type" : "urn:x-hp:2013:software:cloud:topology_model:topology","@self" : "/csa/api/topology-model/topology/7843ee06-8a5e-425e-ac0d-424e3a297d52","id" : "7843ee06-8a5e-425e-ac0d-424e3a297d52",

"iconUrl" : "/csa/designer/img/noimage-lightgray.svg","displayName" : "Infra Design","description" : "dfs", ... (For complete output, see "List infrastructure designs example" on page 60.) }

Create a package

Create a new package for the given application design. The package will only be created if the HP Helion Codar license is present and the design is associated to the Codar Application tag.

URI Method Parameters Returns

http://[host]:[port]/csa/api/codar/app-package POST JSON body 201 - successful400 - bad request404 - not found

Examples

The following URL was sent:

https://localhost:8444/csa/api/codar/app-package/

API Quick Start

HP Helion Codar (1.00) Page 26 of 66

The following JSON was sent:

{"name":"HelloWorld Package 1","description":"This is my first Package","applicationDesignId" : "30d4458b-e54c-4e91-a144-026d09289ae0"}

The following JSON was returned:

{ "@self": "/csa/api/package/09ead497-82d1-4045-8b17-73122c3cc6be", "@type": "urn:x-hp:2012:software:cloud:data_model:package", "lifecycleStage": "DEVELOPMENT", "packageState": "ACTIVE", "applicationDesignId": "30d4458b-e54c-4e91-a144-026d09289ae0", "name": "HelloWorld Package 1", "description": "This is my first Package" }

Create package with properties

Create a new package for the given application design with properties. The package will only be created if the HP Helion Codar license is present and the design is associated to the Codar Application tag. Only the required properties of the components in the application can be parameterized in the package.

URI Method Parameters Returns

http://[host]:[port]/csa/api/codar/app-package/createWithProperties

POST JSON body 200 - successful400 - bad request401 - authorization failed500 - internal server error

Examples

The following URL was sent:

https://localhost:8444/csa/api/codar/app-package/createWithProperties

The following JSON was sent:

{ "designId":"02e8c0cc-1dd9-43c7-941e-1252b6619cee", "packageName":"Package1", "packageDescription":"description", "members": [ { "icon": "pluginResources/topology/icons/SERVER.svg", "@self": "/csa/api/package/component/VcenterServerType__

API Quick Start

HP Helion Codar (1.00) Page 27 of 66

VERSION__04.20.0000__GROUPID__com.hp.csa.type0001", "description": "vCenter Server", "@type": "urn:x-hp:2012:software:cloud:data_model:package", "name": "vCenter Server", "provider": "VMWARE_VCENTER", "displayName": "vCenter Server", "properties" : [ { "name" : "vmTemplateReference", "value" : "UbuntuTemp" }, { "name" : "vmNamePrefix", "value" : "Test" } ] }, "displayName": "vCenter Server" ]}

The following JSON was returned:

{packageId": "bc384c91-6345-4fe1-886f-e3c973280d09"}

Promote a package

Promote a package to the next lifecycle stage. The out of the box lifecycle stages are Development, Testing , Staging and Production. Only one package can be promoted to production.

URI Method Parameters Returns

http://[host]:[port]/csa/api/codar/app-package/{packageId}/promote

POST Package ID 200 - successful400 - bad request404 - not found

Examples

The following URL was sent:

https://localhost:8444/csa/api/codar/package/d05bb6ec-23bf-425a-9c90-240fbc8f99a9/promote

The following JSON was returned:

API Quick Start

HP Helion Codar (1.00) Page 28 of 66

{ "promotedToStage": "TESTING", "packageName": "Demo_package", "packageId": "d05bb6ec-23bf-425a-9c90-240fbc8f99a9" }}

Reject a package

Moves a package to the rejected state. A package in rejected state can not be deployed or promoted.

URI Method Parameters Returns

http://[host]:[port]/csa/api/codar/app-package/{packageId}/reject

POST Package ID 200 - successful400 - bad request401 - authorization failed404 - not found500 - internal server error

Examples

The following URL was sent:

https://localhost:8444/csa/api/codar/package/a7fa2df4-9f23-4ba7-b8df-0a14f9eba221/reject

The following XML was sent:

Example XML sent in request, if applicable

The following XML was returned:

{ "packageName": "Promote Package 2", "packageState": "REJECTED", "packageId": "a7fa2df4-9f23-4ba7-b8df-0a14f9eba221" }

Deploy a package

Deploys a package for a complete or partial application design.

URI Method Parameters Returns

API Quick Start

HP Helion Codar (1.00) Page 29 of 66

http://[host]:[port]/csa/api/codar/app-package/{packageId}/deploy

POST Package ID, JSON with runname, environment ID, infrastructure design, and modifiable properties of the package.

Note: Profile ID is not used.

200 - successful400 - bad request401 - authorization failed

Examples

The following URL was sent:

https://localhost:8444/csa/api/codar/package/d8482010-89b8-42ab-8b69-1396267223cd/deploy

The following JSON was sent:

{ "name":"Test run of Package", "profileId":null, "environmentId":"/csa/api/resource/environment/8a81855947f856f30147f85921890003", "infrastructureDesign":{"designId":"027daf8c-82f3-419e-9e54-ea4d5acc8d16"}, "modifiableProperties": [ { "id":"VcenterServerType__VERSION__04.10.0000__GROUPID__com.hp.csa.type0001", "itemType":"NODE", "propertyName":"vmTemplateReference", "propertyType":"string", "propertyValue":"csata-rhelsa915" } ]}

The following JSON was returned:

{ "ServiceInstanceId": "8a81855947f874ea0147f8887b0101ae" }

Update package name and description

Update a package name and description.

URI Method Parameters Returns

API Quick Start

HP Helion Codar (1.00) Page 30 of 66

http://[host]:[port]/csa/api/codar/app-package/{packageId}

PUT Package ID, JSON body with package name and description

200 - successful400 - bad request404 - not found

Examples

The following URL was sent:

https://localhost:8444/csa/api/codar/app-package/5975ad69-0519-484b-bde3-30b936dd31b

The following JSON was sent:

{"name":"package Name","description":"Package Description"}

The following JSON was returned:

{ "@self": "/csa/api/package/update/5410dd5a-7b03-4ea3-932a-3dcb108a09a9", "@type": "urn:x-hp:2012:software:cloud:data_model:package", "name": "package Name", "description": "Package Description"}

Update package component properties

Update component properties for a package.

URI Method Parameters Returns

http://[host]:[port]/csa/api/codar/app-package/{packageId}/properties

PUT Package ID, JSON body

200 - successful400 - bad request404 - not found

Examples

The following URL was sent:

https://localhost:8444/csa/api/codar/app-package/5975ad69-0519-484b-bde3-30b936dd31b/properties

The following JSON was sent:

API Quick Start

HP Helion Codar (1.00) Page 31 of 66

{"members": [ { "icon": "pluginResources/topology/icons/SERVER.svg", "@self": "/csa/api/package/component/VcenterServerType__VERSION__04.10.0000__GROUPID__com.hp.csa.type0001", "description": "vCenter Server", "@type": "urn:x-hp:2012:software:cloud:data_model:package", "name": "vCenter Server", "provider": "VMWARE_VCENTER", "displayName": "vCenter Server", "properties" : [ { "name" : "vmTemplateReference", "value" : "ubuntu_tempref" },{ "name" : "customizationSpec", "value" : "linux_spec" },{ "name" : "vmNamePrefix", "value" : "app_" } ], "displayName": "vCenter Server" }]}

The following JSON was returned:

No Contents

Delete package

Delete a package.

URI Method Parameters Returns

http://[host]:[port]/csa/api/codar/app-package/{packageId}

DELETE Package ID 204 - successful400 - bad request404 - not found

Examples

The following URL was sent:

API Quick Start

HP Helion Codar (1.00) Page 32 of 66

https://localhost:8444/csa/api/codar/app-package/5975ad69-0519-484b-bde3-30b936dd31b

The following JSON was returned:

No contents

Lifecycle APIs

URI Method Description

/csa/api/codar/app-lifecycle/stages GET "List lifecycle stages" below

List lifecycle stages

Lists all lifecycle stages. This API is used by the HP Helion Codar UI to retrieve packages grouped by lifecycle. The default stage sequence is:Development >Testing >Staging > Production

The application design ID is an optional parameter. The default lifecycle stage is associated with all application designs, so the result is the same with or without the ID.

URI Method Parameters Returns

http://[host]:[port]/csa/api//codar/app-lifecycle/stages

GET Application design ID (optional)

200 - successful400 - bad request404 - not found

Examples

The following URL was sent:

https://localhost:8444/csa/api/codar/app-lifecycle/stages

The following JSON was returned:

{ "@total_results": 4, "@self": "/csa/api/codar/app-lifecycle/stages/", "@type": "urn:x-hp:2012:software:cloud:data_model:lifeCycleStage", "members": [ { "@self": "/csa/api/codar/app-lifecycle/stages/84905d24-d92f-4916-b312-78af206d31a5", "@type": "urn:x-hp:2012:software:cloud:data_model:lifeCycleStage",

API Quick Start

HP Helion Codar (1.00) Page 33 of 66

"name": "DEVELOPMENT" }, { "@self": "/csa/api/codar/app-lifecycle/stages/84905d24-d92f-4916-b312-78af206d31a6", "@type": "urn:x-hp:2012:software:cloud:data_model:lifeCycleStage", "name": "TESTING" }, { "@self": "/csa/api/codar/app-lifecycle/stages/84905d24-d92f-4916-b312-78af206d31a7", "@type": "urn:x-hp:2012:software:cloud:data_model:lifeCycleStage", "name": "STAGING" }, { "@self": "/csa/api/codar/app-lifecycle/stages/84905d24-d92f-4916-b312-78af206d31a8", "@type": "urn:x-hp:2012:software:cloud:data_model:lifeCycleStage", "name": "PRODUCTION" } ] }

API Quick Start

HP Helion Codar (1.00) Page 34 of 66

Chapter 4: Retrieving information from HP Helion Codar using RESTful callsThe following sections provide information about the preparation for and execution of HP Helion Codar RESTful API calls.

Communication with HP Helion Codar Solution developers communicate with HP Helion Codar over HTTP or HTTPS and parse the data structures returned by HP Helion Codar. The default port for communication with HP Helion Codar is port 8444.

API data is returned in JSON format. You need to set the http headers Content-Type:application/json and accept:application/json for the call you are making.

Authentication with an integration account

Authentication is handled using HTTP basic authentication. The authentication value is provided in the API call via the Authorization header. The default credentials for the identity service’s transport user which can be used in making API calls are OOinbound user = ‘ooinbounduser’ and password = ‘cloud’. The default credentials for the HP CSA service’s transport user which can be used in making API calls are user = ‘ooinbounduser’ and password = ‘cloud’. The HP Helion Codar Administrator can create multiple transport users.

When exercising an API call from an HTTP client or from the interactive API content, the Authorization header is automatically generated using the credentials you supply when you log into HP Helion Codar as it will be required to get permission to make RESTful calls.

When exercising an API call from your application's code, you must create the Authorization header. Supply the Base64 encoded value of the <username>:<password> string for the user you will use for authentication.

The following example shows how to compute the Authorization header for the API identity service default credentials.

1. The username:password string for a default OOinbound user identity service integration account is ooinbounduser:cloud

2. The Base64 encoded value of this username:password string is: aWRtVHJhbnNwb3J0VXNlcjppZG1UcmFuc3BvcnRVc2Vy.

3. The Authorization header value specifies the keyword Basic to distinguish from other forms of authentication. Set the Authorization header to: Basic aWRtVHJhbnNwb3J0VXNlcjppZG1UcmFuc3BvcnRVc2Vy.

HP Helion Codar (1.00) Page 35 of 66

Executing RESTful callsHP Helion Codar RESTful API calls can be exercised through an HTTP client as described in "Exercising API calls using an HTTP client" below or programmatically from an application. The API calls can also be exercised through the interactive content as explained in "Exercising API calls using the interactive content" on page 38. Some calls have more strict permission requirements, such as administrator level permissions, so you must supply the appropriate credentials.

The base URL for the API is https://<host>:<port>/csa/api/, which is appended with the specific URI for the API call. For example, to access the API for managing application deployments, you would use the URL: https://<host>:<port>/csa/api/codar/app-deploy, substituting the host and port information appropriate for your HP Helion Codar environment.

Exercising API calls using an HTTP client

Though you can issue RESTful calls through any typical HTTP client (browser), you will likely find it more convenient to use a client designed especially for developers making RESTful calls. These are often referred to as REST clients. A REST client organizes the information you will work with when making RESTful calls: headers, methods, request and response bodies, and so on. A REST client makes it easier to compose and submit requests to the HP Helion Codar RESTful service APIs, as well as for viewing server responses.

A number of REST clients are available. You can add the REST Console plug-in for Google™ Chrome, for example, as follows:

l Start Google Chrome.

l Open Chrome Web Store.

l Use search box to search for REST Console.

l Click the + Free button, then click the Add button in the dialog box that appears.

Example configuration of REST Console plug-in:

API Quick Start

HP Helion Codar (1.00) Page 36 of 66

Configure the basic authorization in the Authorization tab using a username and password. See "Authentication with an integration account" on page 35 for more information. This user must have privileges to access HP Helion Codar's RESTful APIs.

Example REST Console authorization:

If the plug-in is configured correctly, you will see output in the Response Body tab similar to the following when you issue a request:

API Quick Start

HP Helion Codar (1.00) Page 37 of 66

Exercising API calls using the interactive content

In addition to being exercised programmatically or through an HTTP client, the HP Helion Codar API can be exercised through the “Try it out!” feature in the interactive API content. You will be prompted to log in to HP Helion Codar to access this content. Basic authentication and authorization required to make RESTful calls will be configured as part of the login process.

This interactive content is presented in a web interface, and can be accessed at https://<host>:<port>/csa/apidocs.jsp from a browser, substituting the host and port information appropriate for your HP Helion Codar environment.

The following is example content. The app-lifecycle call has been expanded in this example:

The content provides developers easy access to the following items:

l URI syntax for each call

l Whether there are any required or optional query parameters

API Quick Start

HP Helion Codar (1.00) Page 38 of 66

l The data type of each parameter

l Model and schema information, if applicable

l Interactive "Try it out!" dialogs that let you submit calls to your server, see the results, and understand how you need to construct your REST URIs and any request body.

Let's try out an API call.

1. If you have access to an HP Helion Codar instance, launch the interactive API content from a browser at https://<host>:<port>/csa/apidocs.jsp.

2. If you are not already logged into HP Helion Codar , you will be prompted to log in. The user must have appropriate authority to exercise HP Helion Codar RESTful calls.

3. Locate the app-design API call. Click on the call title to expand it.

4. Click on the codar/app-design/list GET method to view the complete documentation for this call.

5. Enter values for the start-index and page-size parameters. By default, the response for this API is to list all application designs starting with the start index of zero.

6. Click on the Try it out! button.

7. You should now see the request URL that was sent, as well as the response body, response code

API Quick Start

HP Helion Codar (1.00) Page 39 of 66

and response headers for your request as shown here.

Not every API call will be this simple to exercise, but this example demonstrates how the interactive API content is presented, and how RESTful calls can easily be made from this interface. In some situations you will need to make other API calls first to get information necessary for parameters or a request body.

Making API calls from an application

RESTful calls can be made from application code. Preparation for making these calls is similar to making them from an HTTP client. Authentication and authorization requirements as explained in "Communication with HP Helion Codar " on page 35 must be met.

You also need to set the HTTP headers Content-Type:application/json and accept:application/json as appropriate for the call you are making.

Appendix A: API return examplesThe following sections provide full output examples for HP Helion Codar RESTful API calls.

API Quick Start

HP Helion Codar (1.00) Page 40 of 66

Export an application design exampleExport an application design by providing the application design ID. The application design is returned in JSON format.

The following URL was sent:

https://localhost:8444/csa/api/codar/app-design/e57673db-0ee7-4061-8f9e-ffdcabc07b4c

The following JSON was returned:

{ "@self" : "/csa/api/topology-model/topology/e57673db-0ee7-4061-8f9e-ffdcabc07b4c", "@type" : "urn:x-hp:2013:software:cloud:topology_model:topology", "groupId" : "com.hp.csa", "artifactId" : "3eb835ae-750f-41c9-8861-de70a285ca40", "version" : "1.0.0", "displayName" : "Test_Design-1", "description" : "my design", "resources" : [ { "id" : "VcenterServer0001", "name" : "vCenter Server 1", "component" : { "@self" : "/csa/api/topology-model/component-type/b83f4e21-d8a9-4ff3-a76e-3a69775d1d86" }, "properties" : [ { "propertyKey" : "requestedMemorySize", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "vmTemplateReference", "propertyValue" : { "value" : "test", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "cpuCount", "propertyValue" : { "value" : null, "type" : "string",

API Quick Start

HP Helion Codar (1.00) Page 41 of 66

"confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "ipAddressList", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "closeSession", "propertyValue" : { "value" : "true", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "privateKey", "propertyValue" : { "value" : "", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "memorySize", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "requestedCpuCount", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "customizationSpec", "propertyValue" : { "value" : "test", "type" : "string", "confidential" : false, "consumerVisible" : true

API Quick Start

HP Helion Codar (1.00) Page 42 of 66

} }, { "propertyKey" : "hostname", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "macAddress", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "password", "propertyValue" : { "value" : "null", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "response", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "_modifiable_properties", "propertyValue" : { "value" : "", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "username", "propertyValue" : { "value" : "test", "type" : "string", "confidential" : false, "consumerVisible" : true } }, {

API Quick Start

HP Helion Codar (1.00) Page 43 of 66

"propertyKey" : "vmID", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "ipAddress", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "vmNamePrefix", "propertyValue" : { "value" : "test", "type" : "string", "confidential" : false, "consumerVisible" : true } } ], "outgoingRelations" : [ ], "annotations" : { "description" : "", "displayName" : "vCenter Server 1", "y" : "-400", "x" : "-400" } }, { "id" : "VcenterNetworkInterface0001", "name" : "vCenter Network Interface 1", "component" : { "@self" : "/csa/api/topology-model/component-type/05c69cad-ad1d-4285-befe-4963c7f86ae1" }, "properties" : [ { "propertyKey" : "response", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "_modifiable_properties", "propertyValue" : { "value" : "",

API Quick Start

HP Helion Codar (1.00) Page 44 of 66

"type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "networkInterfaceType", "propertyValue" : { "value" : "E1000", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "networkInterfaceId", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "portGroupName", "propertyValue" : { "value" : "test", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "vmID", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "macAddress", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "ipAddresses", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false,

API Quick Start

HP Helion Codar (1.00) Page 45 of 66

"consumerVisible" : true } } ], "outgoingRelations" : [ { "relationType" : "association", "id" : "rel0001", "properties" : [ { "propertyKey" : "_modifiable_properties", "propertyValue" : { "value" : "", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "_relation_type", "propertyValue" : { "value" : { "first" : "Association", "second" : "ASSOCIATION" }, "type" : "pair", "confidential" : false, "consumerVisible" : true } } ], "relationDescriptorName" : "VcenterNetworkInterfaceTypeToVcenterServerType", "resourceReference" : { "name" : "vCenter Server 1" } } ], "annotations" : { "description" : "", "displayName" : "vCenter Network Interface 1", "y" : "-400", "x" : "-200" } } ], "revision" : 0, "properties" : [ { "propertyKey" : "metamodelId", "propertyValue" : { "value" : "test", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "is_express",

API Quick Start

HP Helion Codar (1.00) Page 46 of 66

"propertyValue" : { "value" : null, "type" : "boolean", "confidential" : false, "consumerVisible" : true } } ], "tagIds" : [ ], "state" : "UNLOCKED", "profiles" : [ ], "annotations" : { "providerType" : "independent", "serviceBlueprintId" : "8a818cf045d640b00145d64a7c240017" } }

Import an application design exampleCreate an application design by providing the application design in JSON format as input. If the design already exists, then an error is returned.

The following URL was sent:

https://localhost:8444/csa/api/codar/app-design/import

The following JSON was sent:

{ "@type" : "urn:x-hp:2013:software:cloud:topology_model:topology", "groupId" : "com.hp.csa", "artifactId" : "3eb835ae-750f-41c9-8861-de70a285ca43", "version" : "1.0.0", "displayName" : "Test_Design-2", "description" : "my design 02", "resources" : [ { "id" : "VcenterServer0001", "name" : "vCenter Server 1", "component" : { "@self" : "/csa/api/topology-model/component-type/b83f4e21-d8a9-4ff3-a76e-3a69775d1d86" }, "properties" : [ { "propertyKey" : "requestedMemorySize", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true }

API Quick Start

HP Helion Codar (1.00) Page 47 of 66

}, { "propertyKey" : "vmTemplateReference", "propertyValue" : { "value" : "test", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "cpuCount", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "ipAddressList", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "closeSession", "propertyValue" : { "value" : "true", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "privateKey", "propertyValue" : { "value" : "", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "memorySize", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "requestedCpuCount",

API Quick Start

HP Helion Codar (1.00) Page 48 of 66

"propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "customizationSpec", "propertyValue" : { "value" : "test", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "hostname", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "macAddress", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "password", "propertyValue" : { "value" : "null", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "response", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "_modifiable_properties", "propertyValue" : { "value" : "",

API Quick Start

HP Helion Codar (1.00) Page 49 of 66

"type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "username", "propertyValue" : { "value" : "test", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "vmID", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "ipAddress", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "vmNamePrefix", "propertyValue" : { "value" : "test", "type" : "string", "confidential" : false, "consumerVisible" : true } } ], "outgoingRelations" : [ ], "annotations" : { "description" : "", "displayName" : "vCenter Server 1", "y" : "-400", "x" : "-400" } }, { "id" : "VcenterNetworkInterface0001", "name" : "vCenter Network Interface 1", "component" : { "@self" : "/csa/api/topology-model/component-type/05c69cad-ad1d-4285-befe-

API Quick Start

HP Helion Codar (1.00) Page 50 of 66

4963c7f86ae1" }, "properties" : [ { "propertyKey" : "response", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "_modifiable_properties", "propertyValue" : { "value" : "", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "networkInterfaceType", "propertyValue" : { "value" : "E1000", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "networkInterfaceId", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "portGroupName", "propertyValue" : { "value" : "test", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "vmID", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true }

API Quick Start

HP Helion Codar (1.00) Page 51 of 66

}, { "propertyKey" : "macAddress", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "ipAddresses", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } } ], "outgoingRelations" : [ { "relationType" : "association", "id" : "rel0001", "properties" : [ { "propertyKey" : "_modifiable_properties", "propertyValue" : { "value" : "", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "_relation_type", "propertyValue" : { "value" : { "first" : "Association", "second" : "ASSOCIATION" }, "type" : "pair", "confidential" : false, "consumerVisible" : true } } ], "relationDescriptorName" : "VcenterNetworkInterfaceTypeToVcenterServerType", "resourceReference" : { "name" : "vCenter Server 1" } } ], "annotations" : { "description" : "", "displayName" : "vCenter Network Interface 1", "y" : "-400",

API Quick Start

HP Helion Codar (1.00) Page 52 of 66

"x" : "-200" } } ], "revision" : 0, "properties" : [ { "propertyKey" : "metamodelId", "propertyValue" : { "value" : "test", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "is_express", "propertyValue" : { "value" : null, "type" : "boolean", "confidential" : false, "consumerVisible" : true } } ], "tagIds" : [ ], "state" : "UNLOCKED", "profiles" : [ ], }

The following JSON was returned:

{ "@self" : "/csa/api/topology-model/topology/e57673db-0ee7-4061-8f9e-ffdcabc07b4c", "@type" : "urn:x-hp:2013:software:cloud:topology_model:topology", "groupId" : "com.hp.csa", "artifactId" : "3eb835ae-750f-41c9-8861-de70a285ca40", "version" : "1.0.0", "displayName" : "Test_Design-1", "description" : "my design", "resources" : [ { "id" : "VcenterServer0001", "name" : "vCenter Server 1", "component" : { "@self" : "/csa/api/topology-model/component-type/b83f4e21-d8a9-4ff3-a76e-3a69775d1d86" }, "properties" : [ { "propertyKey" : "requestedMemorySize", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false,

API Quick Start

HP Helion Codar (1.00) Page 53 of 66

"consumerVisible" : true } }, { "propertyKey" : "vmTemplateReference", "propertyValue" : { "value" : "test", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "cpuCount", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "ipAddressList", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "closeSession", "propertyValue" : { "value" : "true", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "privateKey", "propertyValue" : { "value" : "", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "memorySize", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true }

API Quick Start

HP Helion Codar (1.00) Page 54 of 66

}, { "propertyKey" : "requestedCpuCount", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "customizationSpec", "propertyValue" : { "value" : "test", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "hostname", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "macAddress", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "password", "propertyValue" : { "value" : "null", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "response", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "_modifiable_properties",

API Quick Start

HP Helion Codar (1.00) Page 55 of 66

"propertyValue" : { "value" : "", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "username", "propertyValue" : { "value" : "test", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "vmID", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "ipAddress", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "vmNamePrefix", "propertyValue" : { "value" : "test", "type" : "string", "confidential" : false, "consumerVisible" : true } } ], "outgoingRelations" : [ ], "annotations" : { "description" : "", "displayName" : "vCenter Server 1", "y" : "-400", "x" : "-400" } }, { "id" : "VcenterNetworkInterface0001", "name" : "vCenter Network Interface 1", "component" : {

API Quick Start

HP Helion Codar (1.00) Page 56 of 66

"@self" : "/csa/api/topology-model/component-type/05c69cad-ad1d-4285-befe-4963c7f86ae1" }, "properties" : [ { "propertyKey" : "response", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "_modifiable_properties", "propertyValue" : { "value" : "", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "networkInterfaceType", "propertyValue" : { "value" : "E1000", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "networkInterfaceId", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "portGroupName", "propertyValue" : { "value" : "test", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "vmID", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true

API Quick Start

HP Helion Codar (1.00) Page 57 of 66

} }, { "propertyKey" : "macAddress", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "ipAddresses", "propertyValue" : { "value" : null, "type" : "string", "confidential" : false, "consumerVisible" : true } } ], "outgoingRelations" : [ { "relationType" : "association", "id" : "rel0001", "properties" : [ { "propertyKey" : "_modifiable_properties", "propertyValue" : { "value" : "", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "_relation_type", "propertyValue" : { "value" : { "first" : "Association", "second" : "ASSOCIATION" }, "type" : "pair", "confidential" : false, "consumerVisible" : true } } ], "relationDescriptorName" : "VcenterNetworkInterfaceTypeToVcenterServerType", "resourceReference" : { "name" : "vCenter Server 1" } } ], "annotations" : { "description" : "", "displayName" : "vCenter Network Interface 1",

API Quick Start

HP Helion Codar (1.00) Page 58 of 66

"y" : "-400", "x" : "-200" } } ], "revision" : 0, "properties" : [ { "propertyKey" : "metamodelId", "propertyValue" : { "value" : "test", "type" : "string", "confidential" : false, "consumerVisible" : true } }, { "propertyKey" : "is_express", "propertyValue" : { "value" : null, "type" : "boolean", "confidential" : false, "consumerVisible" : true } } ], "tagIds" : [ ], "state" : "UNLOCKED", "profiles" : [ ], "annotations" : { "providerType" : "independent", "serviceBlueprintId" : "8a818cf045d640b00145d64a7c240017" } }

List packages exampleRetrieve a list of all packages for an application design.

https://localhost:8444/csa/api/codar/app-package/list

The following JSON was returned:

{ "@total_results": 4, "@self": "/csa/api/package/", "@type": "urn:x-hp:2012:software:cloud:data_model:package", "members": [ { "@type": "urn:x-hp:2012:software:cloud:data_model:package", "name": "DEVELOPMENT", "color": "#D1AF89", "image": "images/applications/dev.png",

API Quick Start

HP Helion Codar (1.00) Page 59 of 66

"packages": [ { "@self": "/csa/api/package/d207499f-aba3-4e46-aa27-9357e2c6cb8d", "@type": "urn:x-hp:2012:software:cloud:data_model:package", "stage": "DEVELOPMENT", "state": "ACTIVE", "icon": "images/applications/dev.png", "name": "P1", "deployedInstanceCount": "0", "lastUpdated": "2014-09-30T11:15:19.344Z", "description": null, "topologyData": null, "instanceData": null } ] }, { "@type": "urn:x-hp:2012:software:cloud:data_model:package", "name": "TESTING", "color": "#FFC300", "image": "images/applications/test.png", "packages": [] }, { "@type": "urn:x-hp:2012:software:cloud:data_model:package", "name": "STAGING", "color": "#E188CA", "image": "images/applications/stage.png", "packages": [] }, { "@type": "urn:x-hp:2012:software:cloud:data_model:package", "name": "PRODUCTION", "color": "#FF7D6A", "image": "images/applications/prod.png", "packages": [] } ] }

List infrastructure designs exampleRetrieve the infrastructure designs for a given partial design (Topology Composition) of the application design.

The following URL was sent:

API Quick Start

HP Helion Codar (1.00) Page 60 of 66

https://localhost:8444/csa/api/codar/app-package/composition/902442d3-700c-4b57-8abb-8d1a52ae3f3d/candidateTopology

The following JSON was sent:

{ "count": 5,"members" : [ {"@type" : "urn:x-hp:2013:software:cloud:topology_model:topology","@self" : "/csa/api/topology-model/topology/7843ee06-8a5e-425e-ac0d-424e3a297d52","id" : "7843ee06-8a5e-425e-ac0d-424e3a297d52",

"iconUrl" : "/csa/designer/img/noimage-lightgray.svg","displayName" : "Infra Design","description" : "dfs","version" : "1.0.0","artifactId" : "40e0dabd-39e0-4e9f-a53b-4a4b9d8bb60c","groupId" : "com.hp.csa","published" : true,"tagIds" : [ {"@self" : "/csa/api/tag/8a818cf8ara15bc772b0145cb6efjhg99"} ]}, {"@type" : "urn:x-hp:2013:software:cloud:topology_model:topology","@self" : "/csa/api/topology-model/topology/9b073143-8969-43c3-85af-1004084ab05d","id" : "9b073143-8969-43c3-85af-1004084ab05d","iconUrl" : "/csa/designer/img/noimage-lightgray.svg",

"displayName" : "Exst-srvr","description" : "","version" : "1.0.0","artifactId" : "4ce4c900-8760-4ede-9431-31737bc175a4","groupId" : "com.hp.csa","published" : false,"tagIds" : [ ]}, {"@type" : "urn:x-hp:2013:software:cloud:topology_model:topology","@self" : "/csa/api/topology-model/topology/e7690ecf-b552-4ba1-989f-ae3922c25cda","id" : "e7690ecf-b552-4ba1-989f-ae3922c25cda","iconUrl" : "/csa/designer/img/noimage-lightgray.svg","displayName" : "Complete-TD-1","description" : "","version" : "1.0.0","artifactId" : "6eed3374-5112-4118-9f37-791b191acfeb","groupId" : "com.hp.csa","published" : false,"tagIds" : [ ]

API Quick Start

HP Helion Codar (1.00) Page 61 of 66

}, {"@type" : "urn:x-hp:2013:software:cloud:topology_model:topology","@self" : "/csa/api/topology-model/topology/ab0a4b3d-6476-4e24-8fcf-73d4a8122e48","id" : "ab0a4b3d-6476-4e24-8fcf-73d4a8122e48","iconUrl" : "/csa/designer/img/noimage-lightgray.svg","displayName" : "Testing Configure ","description" : "","version" : "1.0.0","artifactId" : "790a9840-2777-422b-8e71-c3f8d87eb997",

"groupId" : "com.hp.csa","published" : false,"tagIds" : [ {"@self" : "/csa/api/tag/8a818cf8ara15bc772b0145cb6efjhg99"} ]}, {"@type" : "urn:x-hp:2013:software:cloud:topology_model:topology","@self" : "/csa/api/topology-model/topology/ac102c58-8cdb-4e65-8083-e1e1c30f464f",

"id" : "ac102c58-8cdb-4e65-8083-e1e1c30f464f",

"iconUrl" : "/csa/designer/img/noimage-lightgray.svg","displayName" : "PD-Test_Complete-TD-1","description" : "","version" : "1.0.0","artifactId" : "a4c87694-3a68-43f7-899a-05279a64a983","groupId" : "com.hp.csa","published" : false,"tagIds" : [ ]} ]}

Get package properties exampleRetrieve the properties that are parametrized in the package for each component of the application design.

The following URL was sent:

https://10.1.13.216:8444/csa/api/codar/app-package/70d8f028-5cfc-48f6-8799-78623eeff4f7/properties

The following Parameter was sent:

packageId

The following JSON was returned:

API Quick Start

HP Helion Codar (1.00) Page 62 of 66

{ "members": [{ "icon": "pluginResources/topology/icons/SERVER.svg", "@self": "/csa/api/package/component/VcenterServerType__VERSION__04.20.0000__GROUPID__com.hp.csa.type0001", "description": "vCenter Server", "@type": "urn:x-hp:2012:software:cloud:data_model:package", "name": "vCenter Server", "provider": "VMWARE_VCENTER", "properties": [ { "name": "vmTemplateReference", "value": "ubuntu_tempref" }, { "name": "customizationSpec", "value": "linux_spec" }, { "name": "vmNamePrefix", "value": "app_" } ], "displayName": "vCenter Server" }, { "icon": "pluginResources/topology/icons/SERVER.svg", "@self": "/csa/api/package/component/VcenterServerType__VERSION__04.20.0000__GROUPID__com.hp.csa.type0002", "description": "vCenter Server", "@type": "urn:x-hp:2012:software:cloud:data_model:package", "name": "vCenter Server", "provider": "VMWARE_VCENTER", "properties": [ { "name": "vmTemplateReference", "value": "ubuntu_tempref" }, { "name": "customizationSpec", "value": "linux_spec" }, { "name": "vmNamePrefix", "value": "app_" } ], "displayName": "vCenter Server" } ]

API Quick Start

HP Helion Codar (1.00) Page 63 of 66

}

API Quick Start

HP Helion Codar (1.00) Page 64 of 66

Send Documentation FeedbackIf you have comments about this document, you can contact the documentation team by email. If an email client is configured on this system, click the link above and an email window opens with the following information in the subject line:

Feedback on API Quick Start (Helion Codar 1.00)

Just add your feedback to the email and click send.

If no email client is available, copy the information above to a new message in a web mail client, and send your feedback to [email protected].

We appreciate your feedback!

HP Helion Codar (1.00) Page 65 of 66