Version and Release a Blueprint to a vRealize Automation Service Broker Catalog

After creating a blueprint, you version and release your blueprint using a POST request. The request body includes the ID of an existing blueprint and the number of the version to release.

By versioning and releasing the blueprint, you mark a blueprint version as ready to be consumed by vRealize Automation Service Broker. To show the released blueprint in vRealize Automation Service Broker, you must have a catalog source.

Prerequisites

Procedure

  1. Assign the blueprint ID variable.
    blueprint_id='<your_blueprint_id>'
  2. Assign a blueprint version variable.
    blueprint_version='<your_blueprint_version>'

    your_blueprint_version is the version that you want to create.

  3. To version the blueprint without releasing it, submit the request with "release": false .
    curl -X POST \
      $url/blueprint/api/blueprints/$blueprint_id/versions?apiVersion=$api_version \
      -H "Authorization: Bearer $access_token" \
      -H 'Content-Type: application/json' \
      -d '{
      "changeLog": "Creating a version '"$blueprint_version"'",
      "description": "Creating a version from the current draft",
      "release": false,
      "version": "'"$blueprint_version"'"
    }' | jq "."
  4. Release the blueprint.
    curl -X POST \
      $url/blueprint/api/blueprints/$blueprint_id/versions/$blueprint_version/actions/release?apiVersion=$api_version" \
      -H "Authorization: Bearer $access_token" \
      -H 'Content-Type: application/json' | jq "."

Example: Version and Release a Blueprint

Release version 5 of your blueprint with ID 1f170637-81a3-4257-b1cd-b2219ee8034c.

Assign variables.

$ url='https://appliance.domain.com'
$ api_version='2019-09-12'
$ blueprint_id='1f170637-81a3-4257-b1cd-b2219ee8034c'
$ blueprint_version='v5'

Version the blueprint without releasing it.

$ curl -X POST \
  $url/blueprint/api/blueprints/$blueprint_id/versions?apiVersion=$api_version \
  -H "Authorization: Bearer $access_token" \
  -H 'Content-Type: application/json' \
  -d '{
  "changeLog": "Creating a version '"$blueprint_version"'",
  "description": "Creating a version from the current draft",
  "release": false,
  "version": "'"$blueprint_version"'"
}' | jq "."

Release the blueprint.

$ curl -X POST \
  $url/blueprint/api/blueprints/$blueprint_id/versions/$blueprint_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 blueprint version with a RELEASED status.

...        
  "blueprintId": "1f170637-81a3-4257-b1cd-b2219ee8034c",
  "name": "MyExampleBlueprint",
  "description": "Basic Cloud Machine blueprint",
  "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
}