Create an Amazon Reservation

You can use the reservation service to create an Amazon reservation.

Prerequisites

In addition to the Prerequisites, perform the following tasks before creating a reservation.

Procedure

Create an Amazon reservation.
curl --insecure -H "Accept:application/json" 
-H "Authorization: Bearer $token" 
https://$vRA/reservation-service/api/reservations -d “
{
  "name": "TestEC2Reservation",
  "reservationTypeId": "Infrastructure.Reservation.Cloud.Amazon",
  "tenantId": "qe",
  "subTenantId": "a5d056be-3aa2-4fdd-ba1e-a3805f26f0e0",
  "enabled": true,
  "priority": 1,
  "reservationPolicyId": "34d2a612-718e-4814-96c5-225f7f5615a6",
  "alertPolicy": {
    "enabled": false,
    "frequencyReminder": 0,
    "emailBgMgr": true,
    "recipients": [
      
    ],
    "alerts": [
      {
        "alertPercentLevel": 80,
        "referenceResourceId": "machine",
        "id": "machine"
      }
    ]
  },
  "extensionData": {
    "entries": [
      {
        "key": "computeResource",
        "value": {
          "type": "entityRef",
          "componentId": null,
          "classId": "ComputeResource",
          "id": "9d1a3b5a-7162-4a5a-85b7-ec1b2824f554",
          "label": "EC2 841 Endpoint-us-east-1"
        }
      },
      {
        "key": "machineQuota",
        "value": {
          "type": "integer",
          "value": 0
        }
      },
      {
        "key": "securityGroups",
        "value": {
          "type": "multiple",
          "elementTypeId": "ENTITY_REFERENCE",
          "items": [
            {
              "type": "entityRef",
              "componentId": null,
              "classId": "AmazonSecurityGroup",
              "id": "10",
              "label": "default"
            }
          ]
        }
      },
      {
        "key": "loadBalancers",
        "value": {
          "type": "multiple",
          "elementTypeId": "ENTITY_REFERENCE",
          "items": [
            {
              "type": "entityRef",
              "componentId": null,
              "classId": "ElasticLoadBalancer",
              "id": "3",
              "label": "test1"
            }
          ]
        }
      },
      {
        "key": "locations",
        "value": {
          "type": "multiple",
          "elementTypeId": "ENTITY_REFERENCE",
          "items": [
            {
              "type": "entityRef",
              "componentId": null,
              "classId": "AvailabilityZone",
              "id": "10",
              "label": "us-east-1a"
            }
          ]
        }
      },
      {
        "key": "keyPairs",
        "value": {
          "type": "string",
          "value": "Per Provisioning Group"
        }
      }
    ]
  }
}”

Example: Create an Amazon Reservation

The output is a sample location URL, including the new Amazon reservation ID.
Location: https://$vRA/reservation-service/api/reservations/3289b039-2a11-4ab4-a0bc-b583e4c6d085