You can use the vRealize Automation REST API catalog service to request an Amazon machine as defined in your chosen blueprint, or you can override the default values of the blueprint by adding properties to your JSON input file to override default values. For example, you can choose a specific location.

Input

Use the supported input parameters to control the command output.

Parameter

Description

URL

https://$host/catalog-service/api/consumer/requests/requestId

$host

Specifies the host name and fully qualified domain name or IP address of the vRealize Automation identity server.

$token

Specifies a valid HTTP bearer token with necessary credentials.

JSON file or string input

Add required JSON input to the command line. See Syntax for Constructing a JSON File for an Amazon Machine Request.

JSON Template for Command Input

Use the following JSON template sample to create a JSON command input string set or file for use in the command line.

{
	"@type": "CatalogItemRequest",
	"catalogItemRef": {
		"id": "catalog_item_ID"
	},
	"organization": {
		"tenantRef": "tenant_name",
		"subtenantRef": "business_group_ID"
	},
	"requestedFor": "username@fqdn",
	"state": "SUBMITTED",
	"requestData": {
		"entries": [{
			"key": "provider-blueprintId",
			"value": {
				"type": "string",
				"value": "blueprint_ID"
			}
		},
		{
			"key": "provider-provisioningGroupId",
			"value": {
				"type": "string",
				"value": "business_group_ID"
			}
		},
		{
			"key": "requestedFor",
			"value": {
				"type": "string",
				"value": "username@fqdn"
			}
		},
		{
			"key": "provider-__Notes",
			"value": {	
				"type": "string",
				"value": "notes"
			}
		},
		{
			"key": "description",
			"value": {
				"type": "string",
				"value": "description"
			}
		},
		{
			"key": "reasons",
			"value": {
				"type": "string",
				"value": "reasons"
			}
		},
		{
			"key": "provider-Cafe.Shim.VirtualMachine.Reason",
			"value": {
				"type": "string",
				"value": "provider_reason"
			}
		},
		{
			"key": "provider-__amazon.instanceType",
			"value": {
				"type": "string",
				"value": "Amazon_ins_type"
			}
		}]
	}
}

The following table describes the IDs, machine resources, and other information to add to the JSON file to create the JSON input parameters to submit the machine request.

Populate all the highlighted value equivalents from the following example JSON file when you create a JSON input file.

Value

Description

catalog_item_ID

Specifies the value of CatalogItem ID in the machine blueprint catalog item.

tenant_name

Specifies the value of tenantRef in the machine blueprint catalog item.

business_group_ID

Specifies the value of subtenantRef in the machine blueprint catalog item.

username@fqdn

Specifies the user name of the consumer and business group manager account and fully qualified domain name.

blueprint_ID

Specifies the value of bindingId in the machine blueprint catalog item.

notes

Specifies notes that help to describe the request.

description

Contains a description of the request.

reasons

Contains a general reason for the request.

provider_reason

Contains a general provider reason for the request.

Amazon_ins_type

Specifies an Amazon instance type.

Request only Amazon instance types that are supported by the blueprint. If necessary, consult the fabric administrator for details on what blueprint supports. For information about Amazon instance types, see Amazon product documentation.

JSON Input File

The following example requests a small Amazon instance type, which overrides the default location to us-west-1a. It also creates an EBS storage volume named Backup and mounts it to /dev/sdf.

