To request the deployment of a cloud template, you use the Blueprint APIs to make a POST request with the cloud template ID as input.
Prerequisites
- Verify that all general prerequisites and prerequisites for the Cloud Assembly Blueprint service have been satisfied. See Prerequisites for API Use Case Examples.
- Verify that you have a project ID for the project that includes cloud zones configured to support the resource requirements of your cloud template. See Create a Project to use in Cloud Assembly.
- Verify that the flavor mapping and image mapping specified in the released vRealize Automation cloud template version exist in your cloud account. See Create Flavor Mappings and Create Image Mappings.
- Verify that you have the ID for the cloud template you want to deploy. See Create and Update a Cloud Template.
- Verify that you have tested your cloud template deployment to ensure deployment viability. See Test Your Cloud Template Deployment.
Procedure
Example: Deploy a Cloud Template
For a cloud template with ID 1f170637-81a3-4257-b1cd-b2219ee8034c, request the deployment with image mapping set to ubuntu and flavor mapping set to small.
Assign variables.
$ url='https://appliance.domain.com' $ api_version='2019-09-12' $ cloud_template_id='1f170637-81a3-4257-b1cd-b2219ee8034c' $ image_mapping='ubuntu' $ flavor_mapping='small'
Request the deployment of a cloud template.
$ curl -X POST \ $url/blueprint/api/blueprint-requests?apiVersion=$api_version \ -H "Authorization: Bearer $access_token" \ -H 'Content-Type: application/json' \ -d '{ "description": "requesting deployment from cloud template", "blueprintId": "'"$cloud_template_id"'", "inputs": { "count": 2, "image":"'"$image_mapping"'", "flavor":"'"$flavor_mapping"'" } }' | jq "."
A snippet of the response shows the cloud template request ID, the deployment ID, and the cloud template ID.
{ "id": "889f95a8-79a3-4b2f-b19e-32d1536dd69a", "createdAt": "2019-10-11T00:11:55.544Z", ... "projectName": "Example-project", "deploymentId": "15454178-63fc-42ea-b4ad-7ed8a5cdb128", "requestTrackerId": "889f95a8-79a3-4b2f-b19e-32d1536dd69a", ... "blueprintId": "1f170637-81a3-4257-b1cd-b2219ee8034c", ...
Assign the cloud template request ID variable.
$ cloud_template_request_id='889f95a8-79a3-4b2f-b19e-32d1536dd69a'
Request the status of the deployment.
$ curl -X GET \ $url/blueprint/api/blueprint-requests/$cloud_template_request_id?apiVersion=$api_version \ -H "Authorization: Bearer $access_token" | jq "."
A snippet of the response shows the cloud template request ID and the cloud template ID with the status of the deployment request. If the deployment fails, the failure message indicates the reason for the failure.
{ "id": "889f95a8-79a3-4b2f-b19e-32d1536dd69a" ... "blueprintId": "1f170637-81a3-4257-b1cd-b2219ee8034c", "inputs": { "count": 2, "image": "ubuntu", "flavor": "small" }, "status": "FINISHED", ...
What to do next
Use the deployment ID to look up resource information for your deployment.