Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

Get all vApps from vDC using orchestrator vCloud plugin and vDC ID as input (URN format)

$
0
0

Hi,

 

I am a newbie in orchestration and now stuck on a problem. I use vCloud plugin and want to get all vApps from specific vDC, then suspend them and disable vDC. Firstly, I should have a vDC ID in URN format as input, e.g. urn:vcloud:vdc:96204229-860b-41c2-ab91-7b8bd3f4c174. However, I cannot find any method in API library to get all vApps from vDC using vDC ID URN format for input, therefore for now I have this script:

 

var cloudOrgs = System.getModule("com.vmware.library.vCloud.operation").getOrganizationsVCloudHost(vcloud_server);

 

for (var i in cloudOrgs) {

  var orgVdcs = System.getModule("com.vmware.library.vCloud.operation").getVdcsOrg(cloudOrgs[i]);

  System.log(orgVdcs);

  for (var j in orgVdcs) {

     var vDCvApps = System.getModule("com.vmware.library.vCloud.operation").getVAppsVdc(orgVdcs[j]);

     }

}

 

System.log prints output of vDCs like this:

DynamicWrapper (Instance) : [VclVdc]-[class com.vmware.vmo.plugin.vcloud.model.Vdc] -- VALUE : com.vmware.vmo.plugin.vcloud.model.Vdc@97eccd50


Tried this:

System.log(orgVdcs.Vdc.id)

Got output: TypeError: Cannot read property "id" from undefined

 

How can I get vDC ID in URN format from this output?


Viewing all articles
Browse latest Browse all 6251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>