VMware Cloud Community
NigelHarris
Contributor
Contributor
Jump to solution

getEntityByReference VApp Metadata

I'm have a workflow that is initated by Christophe's 'workflow runner'.  The workflow I am writing needs to update the metadata of a vApp before resuming the blockingtask.

I've got some code that shows me I have an object to the metadata

[2012-04-11 18:39:04.052] [I] Metadata :DynamicWrapper (Instance) : [VclMetadata]-[class com.vmware.vmo.plugin.vcloud.model.Metadata] -- VALUE : com.vmware.vmo.plugin.vcloud.model.Metadata@c83b3f9

but I am unsure how to read or update this object using the getEntitybyReference or getEntityByID methods.  

The API documentation shows that there is getEntries() method for metadata that returns a vclmap object.  But I can't deduce from the documentation an approrpiate way to use getEntitybyReference or getEntityByID methods to read or update vApp metadata

Help please  ; ))

thanks,

Reply
0 Kudos
1 Solution

Accepted Solutions
cdecanini_
VMware Employee
VMware Employee
Jump to solution

Try this:

var metadata = vApp.getMetadata();
var entries = metadata.getEntries();
System.log("returning key " + key);
return entries.get(key);

Christophe.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter

View solution in original post

Reply
0 Kudos
1 Reply
cdecanini_
VMware Employee
VMware Employee
Jump to solution

Try this:

var metadata = vApp.getMetadata();
var entries = metadata.getEntries();
System.log("returning key " + key);
return entries.get(key);

Christophe.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Reply
0 Kudos