Develop > API calls > Package APIs > Deploy a package

Deploy a package

Deploys a package for a complete or partial application design. This API maps service designs to the requirements they can fulfill, and creates a topology design composed of the service designs that satisfy each requirement. When the design ID of the service design is null, the designToRequirementsMapping is used and the design ID of each mapped object is used to replace the requirement component in the composed design. When the design ID of the service design has a value, a single design is chosen for composition.

Use the List the candidate topologies that can fulfill the specified partial topology API to obtain the design IDs of the candidate designs.

This API validates the deployment of a package and allows all environments associated with a container and life cycle stage. If there is no association, this API deploys packages in any environment.

URI Method Parameters Returns
http://[host]:[port]/csa/api/codar/app-package/{packageID}/deploy POST
  • Package ID
  • JSON with runname, environment ID, service design, and modifiable properties of the package.

Note: Profile ID is not used.

200 - successful
400 - bad request
404 - not found

Examples

In the following example, a single service design is selected for composition.

The following URL was sent:

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

The following JSON was returned:

{ "name": "deployName", "environmentId": "6ba19933-76df-4c5c-b784-fc22a704ec2b", "modifiableProperties": [{ "id": "VcenterServerType__VERSION__04.10.0000__GROUPID__com.hp.csa.type0001", "itemType": "NODE", "propertyName": "vmTemplateReference", "propertyType": "string", "propertyValue": "csata-rhelsa915" }, { "id": "VcenterServerType__VERSION__04.10.0000__GROUPID__com.hp.csa.type0001", "itemType": "NODE", "propertyName": "customizationSpec", "propertyType": "string", "propertyValue": "Linux" }], "infrastructureDesign": { "designId": "99a19933-76df-4c5c-b784-fc22a704ec26" }, "designToRequirementsMap": [{ "designId": "f1f1a314-5d73-4fed-9f93-fcb4165f8404", "requirementIds": ["Server__VERSION__1__GROUPID__com.hp.csa.type0001"] }, { "designId": "f1f1a314-5d73-4fed-9f93-fcb4165f8404", "requirementIds": ["Server__VERSION__1__GROUPID__com.hp.csa.type0002"] }, { "designId": "4d7a843a-64e0-4538-882f-889379a92101", "requirementIds": ["ApplicationServer__VERSION__1__GROUPID__com.hp.csa.type0001"] }] }

In the following example, the designtoRequirementsMapping is used, and service designs are selected per requirement and shared between multiple components. All of the requirement IDs that share the service design are provided for the same design ID object.

The following URL was sent:

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

The following JSON was returned:

{ "serviceInstanceId" : "8a8186e24d9a968a014d9f4488220134" }