Syntax for Getting Resources Schema for a vCloud Air Reservation

POST /api/data-service/schema/{schemaClassId}/default/{fieldId}/values with a schemaClassId for vCloud Air, displays information about available resources, such as storage and network information, for a vCloud Air reservation.

Overview

This example illustrates how to get a permissible value list for the reservationStorages field. Use the generated output as input for creating or updating a vCloud Air reservation.

Table 1. Extension Fields Supported in vCloud Reservations
Field ID Data Type Type Class Permissible Value Depends on Field
reservationNetworks Complex Type Infrastructure.Reservation.Network Yes computeResource
allocationModel Integer NA No NA
reservationMemory Complex Type Infrastructure.Reservation.Memory No NA
computeResource Entity Reference ComputeResource Yes NA
machineQuota Integer NA No NA
reservationStorages Complex Type Infrastructure.Reservation.Storage Yes computeResource
Note: The information in the table is subject to change. Call the data and schema service to retrieve the latest field information.

For related information, see Syntax for Displaying a Schema Definition for a vCloud Air Reservation.

Input

Use the supported input parameters to control the command output.

Parameter Description
URL https://$vRA/reservation-service/api/data-service/schema/$schemaclassid/default/$fieldid/values
Method Post
$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.

$schemaclassid Specifies the schema class ID.

This example illustrates how to use the reservationStorages field of a reservation type as an example. The schema class ID of a vCloud Air reservation is Infrastructure.Reservation.Cloud.vCloudAir. For this example, the input value for $schemaclassid is Infrastructure.Reservation.Cloud.vCloudAir.

$fieldId Specifies the field ID of the resource.

For example, the field ID for the reservation storage is reservationStorages. For this example, the input value for $fieldId is reservationStorages.

HTTP body Contains information about dependencies.

Because the dependency of the permissible value field reservationStorages is computeResource, you must include a dependency definition in the HTTP body.

text Empty
dependencyValues JSON string that defines the dependency values
entries

key -- Specifies the field ID of dependent field. For this example, enter computeResource.

value -- Specifies the value of the dependent field. For this example, copy and paste the vCloud HTTP response obtained by using the Get Compute Resource task. See Syntax for Getting Resources Schema for a vCloud Air Reservation.

Output

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

Property Description
values An array of data rows, each of which represents one of the reservation storage objects returned in a pageable list. Each reservation storage object contains an underlyingValue and label entry.
underlyingValue JSON string representing one permissible value for a field:
  • type -- data type of entityRef, complexRef, or primary
  • component ID -- componentID
  • classId -- schema class ID of current data type
  • id -- unique reservation storage ID
  • label --reservation storage label
label Specifies the reservation storage label. This value matches the underlyingValue value.

curl Command

The following example command returns vCloud Air reservation storage information.

curl -X POST --insecure -H "Accept:application/json" 
-H "Authorization: Bearer $token" 
https://$vRA/reservation-service/api/data-service/schema/Infrastructure.Reservation.Cloud.vCloudAir/default/reservationStorages/values  -d “

JSON Output

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

Copy the output from an underlyingValue section into an XML editor and use it as input to create or update a reservation.

{
  "values": [
    {
      "underlyingValue": {
        "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": "f4df029b-d475-4f85-ab42-05bddde3f667",
                "label": "Low Performance Storage"
              }
            },
            {
              "key": "computeResourceStorageFreeSizeGB",
              "value": {
                "type": "integer",
                "value": 954
              }
            }
          ]
        }
      },
      "label": "Low Performance Storage"
    },
    {
      "underlyingValue": {
        "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": "computeResourceStorageFreeSizeGB",
              "value": {
                "type": "integer",
                "value": 691
              }
            }
          ]
        }
      },
      "label": "High Performance Storage"
    }
  ]
}