Whenever I create a virtual machine in AZURE and AWS with java SDK, the return object always give me public and private IPs.
Now I am exploring GCP java SDK and have successfully created an instance using it but how will I get ip addresses in return?
Instance instance = new Instance()
.setName(createInstance.getInstanceName())
.setMachineType(createInstance.getMachineTypeUrl()) //can provide 'prepare url' option
.setDisks(attachedDiskList)
.setNetworkInterfaces(networkInterfaceList)
.setCpuPlatform(createInstance.getCpuPlatform());
Operation instanceCreated = gcpCredentialService.getGcpClient()
.instances()
.insert(GcpContext.getContext().getServiceAccountProjectId(), completeRegion, instance)
.execute();
This object instanceCreated does not return public and private IPS in return.
I am new to GCP and struggling in this part.