VMware Cloud Community
rlmitchell
Contributor
Contributor

Mapping external network ip to internal network ip with vcd java sdk?

Greetings,

Does anyone know how to map external network ip addresses to internal network ip addresses via the vCloud Director Java SDK?   I have not been able to locate a resource on this yet.

Thanks in advance!

0 Kudos
2 Replies
rkamal
VMware Employee
VMware Employee

Are you looking to map the vm's external ip and the internal ips.

VM vm = VM.getVMById(vcloudClient,
"urn:vcloud:vm:db950ac4-0278-4636-b8f8-7946a9158133");
for (NetworkConnectionType nic : vm.getNetworkConnections()) {
if (nic.getIpAddress() != null
&& nic.getExternalIpAddress() != null)
System.out.println(nic.getIpAddress() + " -> "
+ nic.getExternalIpAddress());
}

Regards,

Rajesh Kamal.

0 Kudos
rlmitchell
Contributor
Contributor

Thanks for the reply Rajesh!  I neglected to put in the question that I am pre-provisioning the ip addresses and mapping. 

0 Kudos