You can use the REST API reservation service to display a schema definition for a specific vRealize Automation reservation type, for example an Amazon reservation.

Overview

Each reservation contains several fields. Some fields are common to all reservation types and some are type-specific. The list of type-specific fields is defined in a schema. Call a data and schema service to get schema definition information. The data and schema service combines fetch data and fetch schema REST API calls.

Tableau 1. Fields Common To All Reservation Types

Parameter

Description

Parameter Type

Id

Specifies the reservation ID.

GUID

name

Specifies the reservation name.

String

reservationTypeId

Specifies the reservation type, for example Infrastructure.Reservation.Virtual.vSphere or Infrastructure.Reservation.Virtual.Amazon.

String

tenantId

Specifies the tenant ID that contains the reservation.

String

subTenantId

Specifies the subtenant ID that contains the reservation.

GUID

enabled

Specifies whether the reservation is enabled.

Boolean

priority

Specifies the priority of the reservation during VM provisioning.

Integer

reservationPolicyId

Specifies the reservation policy ID to bind to this reservation.

GUID

alertPolicy

Specifies the alert policy of the reservation. The detail schema of this field refers to the alert policy.

JSON

extensionData

Contains type-specific fields. The detail schema of this field is retrieved by the data and schema service.

JSON

The following table describes the Amazon EC2 reservation types field IDs that appear in the output schema definitions.

Tableau 2. 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

Remarque :

The information in the table is subject to change. Call the data and schema service to retrieve the latest field information.

Input

Use the supported input parameters to control the command output.

Parameter

Description

URL

https://$host/reservation-service/api/data-service/schema/$schemaclassid/default

Method

Get

$host

Specifies the host name and fully qualified domain name or IP address of the vRealize Automation identity server.

$token

Specifies a valid HTTP bearer token with necessary credentials.

$schemaclassid

Specifies the schema class of the reservation type.

The schema class ID for an Amazon reservation is Infrastructure.Reservation.Cloud.Amazon.

Each supported reservation type contains specific fields. The supported fields are defined in the schema. For details, see the reservation service schema definitions in the Référence de l'API de vRealize Automation in vRealize Automation documentation.

Output

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

Each field contains an array of data rows. Each data row represents one of the fields defined in the schema.

Property

Description

Id

Specifies the unique identifier of this resource.

label

Specifies the field label.

dataType

Specifies the dataType field value:

  • type: Specifies the field value type:

    • Self refers to the object that was returned or requested.

    • First, Previous, Next, and Last refer to corresponding pages of a pageable list.

    • Specifies the application or service that determines the other names.

  • componentTypeid:

    Specifies the type ID of the component.

  • component:

    Specifies the unique identifier of the component.

  • classId:

    Specifies the schema class of the field

    This property is valid for complex and ref field types only.

  • label:

    Specifies the label of the field data type.

displayAdvice

Contains display advice for the field. This property is valid for a user interface element only.

permissibleValues

Optional field. If this field is a permissible value list field, define the meta info for the permissible value by using the following options:

  • type:

    Specifies if the permissible value list is dynamic or static.

  • customAllowed:

    Specifies if a custom value is allowed during user input in this field.

  • dependencies:

    Specifies the list of fields that the current field depends on.

state

Provides a structure for defining the state of a content construct, for example {@link LayoutSection}. The element state identifies the field paths in the client data context upon which that element state depends. For example, the callback facet result indicates that facet evaluation must be delegated to the server of the object. This evaluation may be dependent on data collected in the client data context. For example, for a unique machine name, the evaluation requires the proposed name entered by the user.

dependencies

Contains the set of field paths on which the server-side evaluation of the facets depends:

  • facets:

    Provides a higher level view of an {@link Constraint} collection and its current values. All rendering code should use this class to provide a common place to get the current state of the field.

    If a field is considered in need of server-side evaluation, its facets setting is callback.

    If a field is considered mandatory, its facets setting is mandatory.

  • isMultiValued:

    Specifies if the field is a multi-value field, such as a list field.

    The state provides a higher level view of an {@link Constraint} collection and its current values. Rendering code should use this class to provide a common place to get the current state of the field.

curl Command

The following example command retrieves schema definition information for an Amazon type reservation.

curl --insecure -H "Accept:application/json" 
-H "Authorization: Bearer $token" 
https://$host/reservation-service/api/data-service/schema/Infrastructure.Reservation.Cloud.Amazon/default

