1 person found this helpful
Use https://whatever.whatever/api/admin/extension/orgNetworks/query to build a list of org networks. For each AdminOrgNetworkRecord returned this gives you the 'OrgName' and the 'linkNetworkName' (external network).
For each AdminOrgNetworkRecord returned, issue a GET against the 'href' (of the form https://whatever.whatever/api/network/04f98e5b-90bb-493c-9e0d-7e9e154f0f7e). In the returned XML, look for
Does that give you what you want?
thanks for your reply.
I used the https://whatever.whatever/api/admin/extension/orgNetworks/query and received the list you told. After that I used the href URL via GET, but the followed XML did not included any "AllowedExternalIpAddresses" or something like that (https:///bla.bla/api/network/47add117-877f-46a9-ae9c-59f2ce93bdf4).
The only item which nearly converges with that point is "type="application/vnd.vmware.vcloud.allocatedNetworkAddress+xml" at the final xml.
I'm working with the vCloud .NET SDK. Maybe it is easier with the SDK.
Hmmm... not sure I can be of much further use.
I'm coding directly against the API, not using an SDK. I also tend to use the Firefox RESTClient plugin to experiment.
You should be getting back an '<OrgNetwork ...>' XML record when you issue the GET request against the 'href' ??
Given the name, 'AllowedExternalIpAddresses', I guess it's possible that nothing is listed unless you've configured a NAT rule using one of your IP assignments.
I'm getting an "OrgVdcNetwork" object.
For testing purposes, I'm using the RESTClient browser plugin, too.
Just to get it clearly: I take the "href URL" from the "AdminOrgNetworkRecord" object. After that, I issue an GET request against the URL. As a result I get an "OrgVdcNetwork" object (also of Orgs, which definitely have at least two ext assigned IPs).
This was something I recently had looked into after a colleague had asked about it.
The eaiest way IMHO is to use the vCloud API Query Service (http://blogs.vmware.com/vsphere/2012/04/quickly-finding-objects-using-the-vcloud-api-query-service.html)
Here's a screenshot of an External Network called "Ext-Network-1" for a VCD 5.1 deployment
Step 1 - Perform a GET on the following URL: https://[VCD-IP]/api/query?type=externalNetwork
Step 2 - This should return a list of NetworkRecords which will be your available external networks, here's a screenshot using FF RestClient
Step 3 - Once you have identified the "name" property of your External Network, you will need to do a GET on it's HREF
Step 4 - From here, you can clearly see the current IP Range as well as the allocated IP Addresses
If you want more details on the allocated IP Addresses, you'll see in the "Link" there is /allocatedAddresses that you can perform a GET on that URL which will give you further details
Hopefully this helps you get what you're looking
Ah. I'm still using the vCloud Director 1.5 API. I think that's probably where the difference comes from.
I don't have a 1.5 enviroment ... but the External Network query should be the same. In VCD 5.1
Thanks a lot lamw, that was the answer which solved my "issue".
I will look more attentively through the query service so I dont have to ask such questions anymore
Great to hear! The vCloud Query Service API is very powerful!
I'm trying to to do the exact same thing the OP has attempted (obviously years ago).
I'm able to authenticate with the API and send the GET for " https://my.vcd.cells/api/query?type=externalNetwork ", but for some reason I seem to be only getting a subset of the External Networks in my environment.
Any ideas what I'm doing wrong?
It's worth noting that until half an hour I had never even authenticated with the vCD API, let alone obtained any useful information using it.
I'm running vCD 9.1 and using version 30 of the API.
I have 39 external networks in vCD. My XML output for the GET only lists 25 networks.