7.2

Table Of Contents
"metadata": {
"size": 0,
"totalElements": 2,
"totalPages": 1,
"number": 1,
"offset": 0
}
}
Create a Reservation Policy
You can use the REST API reservation service to create a reservation policy.
For information about available command input and output parameters, see “Syntax for Creating a
Reservation Policy,” on page 268.
Prerequisites
n
Log in to vRealize Automation as a fabric group administrator.
n
Verify that the host name and fully qualied domain name of the vRealize Automation instance are
available.
n
Verify that you have a valid HTTP bearer token that matches your login credentials. See Chapter 2,
“REST API Authentication,” on page 9.
n
List existing reservation policies to create the sample output required for creating a new reservation
policy. See “List Reservation Policies,” on page 265.
Procedure
u
Use the reservation service to create a reservation policy as shown in the following sample command.
curl --insecure -H "Accept:application/json"
-H "Authorization: Bearer $token"
https://$host/reservation-service/api/reservations/policies -d “
{
"name": "ABXReservationPolicyTest",
"description": "ABXReservationPolicyDescTest",
"reservationPolicyTypeId": "Infrastructure.Reservation.Policy.ComputeResource"
}
The command output contains the new reservation policy ID, for example
5fd2de36-659f-4beb-97af-77d683feb697.
Location:
https://$host/reservation-
service/api/reservations/policies/5fd2de36-659f-4beb-97af-77d683feb697
Syntax for Creating a Reservation Policy
You can use the REST API reservation service to create a reservation policy.
Input
Use the supported input parameters to control the command output.
Parameter Description
URL hps://$host/reservation-service/api/reservations/policies
Method Post
Programming Guide
268 VMware, Inc.