Syntax for Requesting a Machine
POST /api/consumer/entitledCatalogItems/{id}/requests submits a request for a specific catalog item with input provided in a JSON file.
Prepare your Request
From the entitledCatalogItemViews response, locate the link field that contains a value similar to the following:
{ "@type":"link", "href":"https://$vRA/catalog-service/api/consumer/entitledCatalogItems/dc808d12-3786-4f7c-b5a1-d5f997c8ad66/requests", "rel":"POST: Submit Request" }
Use the information in this response to edit the template construct the URI to request the desired catalog item using a POST command.
Input
Use the supported input parameters to control the command output.
Parameter | Description |
---|---|
URL | https://$vRA/catalog-service/api/consumer/entitledCatalogItems/$catalogId/requests |
$vRA |
Specifies the appliance name and fully qualified domain name, or IP address of the vRealize Automation server. |
$token |
Specifies a valid HTTP bearer token with necessary credentials. |
catalogItemId | The identifier of a catalog item. Typically, this is provided by users via the REST URI when making an entitledCatalogItem provisioning request. |
requestedFor | The user for whom this request is being made. Must be the fully qualified user ID. Typically this is provided by the REST URI when making an entitledCatalogItem provisioning request. |
businessGroupId | The business group identifier associated with the request. Typically this is provided via the REST URI when making the request. |
description | The catalog item description. |
reasons | |
data | Context-specific properties. Obtain the consumerEntitledCatalogItem template request to identify the properties available for a given context. |
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 price(es) 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. |
components | Returns the list of components associated with the request. The provider supplies this list of components after request initialization. |
curl Command to Request a Machine
To construct your request, refer to the entitledCatalogItemViews response received when you ran the request described in Syntax for Getting a Template Request for a Catalog Item, locate a link field that contains a value similar to the following:
{ "@type":"link", "href":"https://$vRA/catalog-service/api/consumer/entitledCatalogItems/f89fcbbf-7716-4a61-addd-a822dd4206f6/requests", "rel":"POST: Submit Request" }
The following example command submits a machine request using appropriately edited template content from the entitledCatalogItemViews response.
curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token” https://$vRA/catalog-service/api/consumer/entitledCatalogItems/f89fcbbf-7716-4a61-addd-a822dd4206f6/requests { $contentsOfTemplateFromPrecedingSections }
Output with Request and Response Headers
The following sample displays the request and response headers and the command output. Use the indicated JSON text file or inline text as input.
{ Accept = application/json Content-Type = application/json Content-Length = 2806 } Response Headers { Date = Wed, 03 Dec 2014 20:58:34 GMT ETag = "0" Location = https://$vRA/catalog-service/api/consumer/requests/7aaf9baf-aa4e-47c4-997b-edd7c7983a5b { $requestObjectDetails } 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