I am trying to figure out how to get an object using href for vCloud Director, using the vCD plugin.
A sample for href is below:
href = "https://10.70.2.11/api/v1.0/vApp/vapp-a917163a-f5bc-424e-9c43-82025ff7d2bf";
I am trying to use the VclHost->getEntityByReference() to do this, the piece I am missing is how to create the VclReference object?
Thanks,
-Soheil
You need to create the object:
var myVclReference = new VclReference();
myVclReference.href = href;
myVclReference.name = "test"
myVclReference.type = "application/vnd.vmware.vcloud.vApp+xml";
vApp = vcdHost.getEntityByReference("vcloud:vapp",myVclReference);
Christophe.
When I use the constructor in the answer I get error:
[2011-10-11 13:29:59.260] [I] Unable to create object : VclReference : com.vmware.vmo.plugin.vcloud.model.Reference
Also the attributes for VclReference are marked as read-only. I used the following constructor to create the VclReference and printed the attributes to make sure they were set properly.
The call to get vapp fails and returns a null pointer for the vApp:
vapp = vcd.getEntityByReference("vcloud:vapp", myVclReference);
System.log (vapp.getReference().name);
I can walk the inventory tree and find the vApp using the href above. What is the next step in debugging this?
-Soheil