You can use the vRealize Automation REST API reservation service to create a vCloud Air reservation.

Before you begin

  • Log in to vRealize Automation as a fabric group administrator.

  • Verify that the host 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.

  • Display a list of the reservation types that are supported in the vRealize Automation server. See Display a List of Supported Reservation Types.

  • Obtain the permissible value field information required to create a new reservation. After you retrieve all permissible value field information, you have the input information required to create a reservation. See Get Resources Schema for a vSphere Reservation.

For the full list of tasks that you can perform before you create a reservation, see Create a Reservation.

Procedure

Create a vCloud Air reservation.
curl --insecure -H "Accept:application/json" 
-H "Authorization: Bearer $token" 
https://$host/reservation-service/api/reservations -d “
{
  "name": "TestvAppReservation",
  "reservationTypeId": "Infrastructure.Reservation.Cloud.vCloudAir",
  "tenantId": "qe",
  "subTenantId": "a5d056be-3aa2-4fdd-ba1e-a3805f26f0e0",
  "enabled": true,
  "priority": 1,
  "reservationPolicyId": null,
  "alertPolicy": {
    "enabled": false,
    "frequencyReminder": 0,
    "emailBgMgr": true,
    "recipients": [
      
    ],
    "alerts": [
      {
        "alertPercentLevel": 80,
        "referenceResourceId": "storage",
        "id": "storage"
      },
      {
        "alertPercentLevel": 80,
        "referenceResourceId": "memory",
        "id": "memory"
      },
      {
        "alertPercentLevel": 80,
        "referenceResourceId": "cpu",
        "id": "cpu"
      },
      {
        "alertPercentLevel": 80,
        "referenceResourceId": "machine",
        "id": "machine"
      }
    ]
  },
  "extensionData": {
    "entries": [
      {
        "key": "computeResource",
        "value": {
          "type": "entityRef",
          "componentId": null,
          "classId": "ComputeResource",
          "id": "c527a0f5-b1ae-4b61-8145-ad9d5c434dc7",
          "label": "Engineering Allocation VDC"
        }
      },
      {
        "key": "machineQuota",
        "value": {
          "type": "integer",
          "value": 0
        }
      },
      {
        "key": "allocationModel",
        "value": {
          "type": "integer",
          "value": 0
        }
      },
      {
        "key": "reservationNetworks",
        "value": {
          "type": "multiple",
          "elementTypeId": "COMPLEX",
          "items": [
            {
              "type": "complex",
              "componentTypeId": "com.mycompany.csp.iaas.blueprint.service",
              "componentId": null,
              "classId": "Infrastructure.Reservation.Network",
              "typeFilter": null,
              "values": {
                "entries": [
                  {
                    "key": "networkPath",
                    "value": {
                      "type": "entityRef",
                      "componentId": null,
                      "classId": "Network",
                      "id": "42c5063c-5422-448f-aac7-22ebe941ac8e",
                      "label": "VM Network SQA"
                    }
                  }
                ]
              }
            }
          ]
        }
      },
      {
        "key": "reservationStorages",
        "value": {
          "type": "multiple",
          "elementTypeId": "COMPLEX",
          "items": [
            {
              "type": "complex",
              "componentTypeId": "com.mycompany.csp.iaas.blueprint.service",
              "componentId": null,
              "classId": "Infrastructure.Reservation.Storage",
              "typeFilter": null,
              "values": {
                "entries": [
                  {
                    "key": "computeResourceStorageTotalSizeGB",
                    "value": {
                      "type": "integer",
                      "value": 1000
                    }
                  },
                  {
                    "key": "storagePath",
                    "value": {
                      "type": "entityRef",
                      "componentId": null,
                      "classId": "Storage",
                      "id": "e655aa78-e5fb-4722-9e8a-0cd4139248cf",
                      "label": "High Performance Storage"
                    }
                  },
                  {
                    "key": "storagePriority",
                    "value": {
                      "type": "integer",
                      "value": 1
                    }
                  },
                  {
                    "key": "storageReservedSizeGB",
                    "value": {
                      "type": "integer",
                      "value": 100
                    }
                  },
                  {
                    "key": "storageEnabled",
                    "value": {
                      "type": "boolean",
                      "value": true
                    }
                  },
                  {
                    "key": "computeResourceStorageFreeSizeGB",
                    "value": {
                      "type": "integer",
                      "value": 691
                    }
                  }
                ]
              }
            }
          ]
        }
      },
      {
        "key": "reservationMemory",
        "value": {
          "type": "complex",
          "componentTypeId": "com.mycompany.csp.iaas.blueprint.service",
          "componentId": null,
          "classId": "Infrastructure.Reservation.Memory",
          "typeFilter": null,
          "values": {
            "entries": [
              {
                "key": "computeResourceMemoryTotalSizeMB",
                "value": {
                  "type": "integer",
                  "value": 13312
                }
              },
              {
                "key": "memoryReservedSizeMb",
                "value": {
                  "type": "integer",
                  "value": 4096
                }
              }
            ]
          }
        }
      }
    ]
  }
} 
“

The output is a location URL, including the new vCloud Air reservation ID.

Location:
https://$host/reservation-service/api/reservations/3289b039-2a11-4ab4-a0bc-b583e4c6d085