Syntax for Getting a Template Request for a Catalog Item

GET /api/consumer/entitledCatalogItems/{id}/requests/template retrieves a template request for a specific catalog item. VMware supplies a number of templates to help you create different types of machine requests.

Overview

In the entitledCatalogItemViews response, a link field contains a value similar to the following.

	{ 
            "@type":"link",
            "href":"https://$vRA/catalog-service/api/consumer/entitledCatalogItems/dc808d12-3786-4f7c-b5a1-d5f997c8ad66/requests/template",
            "rel":"GET: Request Template"
        }

This URL is a HATEOAS link for a template request for this catalog item. The rel field provides a description of the link (request template) and indicates the HTTP method to use with the URI in the href field (GET). By using these HATEOAS links, you can make follow-on API calls without having to consult the API documentation for the URI syntax or construct the links programmatically.

Review and Edit the Template Request

The returned template request is specific to the applicable catalog item. The fields and default values are populated based on the configuration of the underlying blueprint.

You can review the contents of the template and optionally edit the values if you want to change them from the default prior to submitting the request. 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.

Input

Use the supported input parameters to control the command output.

Parameter Description
id The UUID of the catalog item.

Output

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

Property Description
entitledOrganizations The list of organizations in which the current user can consume the catalog item.
catalogItemId Specifies the catalog item identifier.

curl Command to Get a Template Request for a Catalog Item

The following example command retrieves a template request for the catalog item with ID dc808d12-3786-4f7c-b5a1-d5f997c8ad66.
curl --insecure -H "Content-Type: application/json" 
-H "Authorization: Bearer $token”  https://$vRA/catalog-service/api/consumer/entitledCatalogItems/dc808d12-3786-4f7c-b5a1-d5f997c8ad66/requests/template

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

Note: Price is referred to as cost in API commands and output.
{
    "type": "com.vmware.vcac.catalog.domain.request.CatalogItemProvisioningRequest",
    "catalogItemId": "7c8275d6-1bd6-452a-97c4-d6c053e4baa4",
    "requestedFor": "csummers@example.com",
    "businessGroupId": "c0683388-6db2-4cb5-9033-b24d15ad3766",
    "description": null,
    "reasons": null,
    "data": {
        "Existing_Network_1": {
            "componentTypeId": "com.vmware.csp.component.cafe.composition",
            "componentId": null,
            "classId": "Blueprint.Component.Declaration",
            "typeFilter": "LinuxDemo*Existing_Network_1",
            "data": {
                "_cluster": 1,
                "_hasChildren": false,
                "description": null,
                "name": "Existing Network",
                "networkname": "Existing Network",
                "subnetmask": "255.255.255.0"
            }
        },
        "vSphere-Linux": {
            "componentTypeId": "com.vmware.csp.component.cafe.composition",
            "componentId": null,
            "classId": "Blueprint.Component.Declaration",
            "typeFilter": "LinuxDemo*vSphere-Linux",
            "data": {
                "Cafe.Shim.VirtualMachine.MaxCost": 0,
                "Cafe.Shim.VirtualMachine.MinCost": 0,
                "_cluster": 1,
                "_hasChildren": false,
                "action": "FullClone",
                "allow_storage_policies": false,
                "archive_days": 0,
                "blueprint_type": "1",
                "cpu": 1,
                "custom_properties": [],
                "daily_cost": 0,
                "datacenter_location": null,
                "description": null,
                "disks": [
                    {
                        "componentTypeId": "com.vmware.csp.iaas.blueprint.service",
                        "componentId": null,
                        "classId": "Infrastructure.Compute.Machine.MachineDisk",
                        "typeFilter": null,
                        "data": {
                            "capacity": 6,
                            "id": 0,
                            "initial_location": "",
                            "is_clone": false,
                            "label": "",
                            "storage_reservation_policy": "",
                            "userCreated": true,
                            "volumeId": 0
                        }
                    }
                ],
                "display_location": false,
                "guest_customization_specification": null,
                "lease_days": 0,
                "machine_actions": [
                    "DESTROY",
                    "POWER_ON",
                    "CONNECT_RDP_SSH",
                    "REPROVISION",
                    "POWER_CYCLE",
                    "EXPIRE",
                    "SUSPEND",
                    "CONNECT_REMOTE_CONSOLE",
                    "CONNECT_USING_VDI"
                ],
                "machine_prefix": {
                    "componentId": null,
                    "classId": "Infrastructure.Compute.MachinePrefix",
                    "id": "Use group default"
                },
                "max_network_adapters": 0,
                "max_per_user": 0,
                "max_volumes": 60,
                "memory": 4096,
                "nics": [
                    {
                        "componentTypeId": "com.vmware.csp.iaas.blueprint.service",
                        "componentId": null,
                        "classId": "Infrastructure.Compute.Machine.Nic",
                        "typeFilter": null,
                        "data": {
                            "address": "",
                            "assignment_type": "DHCP",
                            "custom_properties": null,
                            "id": 0,
                            "load_balancing": "",
                            "network_profile": "Existing Network"
                        }
                    }
                ],
                "number_of_instances": 1,
                "os_arch": "x86_64",
                "os_distribution": null,
                "os_type": "Linux",
                "os_version": null,
                "platform_name": "vsphere",
                "platform_type": "virtual",
                "property_groups": [
                    null
                ],
                "provisioning_workflow": {
                    "componentId": null,
                    "classId": "Infrastructure.Compute.ProvisioningWorkflow",
                    "id": "CloneWorkflow"
                },
                "reservation_policy": {
                    "componentId": null,
                    "classId": "Infrastructure.Reservation.Policy.ComputeResource",
                    "id": "None"
                },
                "security_groups": [],
                "security_tags": [],
                "source_machine": null,
                "source_machine_external_snapshot": null,
                "source_machine_name": "cbpcentos_63_x86",
                "source_machine_vmsnapshot": null,
                "storage": 6
            }
        }
    }
}