You can use the REST API reservation service to obtain compute resources for vRealize Automation reservations.

Prerequisites

  • 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.

When you create a reservation, you must provide compute resource information that corresponds to the computeResource parameter.

For example, for a vSphere, Amazon EC2, or vCloud reservation type schema definition, the following permissibleValues field in the compute resource output indicates if the compute resource is available and if it has any dependencies.

“permissibleValues": {"type": "dynamic","customAllowed": false, "dependencies": []} 

Procedure

Use the following command to get a compute resource.

Command to get a compute resource for vSphere reservation.

curl --insecure -H "Accept:application/json" 
-H "Authorization: Bearer $token" 
https://$host/reservation-service/api/data-service/schema/Infrastructure.Reservation.Virtual.vSphere/default/computeResource/values  -d “{}”

Command to get a compute resource for an Amazon EC2 reservation.

curl --insecure -H "Accept:application/json" 
-H "Authorization: Bearer $token" 
https://$host/reservation-service/api/data-service/schema/Infrastructure.Reservation.Cloud.Amazon/default/computeResource/values  -d “{}”
Example: curl Command for a vCloud reservation

Command to get a compute resource for a vCloud reservation.

curl --insecure -H "Accept:application/json" 
-H "Authorization: Bearer $token" 
https://$host/reservation-service/api/data-service/schema/Infrastructure.Reservation.Cloud.vCloud/default/computeResource/values  -d “{}”

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

JSON Output for a vSphere Reservation

{
  "values": [{
    "underlyingValue": {
      "type": "entityRef",
      "componentId": null,
      "classId": "ComputeResource",
      "id": "047e00f5-5424-4ed2-a751-4a334aeaff54",
      "label": "VC51-Cluster"
    },
    "label": "VC51-Cluster"
  },
  {
    "underlyingValue": {
      "type": "entityRef",
      "componentId": null,
      "classId": "ComputeResource",
      "id": "a4349488-9a56-4906-83a5-7d8b33c9d435",
      "label": "NSX61-RC-ManagementCluster"
    },
    "label": "NSX61-RC-ManagementCluster"
  },
  {
    "underlyingValue": {
      "type": "entityRef",
      "componentId": null,
      "classId": "ComputeResource",
      "id": "40b151ce-e409-4d2a-8dae-bb456139a660",
      "label": "NSX61-RC-ComputeClusterB"
    },
    "label": "NSX61-RC-ComputeClusterB"
  },
  {
    "underlyingValue": {
      "type": "entityRef",
      "componentId": null,
      "classId": "ComputeResource",
      "id": "cc254a84-95b8-434a-874d-bdfef8e8ad2c",
      "label": "NSX61-RC-ComputeClusterA"
    },
    "label": "NSX61-RC-ComputeClusterA"
  }]
}

JSON output for an Amazon EC2 Reservation

{
  "values": [
    {
      "underlyingValue": {
        "type": "entityRef",
        "componentId": null,
        "classId": "ComputeResource",
        "id": "fdfa4b95-9476-4c18-81c5-1c0e5cb1131f",
        "label": "EC2 841 Endpoint-us-west-1"
      },
      "label": "EC2 841 Endpoint-us-west-1"
    },
    {
      "underlyingValue": {
        "type": "entityRef",
        "componentId": null,
        "classId": "ComputeResource",
        "id": "4e362590-b634-4269-9da4-548260148fa3",
        "label": "EC2 841 Endpoint-us-west-2"
      },
      "label": "EC2 841 Endpoint-us-west-2"
    },
    {
      "underlyingValue": {
        "type": "entityRef",
        "componentId": null,
        "classId": "ComputeResource",
        "id": "9d1a3b5a-7162-4a5a-85b7-ec1b2824f554",
        "label": "EC2 841 Endpoint-us-east-1"
      },
      "label": "EC2 841 Endpoint-us-east-1"
    }
  ]
} 

JSON output for a vCloud Reservation

{
  "values": [
    {
      "underlyingValue": {
        "type": "entityRef",
        "componentId": null,
        "classId": "ComputeResource",
        "id": "c527a0f5-b1ae-4b61-8145-ad9d5c434dc7",
        "label": "Engineering Allocation VDC"
      },
      "label": "Engineering Allocation VDC"
    }
  ]
}