Deploy a Blueprint with Contents Inline
To request a deployment of a blueprint with contents inline, you use the Blueprint APIs to make a POST request with a project ID.
In this example, you deploy a
blueprint by providing contents inline instead of providing a blueprint ID. The new
blueprint has different content from previously deployed blueprints including a load
balancer component, a virtual machine component, and a network component. For
information about deploying a blueprint by providing a blueprint ID, see Deploy Your Blueprint.
Prerequisites
- Verify that all general prerequisites have been satisfied. See Prerequisites for working with the vRealize Automation Cloud Assembly APIs.
Procedure
Example: Deploy a Blueprint with Contents Inline
Request a deployment named Deployment with Blueprint Contents Inline. When requesting the deployment, set image mapping set to ubuntu and flavor mapping set to small.
Assign variables.
$ url='https://appliance.domain.com' $ api_version='2019-09-12' $ project_id='394a4ccb-22c6-4ef0-8c75-8b77efbefb51' $ deployment_name="Deployment with Blueprint Contents Inline"
To deploy a blueprint, you must assign image mapping and flavor mapping variables.
$ image_mapping='ubuntu' $ flavor_mapping='small'
Request a deployment of an inline blueprint.
$ curl -X POST \ $url/blueprint/api/blueprint-requests?apiVersion=$api_version \ -H "Authorization: Bearer $access_token" \ -H 'Content-Type: application/json' \ -d '{ "deploymentName": "'"$deployment_name"'", "description": "requesting blueprint deployment with contents inline", "projectId": "'"$project_id"'", "inputs": { "flavor": "'"$flavor_mapping"'", "image" : "'"$image_mapping"'" }, "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\nresources:\n cloud-vm:\n type: Cloud.AWS.EC2.Instance\n properties:\n name: cloudvm\n flavor: '\''${input.flavor}'\''\n image: '\''${input.image}'\''\n networks:\n - name: '\''${resource.Cloud_Network_1.name}'\''\n network: '\''${resource.Cloud_Network_1.id}'\''\n Provider_LoadBalancer_1:\n type: Cloud.LoadBalancer\n properties:\n name: OC-LB\n routes:\n - protocol: HTTP\n port: '\''80'\''\n instanceProtocol: HTTP\n instancePort: '\''80'\''\n healthCheckConfiguration:\n protocol: HTTP\n port: '\''80'\''\n urlPath: /index.html\n intervalSeconds: 60\n timeoutSeconds: 5\n unhealthyThreshold: 5\n healthyThreshold: 2\n network: '\''${resource.Cloud_Network_1.name}'\''\n instances:\n - '\''${resource[\"cloud-vm\"].id}'\''\n internetFacing: false\n Cloud_Network_1:\n type: Cloud.Network\n properties:\n name: provider\n networkType: public\n" }' | jq "."
A snippet of the response provides the blueprint request ID.
... "type": "blueprint-request", "id": "bec37f54-3de5-451d-b484-a110c0ed8772", "selfLink": "/blueprint/api/blueprint-requests/bec37f54-3de5-451d-b484-a110c0ed8772", "createdAt": "2019-08-12T19:15:59.025Z", ...
Assign the blueprint request ID.
$ blueprint_request_id='bec37f54-3de5-451d-b484-a110c0ed8772'
Get the deployment status.
$ curl -X GET \ $url/blueprint/api/blueprint-requests/$blueprint_request_id?apiVersion=$api_version \ -H "Authorization: Bearer $access_token" | jq "."
A snippet of the response shows the deployment status.
... "inputs": { "image": "ubuntu", "flavor": "small" }, "status": "FINISHED", ...