sean_gadson
Enthusiast
Enthusiast

Reservations By Reservation Policy

Jump to solution

Hello,

is there a way to get what reservations are apart of a reservation policy ID? For example:

Reservation Policy X is linked to Reservation Y, Z, T

I would prefer the CAFE but if I have to use the vCAC end point then I will go with that

1 Solution

Accepted Solutions
qc4vmware
Virtuoso
Virtuoso

var reservationService = host.createReservationClient().getReservationReservationService();

var reservations = [];

var reservationFilter = getReservationFilterForPolicyId(policyId);

reservations = reservationService.getAllReservations(reservationFilter).getContent();

return reservations;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function getReservationFilterForPolicyId(policyId) {

var query = new vCACCAFEOdataQuery();

var reservationPolicyIdParam = vCACCAFEFilterParam.equal("reservationPolicyId" , vCACCAFEFilterParam.string(policyId));

var queryParams = [reservationPolicyIdParam];

query.addFilter(queryParams);

return new vCACCAFEPageOdataRequest(1 , 100000, query);

}

View solution in original post

2 Replies
qc4vmware
Virtuoso
Virtuoso

var reservationService = host.createReservationClient().getReservationReservationService();

var reservations = [];

var reservationFilter = getReservationFilterForPolicyId(policyId);

reservations = reservationService.getAllReservations(reservationFilter).getContent();

return reservations;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function getReservationFilterForPolicyId(policyId) {

var query = new vCACCAFEOdataQuery();

var reservationPolicyIdParam = vCACCAFEFilterParam.equal("reservationPolicyId" , vCACCAFEFilterParam.string(policyId));

var queryParams = [reservationPolicyIdParam];

query.addFilter(queryParams);

return new vCACCAFEPageOdataRequest(1 , 100000, query);

}

View solution in original post

sean_gadson
Enthusiast
Enthusiast

This worked thank you very much!