JSON Output

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

The schema definition in this example includes 8 extension fields that are supported for the Amazon EC2 type reservation.

{
  "fields": [
    {
      "id": "securityGroups",
      "label": "Security groups",
      "description": "The security groups",
      "dataType": {
        "type": "ref",
        "componentTypeId": "com.mycompany.csp.iaas.blueprint.service",
        "componentId": null,
        "classId": "AmazonSecurityGroup",
        "typeFilter": null,
        "label": "Amazon Security Group"
      },
      "displayAdvice": null,
      "permissibleValues": {
        "type": "dynamic",
        "customAllowed": false,
        "dependencies": [
          "computeResource"
        ]
      },
      "state": {
        "dependencies": [
          
        ],
        "facets": [
          {
            "type": "visible",
            "value": {
              "type": "not",
              "subClause": {
                "type": "expression",
                "operator": {
                  "type": "isDefined"
                },
                "leftOperand": {
                  "type": "path",
                  "path": "VPC"
                }
              }
            }
          },
          {
            "type": "mandatory",
            "value": {
              "type": "not",
              "subClause": {
                "type": "expression",
                "operator": {
                  "type": "isDefined"
                },
                "leftOperand": {
                  "type": "path",
                  "path": "VPC"
                }
              }
            }
          }
        ]
      },
      "isMultiValued": true
    },
    {
      "id": "locations",
      "label": "Locations",
      "description": "The locations",
      "dataType": {
        "type": "ref",
        "componentTypeId": "com.mycompany.csp.iaas.blueprint.service",
        "componentId": null,
        "classId": "AvailabilityZone",
        "typeFilter": null,
        "label": "Availability Zone"
      },
      "displayAdvice": null,
      "permissibleValues": {
        "type": "dynamic",
        "customAllowed": false,
        "dependencies": [
          "computeResource"
        ]
      },
      "state": {
        "dependencies": [
          
        ],
        "facets": [
          {
            "type": "visible",
            "value": {
              "type": "not",
              "subClause": {
                "type": "expression",
                "operator": {
                  "type": "isDefined"
                },
                "leftOperand": {
                  "type": "path",
                  "path": "VPC"
                }
              }
            }
          },
          {
            "type": "mandatory",
            "value": {
              "type": "not",
              "subClause": {
                "type": "expression",
                "operator": {
                  "type": "isDefined"
                },
                "leftOperand": {
                  "type": "path",
                  "path": "VPC"
                }
              }
            }
          }
        ]
      },
      "isMultiValued": true
    },
    {
      "id": "loadBalancers",
      "label": "Load balancers",
      "description": "The load balancers",
      "dataType": {
        "type": "ref",
        "componentTypeId": "com.mycompany.csp.iaas.blueprint.service",
        "componentId": null,
        "classId": "ElasticLoadBalancer",
        "typeFilter": null,
        "label": "Elastic Load Balancer"
      },
      "displayAdvice": null,
      "permissibleValues": {
        "type": "dynamic",
        "customAllowed": false,
        "dependencies": [
          "locations",
          "computeResource"
        ]
      },
      "state": {
        "dependencies": [
          
        ],
        "facets": [
          {
            "type": "visible",
            "value": {
              "type": "not",
              "subClause": {
                "type": "expression",
                "operator": {
                  "type": "isDefined"
                },
                "leftOperand": {
                  "type": "path",
                  "path": "VPC"
                }
              }
            }
          }
        ]
      },
      "isMultiValued": true
    },
    {
      "id": "specificKeyPairs",
      "label": "Specific key pair",
      "description": "The specific key pair",
      "dataType": {
        "type": "ref",
        "componentTypeId": "com.mycompany.csp.iaas.blueprint.service",
        "componentId": null,
        "classId": "KeyPair",
        "typeFilter": null,
        "label": "Key Pair"
      },
      "displayAdvice": null,
      "permissibleValues": {
        "type": "dynamic",
        "customAllowed": false,
        "dependencies": [
          "computeResource",
          "keyPairs"
        ]
      },
      "state": {
        "dependencies": [
          
        ],
        "facets": [
          {
            "type": "visible",
            "value": {
              "type": "and",
              "subClauses": [
                {
                  "type": "expression",
                  "operator": {
                    "type": "isDefined"
                  },
                  "leftOperand": {
                    "type": "path",
                    "path": "keyPairs"
                  }
                },
                {
                  "type": "expression",
                  "operator": {
                    "type": "equals"
                  },
                  "leftOperand": {
                    "type": "constant",
                    "value": {
                      "type": "string",
                      "value": "Specific Key Pair"
                    }
                  },
                  "rightOperand": {
                    "type": "path",
                    "path": "keyPairs"
                  }
                }
              ]
            }
          },
          {
            "type": "mandatory",
            "value": {
              "type": "and",
              "subClauses": [
                {
                  "type": "expression",
                  "operator": {
                    "type": "isDefined"
                  },
                  "leftOperand": {
                    "type": "path",
                    "path": "keyPairs"
                  }
                },
                {
                  "type": "expression",
                  "operator": {
                    "type": "equals"
                  },
                  "leftOperand": {
                    "type": "constant",
                    "value": {
                      "type": "string",
                      "value": "Specific Key Pair"
                    }
                  },
                  "rightOperand": {
                    "type": "path",
                    "path": "keyPairs"
                  }
                }
              ]
            }
          }
        ]
      },
      "isMultiValued": false
    },
    {
      "id": "computeResource",
      "label": "Compute Resource",
      "description": "The compute resource for the reservation",
      "dataType": {
        "type": "ref",
        "componentTypeId": "com.mycompany.csp.iaas.blueprint.service",
        "componentId": null,
        "classId": "ComputeResource",
        "typeFilter": "ReservationTypeId",
        "label": "Compute Resource"
      },
      "displayAdvice": null,
      "permissibleValues": {
        "type": "dynamic",
        "customAllowed": false,
        "dependencies": [
          
        ]
      },
      "state": {
        "dependencies": [
          
        ],
        "facets": [
          {
            "type": "mandatory",
            "value": {
              "type": "constantClause",
              "value": {
                "type": "boolean",
                "value": true
              }
            }
          }
        ]
      },
      "isMultiValued": false
    },
    {
      "id": "VPC",
      "label": "VPC",
      "dataType": {
        "type": "complex",
        "componentTypeId": "com.mycompany.csp.iaas.blueprint.service",
        "componentId": null,
        "classId": "Infrastructure.Reservation.Cloud.Amazon.VPC",
        "typeFilter": null,
        "label": "VPC",
        "schema": {
          "fields": [
            {
              "id": "VPCSubnets",
              "label": "Subnets",
              "description": "The subnets.",
              "dataType": {
                "type": "ref",
                "componentTypeId": "com.mycompany.csp.iaas.blueprint.service",
                "componentId": null,
                "classId": "Subnet",
                "typeFilter": null,
                "label": "Subnet"
              },
              "displayAdvice": null,
              "permissibleValues": {
                "type": "dynamic",
                "customAllowed": false,
                "dependencies": [
                  
                ]
              },
              "state": {
                "dependencies": [
                  
                ],
                "facets": [
                  {
                    "type": "minCardinality",
                    "value": {
                      "type": "constant",
                      "value": {
                        "type": "integer",
                        "value": 1
                      }
                    }
                  },
                  {
                    "type": "mandatory",
                    "value": {
                      "type": "constantClause",
                      "value": {
                        "type": "boolean",
                        "value": true
                      }
                    }
                  }
                ]
              },
              "isMultiValued": true
            },
            {
              "id": "VPCSecurityGroups",
              "label": "Security groups",
              "description": "The security groups",
              "dataType": {
                "type": "ref",
                "componentTypeId": "com.mycompany.csp.iaas.blueprint.service",
                "componentId": null,
                "classId": "AmazonSecurityGroup",
                "typeFilter": null,
                "label": "Amazon Security Group"
              },
              "displayAdvice": null,
              "permissibleValues": {
                "type": "dynamic",
                "customAllowed": false,
                "dependencies": [
                  
                ]
              },
              "state": {
                "dependencies": [
                  
                ],
                "facets": [
                  {
                    "type": "minCardinality",
                    "value": {
                      "type": "constant",
                      "value": {
                        "type": "integer",
                        "value": 1
                      }
                    }
                  },
                  {
                    "type": "mandatory",
                    "value": {
                      "type": "constantClause",
                      "value": {
                        "type": "boolean",
                        "value": true
                      }
                    }
                  }
                ]
              },
              "isMultiValued": true
            },
            {
              "id": "VPCName",
              "label": "VPC Name",
              "description": "The virtual private cloud.",
              "dataType": {
                "type": "ref",
                "componentTypeId": "com.mycompany.csp.iaas.blueprint.service",
                "componentId": null,
                "classId": "VirtualPrivateCloud",
                "typeFilter": null,
                "label": "Virtual Private Cloud"
              },
              "displayAdvice": null,
              "state": {
                "dependencies": [
                  
                ],
                "facets": [
                  {
                    "type": "readOnly",
                    "value": {
                      "type": "constantClause",
                      "value": {
                        "type": "boolean",
                        "value": true
                      }
                    }
                  }
                ]
              },
              "isMultiValued": false
            },
            {
              "id": "VPCLoadBalancers",
              "label": "Load balancers",
              "description": "The load balancers.",
              "dataType": {
                "type": "ref",
                "componentTypeId": "com.mycompany.csp.iaas.blueprint.service",
                "componentId": null,
                "classId": "ElasticLoadBalancer",
                "typeFilter": null,
                "label": "Elastic Load Balancer"
              },
              "displayAdvice": null,
              "permissibleValues": {
                "type": "dynamic",
                "customAllowed": false,
                "dependencies": [
                  "VPCSubnets"
                ]
              },
              "state": {
                "dependencies": [
                  
                ],
                "facets": [
                  
                ]
              },
              "isMultiValued": true
            }
          ]
        }
      },
      "displayAdvice": "DATA_TABLE",
      "permissibleValues": {
        "type": "dynamic",
        "customAllowed": false,
        "dependencies": [
          "computeResource"
        ]
      },
      "state": {
        "dependencies": [
          
        ],
        "facets": [
          {
            "type": "visible",
            "value": {
              "type": "or",
              "subClauses": [
                {
                  "type": "not",
                  "subClause": {
                    "type": "expression",
                    "operator": {
                      "type": "isDefined"
                    },
                    "leftOperand": {
                      "type": "path",
                      "path": "locations"
                    }
                  }
                },
                {
                  "type": "not",
                  "subClause": {
                    "type": "expression",
                    "operator": {
                      "type": "isDefined"
                    },
                    "leftOperand": {
                      "type": "path",
                      "path": "securityGroups"
                    }
                  }
                }
              ]
            }
          },
          {
            "type": "mandatory",
            "value": {
              "type": "or",
              "subClauses": [
                {
                  "type": "not",
                  "subClause": {
                    "type": "expression",
                    "operator": {
                      "type": "isDefined"
                    },
                    "leftOperand": {
                      "type": "path",
                      "path": "locations"
                    }
                  }
                },
                {
                  "type": "not",
                  "subClause": {
                    "type": "expression",
                    "operator": {
                      "type": "isDefined"
                    },
                    "leftOperand": {
                      "type": "path",
                      "path": "securityGroups"
                    }
                  }
                }
              ]
            }
          }
        ]
      },
      "isMultiValued": true
    },
    {
      "id": "machineQuota",
      "label": "Machine Quota",
      "description": "The machine quota for the reservation",
      "dataType": {
        "type": "primitive",
        "typeId": "INTEGER"
      },
      "displayAdvice": null,
      "state": {
        "dependencies": [
          
        ],
        "facets": [
          
        ]
      },
      "isMultiValued": false
    },
    {
      "id": "keyPairs",
      "label": "Key pair",
      "description": "The key pair",
      "dataType": {
        "type": "primitive",
        "typeId": "STRING"
      },
      "displayAdvice": null,
      "permissibleValues": {
        "type": "static",
        "customAllowed": false,
        "values": [
          {
            "underlyingValue": {
              "type": "string",
              "value": "Not Specified"
            },
            "label": null
          },
          {
            "underlyingValue": {
              "type": "string",
              "value": "Per Provisioning Group"
            },
            "label": null
          },
          {
            "underlyingValue": {
              "type": "string",
              "value": "Per Machine"
            },
            "label": null
          },
          {
            "underlyingValue": {
              "type": "string",
              "value": "Specific Key Pair"
            },
            "label": null
          }
        ]
      },
      "state": {
        "dependencies": [
          
        ],
        "facets": [
          {
            "type": "mandatory",
            "value": {
              "type": "constantClause",
              "value": {
                "type": "boolean",
                "value": true
              }
            }
          }
        ]
      },
      "isMultiValued": false
    }
  ]