Request a Machine

To request a machine, you first list all shared catalog items to find the machine, then make the request for that item using a template.

Prerequisites

  • Log in to vRealize Automation as a consumer or current business group user.
  • Verify that the appliance name and fully qualified domain name of the vRealize Automation instance are available.
  • Verify that you have a valid HTTP bearer token that matches your login credentials. See REST API Authentication.

Procedure

  1. List all shared catalog items in the catalog.
    curl --insecure -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer $token" https://$vRA/catalog-service/api/consumer/entitledCatalogItemViews
    For details regarding input and output for this request, see Syntax for Listing Shared and Private Catalog Items.
  2. Examine the response to find the catalogItemId
  3. Get a template request for a catalog item.

    Use the catalogItemId to submit the template request for this catalog item. In this example, the catalogItemId is dc808d12-3786-4f7c-b5a1-d5f997c8ad66.

    curl --insecure -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer $token" https://$vRA/catalog-service/api/consumer/entitledCatalogItems/dc808d12-3786-4f7c-b5a1-d5f997c8ad66/requests/template
    
    For details regarding input and output for this request, see Syntax for Getting a Template Request for a Catalog Item.
    A template request for the catalog item is created. The fields and default values are populated based on the configuration of the underlying blueprint. By default, requestMachine.json is the name of the template request.
  4. Review and edit the template request.

    Review the contents of the template request and edit the values if you want to change them from the default prior to submitting the request for a machine. For example, you can specify a value for the description field or change the values for the machine resources if the blueprint allows for a range.

  5. Submit the request for a machine.
    curl --insecure -H "Content-Type: application/json"
    -H "Authorization: Bearer $token”
    https://$vRA/catalog-service/api/consumer/entitledCatalogItems/dc808d12-3786-4f7c-b5a1-d5f997c8ad66/requests --verbose --data
    @C:/Temp/requestMachine.json
    {
         $contentsOfTemplateFromPrecedingSections
    }
    
    For details regarding input and output for this request see Syntax for Requesting a Machine.
  6. (Optional) View the details of your request.

    You can perform a GET on the URI in the Location header to retrieve the updated request details. In this example, the URI-in-Location-header is 7aaf9baf-aa4e-47c4-997b-edd7c7983a5b.

    curl --insecure -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer $token" https://$vRA/catalog-service/api/consumer/requests/7aaf9baf-aa4e-47c4-997b-edd7c7983a5b 
    
    For details regarding input and output for this request, see Syntax for Viewing Details of a Machine Request.