Syntax for Getting Resources Schema for an Amazon Reservation

POST /api/data-service/schema/{schemaClassId}/default/{fieldId}/values with a schemaClassId for Amazon, displays resource schema information, such as storage and network data, for an Amazon reservation.

Overview

This example illustrates how to get a permissible value list for the securityGroups field. You can use the generated output as input for creating or updating an Amazon reservation.

Table 1. Extension Fields Supported in Amazon Reservations
Field ID Data Type Type Class Permissible Value Depends on Field
securityGroups Entity Reference AmazonSecurityGroup Yes computeResource
locations Entity Reference AvailabilityZone Yes computeResource
loadBalancers Entity Reference ElasticLoadBalancer Yes computeResource and locations
specificKeyPairs Entity Reference KeyPair Yes

computeResource

and keyPairs

computeResource Entity Reference ComputeResource Yes NA
VPC Complex Type Infrastructure.Reservation.Cloud.Amazon.VPC Yes computeResource
machineQuota Integer NA No NA
keyPairs String ResourcePools 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 an Amazon 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 securityGroups field of an Amazon reservation type as an example. The schema class ID of an Amazon reservation is Infrastructure.Reservation.Cloud.Amazon. For this example, the input value for $schemaclassid is Infrastructure.Reservation.Cloud.Amazon.

$fieldId Specifies the field ID of the resource.

For example, the field ID for the resource pool is securityGroups. For this example, the input value for $fieldId is securityGroups.

HTTP body Contains information about dependencies.

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

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 security group objects returned in a pageable list. Each security group 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 security group ID
  • label -- security group label
label Specifies the security groups label. This value matches the underlyingValue value.

curl Command

The following example command displays resource schema security group information.

curl -X POST --insecure -H "Accept:application/json" 
-H "Authorization: Bearer $token" 
https://$vRA/reservation-service/api/data-service/schema/Infrastructure.Reservation.Cloud.Amazon/default/securityGroups/values  -d “
{
  "text": "",
  "dependencyValues": {
    "entries": [{
      "key": "computeResource",
      "value": {
        "type": "entityRef",
        "componentId": null,
        "classId": "ComputeResource",
        "id": "9d1a3b5a-7162-4a5a-85b7-ec1b2824f554"
      }
    }]
  }
}
”

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": "entityRef",
        "componentId": null,
        "classId": "AmazonSecurityGroup",
        "id": "9",
        "label": "test1"
      },
      "label": "test1"
    },
    {
      "underlyingValue": {
        "type": "entityRef",
        "componentId": null,
        "classId": "AmazonSecurityGroup",
        "id": "10",
        "label": "default"
      },
      "label": "default"
    }
  ]
}