After creating a cloud template, you version and release your cloud template using a POST request. The request body includes the ID of an existing cloud template and the number of the version to release.
Prerequisites
- Verify that all general prerequisites and prerequisites for the Automation Assembler Blueprint service have been satisfied. See Prerequisites for API Use Case Examples.
- Verify that you have the cloud template ID for the cloud template you want to version and release. See Create and Update a Cloud Template.
- Verify that you know the version of the cloud template that you want to create and release to the catalog.
Procedure
Example: Version and Release a Cloud Template
Release version 5 of your cloud template with ID 1f170637-81a3-4257-b1cd-b2219ee8034c.
Assign variables.
$ url='https://appliance.domain.com' $ api_version='2019-09-12' $ cloud_template_id='1f170637-81a3-4257-b1cd-b2219ee8034c' $ cloud_template_version='v5'
Version the cloud template without releasing it.
$ curl -X POST \
$url/blueprint/api/blueprints/$cloud_template_id/versions?apiVersion=$api_version \
-H "Authorization: Bearer $access_token" \
-H 'Content-Type: application/json' \
-d '{
"changeLog": "Creating a version '"$cloud_template_version"'",
"description": "Creating a version from the current draft",
"release": false,
"version": "'"$cloud_template_version"'"
}' | jq "."
Release the cloud template.
$ curl -X POST \ $url/blueprint/api/blueprints/$cloud_template_id/versions/$cloud_template_version/actions/release?apiVersion=$api_version \ -H "Authorization: Bearer $access_token" \ -H 'Content-Type: application/json' | jq "."
A snippet of the response shows the new cloud template version with a RELEASED status.
...
"blueprintId": "1f170637-81a3-4257-b1cd-b2219ee8034c",
"name": "MyExampleCloudTemplate",
"description": "Basic Cloud Machine cloud template",
"version": "v5",
"tags": [],
"content": "formatVersion: 1\ninputs:\n flavor:\n type: string\n title: Flavor\n description: Flavor Mapping Name\n image:\n type: string\n title: Image\n description: Image Mapping Name\n count:\n type: integer\n minimum: 1\n default: 1\n maximum: 2\n title: Number of Instances\nresources:\n BasicCloudMachine:\n type: Cloud.Machine\n properties:\n name: BasicCloudMachine\n flavor: '${input.flavor}' \n image: '${input.image}'\n count: '${input.count}'\n tags: [\n {\n \"key\": \"env\",\n \"value\": \"prod\"\n }\n ]\n",
"status": "RELEASED",
"versionDescription": "Creating a version from the current draft",
"versionChangeLog": "Creating a version v5",
"valid": true
}