VMware Cloud Community
OfekH
Contributor
Contributor

Issue gathering information from Reservation Policy object

Hi There,

I'm trying to create a flow that gets a reservation policy name and a network label as inputs,

and the output should be the free storage space and memory from the relevant reservation.

For some reason, after i use

var respolobj = Server.findAllForType("vCACCAFE:ReservationPolicy");

It does load the reservations policies to the variable but trying to print each one's properties or executing void methods fails:

System.log(respolobj[0].getVersion() + respolobj[1].getId());

var respolid = respolobj.id;

System.log("id is " + respolid);

The errors in the logs are

[2019-05-27 16:51:46.961] [I] 1

[2019-05-27 16:51:46.965] [I] id isundefined

[2019-05-27 16:51:46.968] [E] Unable to create object : _vCACCAFEEntitiesFinder : Class ch.dunes.vso.sdk.DynamicWrapper can not access a member of class com.vmware.o11n.plugin.vcac.model.inventory.EntitiesFinder with modifiers "private"

[2019-05-27 16:51:46.996] [E] Workflow execution stack:

***

item: 'XXXXXXXX/item1', state: 'failed', business state: 'null', exception: 'Unable to create object : _vCACCAFEEntitiesFinder : Class ch.dunes.vso.sdk.DynamicWrapper can not access a member of class com.vmware.o11n.plugin.vcac.model.inventory.EntitiesFinder with modifiers "private"'

workflow: 'XXXXXXX (01784750-39a1-4867-8499-5d5e5a433a7d)

|  'attribute': name=vCACHost type=vCAC:VCACHost value=dunes://service.dunes.ch/CustomSDKObject?id='d8e6fb43-3f0b-4f71-b0d5-e2193f09ad86'&dunesName='vCAC:VCACHost'

|  'input': name=respol type=string value=RESPOL

|  'input': name=network type=string value=

|  'no outputs'

*** End of execution stack.

Is anyone has an advice/ workaround /  good alternative for getting this information?

Thank you in advance!

0 Kudos
1 Reply
iiliev
VMware Employee
VMware Employee

Hi,

You are getting 'id is undefined' because the expression respolobj.id tries to fetch the id property from the array respolobj, and usually arrays do not have an id themselves.

0 Kudos