Syntax for Updating a Reservation
PUT /api/reservations/{id} updates an existing reservation with a given ID.
Input
Use the supported input parameters to control the command output.
Parameter | Description |
---|---|
URL | https://$vRA/reservation-service/api/reservations/$reservationId |
Method | Put |
$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. |
$reservationId | Specifies the unique identifier of the reservation to update. For information about how to obtain the reservation ID, see Syntax for Displaying a List of Reservations. |
HTTP body |
Contains the JSON information for the reservation, including the updated data for the parameters that you want to update. Most of this JSON string information is obtained by displaying the existing details of the $reservationId. See Syntax for Verifying a Reservation and Getting Reservation Details. The rest of the JSON string information is obtained by using an API command to get the ID of the parameter you want to update. For example, to update the reservation to use a different compute resource than the one currently specified, replace the computeResource value of the exiting reservation with a new computeResource value in the command's HTTP input. |
Output
If the command is successful, the HTTP response body is empty except for a 204 No Content status statement.
curl Command
The following example command updates the reservation with an ID of 94d74105-831a-4598-8f42-efd590fea15c to use compute resource ID 047e00f5-5424-4ed2-a751-4a334aeaff54.
curl –X PUT --insecure -H "Accept:application/json" -H "Authorization: Bearer $token" https://$vRA/reservation-service/api/reservations/94d74105-831a-4598-8f42-efd590fea15c –d “ { "name": "TestReservation", "reservationTypeId": "Infrastructure.Reservation.Virtual.vSphere", "tenantId": "qe", "subTenantId": "ef58f604-528d-4441-a219-4725bead629b", "enabled": true, "priority": 3, "reservationPolicyId": "b71c3a5f-087a-4d9e-9a56-fab785a3d128", "alertPolicy": { "enabled": true, "frequencyReminder": 20, "emailBgMgr": false, "recipients": ["[email protected]", "[email protected]"], "alerts": [{ "alertPercentLevel": 10, "referenceResourceId": "storage", "id": "storage" }, { "alertPercentLevel": 20, "referenceResourceId": "memory", "id": "memory" }, { "alertPercentLevel": 30, "referenceResourceId": "cpu", "id": "cpu" }, { "alertPercentLevel": 40, "referenceResourceId": "machine", "id": "machine" }] }, "extensionData": { "entries": [{ "key": "key4", "value": { "type": "string", "value": "custom-property-value4" } }, { "key": "key3", "value": { "type": "string", "value": "custom-property-value3" } }, { "key": "reservationNetworks", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [{ "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "reservationNetwork", "typeFilter": null, "values": { "entries": [{ "key": "reservationNetworkProfile", "value": { "type": "entityRef", "componentId": null, "classId": "NetworkProfile", "id": "ed5d1503-08ac-42ca-804d-9167834a63a5", "label": "TestNetworkProfile" } }, { "key": "reservationNetworkPath", "value": { "type": "entityRef", "componentId": null, "classId": "Network", "id": "44cb65d5-b321-43dd-a2ab-8ecf387bff8f", "label": "VM Network SQA" } }] } }] } }, { "key": "key0", "value": { "type": "string", "value": "custom-property-value0" } }, { "key": "key2", "value": { "type": "string", "value": "custom-property-value2" } }, { "key": "reservationMemory", "value": { "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "reservationMemory", "typeFilter": null, "values": { "entries": [{ "key": "hostMemoryTotalSizeMB", "value": { "type": "integer", "value": 57187 } }, { "key": "reservationMemoryReservedSizeMb", "value": { "type": "integer", "value": 15888 } }] } } }, { "key": "key1", "value": { "type": "string", "value": "custom-property-value-Updated" } }, { "key": "computeResource", "value": { "type": "entityRef", "componentId": null, "classId": "ComputeResource", "id": "047e00f5-5424-4ed2-a751-4a334aeaff54", "label": "VC51-Cluster" } }, { "key": "machineQuota", "value": { "type": "integer", "value": 2 } }, { "key": "reservationStorages", "value": { "type": "multiple", "elementTypeId": "COMPLEX", "items": [{ "type": "complex", "componentTypeId": "com.mycompany.csp.iaas.blueprint.service", "componentId": null, "classId": "reservationStorage", "typeFilter": null, "values": { "entries": [{ "key": "storageTotalSizeGB", "value": { "type": "integer", "value": 394 } }, { "key": "reservationStorageReservedSizeGB", "value": { "type": "integer", "value": 31 } }, { "key": "reservationStorageEnabled", "value": { "type": "boolean", "value": true } }, { "key": "reservationStoragePath", "value": { "type": "entityRef", "componentId": null, "classId": "StoragePath", "id": "f48a527b-30a6-4d54-8829-f549bc195b69", "label": "VNXe:qe-vnxe-nfs-1" } }, { "key": "storageFreeSizeGB", "value": { "type": "integer", "value": 120 } }, { "key": "reservationStorageReservationPriority", "value": { "type": "integer", "value": 1 } }] } }] } }, { "key": "resourcePool", "value": { "type": "entityRef", "componentId": null, "classId": "ResourcePools", "id": "4e51fabc-19e8-4e79-b413-d52309b3bb62", "label": "CoreDev" } }] } } ”
JSON Output
If the command is successful, the HTTP response body is empty except for a 204 No Content status statement.