You can use the REST API reservation service to display a schema definition for a specific vRealize Automation reservation type, for example a vSphere 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.

表 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 vSphere reservation types field IDs that appear in the output schema definitions.

表 2. Extension Fields Supported in vSphere Reservations

Field ID

Data Type

Type Class

Permissible Value

Depends on Field

reservationNetworks

Complex Type

reservationNetwork

Yes

computeResource

reservationVCNSTransportZone

Entity Reference

NetworkScopes

Yes

computeResource

reservationVCNSSecurityGroups

Entity Reference

SecurityGroups

Yes

computeResource

reservationMemory

Complex Type

reservationMemory

Yes

computeResource

computeResource

Entity Reference

ComputeResource

Yes

NA

machineQuota

Integer

N/A

No

NA

reservationStorages

Complex Type

reservationStorage

Yes

computeResource

resourcePool

Entity Reference

ResourcePools

Yes

computeResource

reservationVCNSRoutedGateways

Complex Type

reservationVCNSRoutedGateway

Yes

computeResource

注:

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 a vSphere reservation is Infrastructure.Reservation.Virtual.vSphere.

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 vRealize Automation API 参考 in the vRealize Automation documentation center.

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

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

JSON Output

The schema definition in this example includes 9 extension fields that are supported for the vSphere type reservation.

{
  "fields": [{
    "id": "reservationNetworks",
    "label": "Network",
    "dataType": {
      "type": "complex",
      "componentTypeId": "com.mycompany.csp.iaas.blueprint.service",
      "componentId": null,
      "classId": "reservationNetwork",
      "typeFilter": null,
      "label": "Network"
    },
    "displayAdvice": "DATA_TABLE",
    "permissibleValues": {
      "type": "dynamic",
      "customAllowed": false,
      "dependencies": ["computeResource"]
    },
    "state": {
      "dependencies": [],
      "facets": [{
        "type": "mandatory",
        "value": {
          "type": "constantClause",
          "value": {
            "type": "boolean",
            "value": true
          }
        }
      }]
    },
    "isMultiValued": true
  },
  {
    "id": "reservationVCNSTransportZone",
    "label": "Transport Zone",
    "description": "Transport zone of the vCNS settings",
    "dataType": {
      "type": "ref",
      "componentTypeId": "com.mycompany.csp.iaas.blueprint.service",
      "componentId": null,
      "classId": "NetworkScopes",
      "typeFilter": null,
      "label": "Transport Zone"
    },
    "displayAdvice": null,
    "permissibleValues": {
      "type": "dynamic",
      "customAllowed": false,
      "dependencies": ["computeResource"]
    },
    "state": {
      "dependencies": [],
      "facets": []
    },
    "isMultiValued": false
  },
  {
    "id": "reservationVCNSSecurityGroups",
    "label": "Security Groups",
    "description": "Security groups of the vCNS settings",
    "dataType": {
      "type": "ref",
      "componentTypeId": "com.mycompany.csp.iaas.blueprint.service",
      "componentId": null,
      "classId": "SecurityGroups",
      "typeFilter": null,
      "label": "Security Group"
    },
    "displayAdvice": null,
    "permissibleValues": {
      "type": "dynamic",
      "customAllowed": false,
      "dependencies": ["computeResource"]
    },
    "state": {
      "dependencies": [],
      "facets": []
    },
    "isMultiValued": true
  },
  {
    "id": "reservationMemory",
    "label": "Memory",
    "dataType": {
      "type": "complex",
      "componentTypeId": "com.mycompany.csp.iaas.blueprint.service",
      "componentId": null,
      "classId": "reservationMemory",
      "typeFilter": null,
      "label": "Memory"
    },
    "displayAdvice": "DATA_TABLE",
    "permissibleValues": {
      "type": "dynamic",
      "customAllowed": false,
      "dependencies": ["computeResource"]
    },
    "state": {
      "dependencies": [],
      "facets": [{
        "type": "mandatory",
        "value": {
          "type": "constantClause",
          "value": {
            "type": "boolean",
            "value": true
          }
        }
      }]
    },
    "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": "InterfaceTypeId",
      "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": "machineQuota",
    "label": "Machine Quota",
    "description": "The machine quota for the reservation",
    "dataType": {
      "type": "primitive",
      "typeId": "INTEGER"
    },
    "displayAdvice": null,
    "state": {
      "dependencies": [],
      "facets": []
    },
    "isMultiValued": false
  },
  {
    "id": "reservationStorages",
    "label": "Storage",
    "dataType": {
      "type": "complex",
      "componentTypeId": "com.mycompany.csp.iaas.blueprint.service",
      "componentId": null,
      "classId": "reservationStorage",
      "typeFilter": null,
      "label": "Storage"
    },
    "displayAdvice": "DATA_TABLE",
    "permissibleValues": {
      "type": "dynamic",
      "customAllowed": false,
      "dependencies": ["computeResource"]
    },
    "state": {
      "dependencies": [],
      "facets": [{
        "type": "mandatory",
        "value": {
          "type": "constantClause",
          "value": {
            "type": "boolean",
            "value": true
          }
        }
      }]
    },
    "isMultiValued": true
  },
  {
    "id": "resourcePool",
    "label": "Resource Pool",
    "description": "The resource pool for the reservation",
    "dataType": {
      "type": "ref",
      "componentTypeId": "com.mycompany.csp.iaas.blueprint.service",
      "componentId": null,
      "classId": "ResourcePools",
      "typeFilter": null,
      "label": "Resource Pool"
    },
    "displayAdvice": null,
    "permissibleValues": {
      "type": "dynamic",
      "customAllowed": false,
      "dependencies": ["computeResource"]
    },
    "state": {
      "dependencies": [],
      "facets": []
    },
    "isMultiValued": false
  },
  {
    "id": "reservationVCNSRoutedGateways",
    "label": "Routed Gateways",
    "dataType": {
      "type": "complex",
      "componentTypeId": "com.mycompany.csp.iaas.blueprint.service",
      "componentId": null,
      "classId": "reservationVCNSRoutedGateway",
      "typeFilter": null,
      "label": "Routed Gateways"
    },
    "displayAdvice": "DATA_TABLE",
    "permissibleValues": {
      "type": "dynamic",
      "customAllowed": false,
      "dependencies": ["computeResource"]
    },
    "state": {
      "dependencies": [],
      "facets": []
    },
    "isMultiValued": true
  }]
}