Have been trying to figure this out for a while and can not. The end goal is to get the networks for a reservation to tie into our IPAM. I have found several solutions and they rely on either getReservations or gerAllReservations. Each of these errors out for me. I THINK it may be a permissions issue? I get a 403 on the 3rd example but not alot of information.
I used vRealize Suite Lifecycle Manager (vRSLCM) to deploy this FWIW.
This works:var vcaccafeHost = vCACCAFEHostManager.getDefaultHostForTenant("vsphere.local", true);
var businessGroups = vCACCAFEEntitiesFinder.getBusinessGroups(vcaccafeHost);
for each(var bus in businessGroups){
System.log(bus.getName());
}
LOG:
[2018-12-18 14:15:02.513] [I] ISSS
[2018-12-18 14:15:02.516] [I] Configuration Administrators
This does not work:
var vcaccafeHost = vCACCAFEHostManager.getDefaultHostForTenant("vsphere.local", true);
var reservations = vCACCAFEEntitiesFinder.getReservations(vcaccafeHost);
for each(var res in reservations){
System.log(res.getName());
}
LOG:
[2018-12-18 14:16:14.500] [E] Error in (Workflow:Get Networks for Reservation / Scriptable task (item1)#17) java.lang.reflect.InvocationTargetException
[2018-12-18 14:16:14.515] [E] Workflow execution stack:
***
item: 'Get Networks for Reservation/item1', state: 'failed', business state: 'null', exception: 'java.lang.reflect.InvocationTargetException (Workflow:Get Networks for Reservation / Scriptable task (item1)#17)'
workflow: 'Get Networks for Reservation' (2719ea9c-f8db-46a9-827f-d70e67b6a79c)
| 'no inputs'
| 'no outputs'
| 'no attributes'
*** End of execution stack.
This does not work:
var vcaccafeHost = vCACCAFEHostManager.getDefaultHostForTenant("vsphere.local", true);
var reservationClient = vcaccafeHost.createReservationClient();
var reservationService = reservationClient.getReservationReservationService();
System.log(reservationService);
var tenantReservationPagedResources = reservationService.getAllReservations();
LOG:
[2018-12-18 14:18:37.035] [I] DynamicWrapper (Instance) : [vCACCAFEReservationReservationService]-[class com.vmware.o11n.plugin.vcac.model.cafe.service.ReservationReservationService] -- VALUE : com.vmware.o11n.plugin.vcac.model.cafe.service.ReservationReservationService@708603fa
[2018-12-18 14:18:37.056] [E] Error in (Workflow:Get Networks for Reservation / Scriptable task (item1)#6) 403
[2018-12-18 14:18:37.077] [E] Workflow execution stack:
***
item: 'Get Networks for Reservation/item1', state: 'failed', business state: 'null', exception: '403 (Workflow:Get Networks for Reservation / Scriptable task (item1)#6)'
workflow: 'Get Networks for Reservation' (2719ea9c-f8db-46a9-827f-d70e67b6a79c)
| 'no inputs'
| 'no outputs'
| 'no attributes'
*** End of execution stack.