VMware Cloud Community
abergman89
Contributor
Contributor
Jump to solution

getOrganization by name

Is there any way to get an organization or VDC from inside a workflow using only the name?

I've found actions to get Org from vApp or media, but not by just using the name.

I want to update a VDC, and I need to pass the name and organization to the workflow via the Soap API, and i guess I need to know the VDC or Organization ID as input to the Update VDC workflow.

Any ideas on how to accomplish this? I have Organization name and the VDC name.

0 Kudos
1 Solution

Accepted Solutions
Burke-
VMware Employee
VMware Employee
Jump to solution

Check my post in this thread for an example using the query service:

http://communities.vmware.com/message/2136092#2136092 <- this example returns all vDCs in an array ... I'll find the other example that does a get by name...

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 vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter

View solution in original post

0 Kudos
4 Replies
thomas_root1
Enthusiast
Enthusiast
Jump to solution

Yes, but you need to specify the vcloud-host, too.

You can try this:

var host = VclHostManager.getHostbyUrl("Your host URL");

//get Organization by bame
var myOrg;
for each (var org in host.getOrganizations())
{
     if(org.name == "Your Org name")
     {
         myOrg = org;
         break;
     }
}


//get vDC by name
var myOrg;
for each ( var vdc in myOrg.getVdcs())
{
    if (vdc.name == "Your vDC name")
    {
        myVdc = vdc;
        break;
    }
}

But in big environments it's better to use the query service.

Regards

Thomas

Burke-
VMware Employee
VMware Employee
Jump to solution

Check my post in this thread for an example using the query service:

http://communities.vmware.com/message/2136092#2136092 <- this example returns all vDCs in an array ... I'll find the other example that does a get by name...

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 vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
0 Kudos
Burke-
VMware Employee
VMware Employee
Jump to solution

Yes, here it is: http://communities.vmware.com/message/2132742#2132742

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 vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
0 Kudos
abergman89
Contributor
Contributor
Jump to solution

Thx everyone for your input, Burkes first post worked with some minor tweaks (just return one VDC instead of an array).

0 Kudos