{
	"@type": "CatalogItemRequest",
	"catalogItemRef": {
		"id": "catalog_item_ID"
	},
	"organization": {
		"tenantRef": "tenant_name",
		"subtenantRef": "business_group_ID"
	},
	"requestedFor": "username@fqdn",
	"state": "SUBMITTED",
	"requestData": {
		"entries": [{
			"key": "provider-blueprintId",
			"value": {
				"type": "string",
				"value": "blueprint_ID"
			}
		},
		{
			"key": "provider-provisioningGroupId",
			"value": {
				"type": "string",
				"value": "business_group_ID"
			}
		},
		{
			"key": "requestedFor",
			"value": {
				"type": "string",
				"value": "username@fqdn"
			}
		},
		{
			"key": "provider-__Notes",
			"value": {	
				"type": "string",
				"value": "notes"
			}
		},
		{
			"key": "description",
			"value": {
				"type": "string",
				"value": "description"
			}
		},
		{
			"key": "reasons",
			"value": {
				"type": "string",
				"value": "reasons"
			}
		},
		{
			"key": "provider-Cafe.Shim.VirtualMachine.Reason",
			"value": {
				"type": "string",
				"value": "provider_reason"
			}
		},
		{
			"key": "provider-__amazon.instanceType",
			"value": {
				"type": "string",
				"value": "Amazon_ins_type"
			}
		}]
	}
}

Output

The command output contains property names and values based on the command input parameters.

Property

Description

version

Displays the object version number.

state

Specifies the item state, such as submitted.

approvalStatus

Specifies a status indicating whether this request has been approved, rejected, or is still pending some form of approval.

waitingStatus

Specifies a status indicating whether this request is waiting on any external users or services before it is able to progress.

requestNumber

Specifies a more user-friendly identifier for this request.

executionStatus

Specifies the current execution status of the request.

stateName

Specifies the localized state name.

phase

Specifies the current phase of the request, which is more coarse grained and easier for users to understand.

id

Specifies the unique identifier of this resource.

iconId

Specifies an icon for this request based on the requested object type.

description

Contains a brief description of this request.

reasons

Specifies the business reasons entered by the requestor or owner of this request.

requestedFor

Specifies the ID of the user for whom this request is logged.

requestedBy

Specifies the ID of the user who actually submitted the request

organization

Subtenant and/or tenant owner of this request.

requestorEntitlementId

Specified the value of the requestorEntitlement setting.

preApprovalId

Specifies the ID of the preApproval setting.

postApprovalId

Specifies the ID of the approval generated for the post-provisioning workflow step.

dateCreated

Specifies the date when this request was sent to the catalog.

lastUpdated

Specifies the date when this request was last updated.

dateSubmitted

Specifies the date when this request was first submitted.

dateApproved

Specifies the date when this request was approved.

dateCompleted

Specifies the date when this request was completed.

quote

Contains a quote made by the provider defining the estimated cost(s) associated with the request and/or any resources provisioned as a result of the request.

requestCompletion

Contains additional request completion information.

requestData

Contains a map of the provider-specific field-value pairs collected for this request.

retriesRemaning

Specifies the number of attempts remaining to move this request from its current state to the next state in the request workflow.

Some state transitions require calls to external services. These calls may fail due to transient errors such as momentary network errors. In these cases, the catalog will retry the call a number of times before failing.

This property defines the number of retries remaining for the current state transition. When it reaches 0, the catalog will stop retrying and mark the request as failed. This property is reset to the default number of retries for every new operation that is triggered.

requestedItemName

Specifies the item name.

requestedItemDescription

Specifies the item description.

curl Command

The following example command submits a request that includes the specifications in an ec2machine_specific.json input file.

curl --insecure -H "Content-Type: application/json" 
-H "Authorization: Bearer $token"
https://$host/catalog-service/api/consumer/requests --data @ec2machine_specific.json

JSON Output

The following JSON output is returned based on the command input.

The highlighted URL in the following sample indicates the location and ID of the vRealize Automation request.

Request Headers
{
             Accept = application/json
       Content-Type = application/json
     Content-Length = 1347
     Accept-Charset = big5, big5-hkscs, ...
}
Response Headers
{
               Date = Tue, 11 Oct 2014 22:28:35 GMT
               ETag = "0"
           Location = https://abx148-084-124.eng.mycompany.com/catalog-service/api/consumer/requests/25211c6c-f09d-4e2b-
                      9be4-7b09c47c9f6c
       Content-Type = application/json;charset=UTF-8
     Content-Length = 0
               Vary = Accept-Encoding,User-Agent
         Keep-Alive = timeout=15, max=100
         Connection = Keep-Alive
}
null