Java Example of
Retrieving a
vSphere
Automation Endpoint on a
vCenter
Server
Instance
vSphere
Automation
Endpoint on a
vCenter
Server
InstanceThis example is
based on the in the
LookupServiceHelper.java
sample file.
This example uses the steps that are
described in the
Retrieve a vSphere Automation Endpoint on a vCenter Server Instance
procedure.
For a complete and
up-to-date version of the sample code, see the
vSphere
Automation SDK Java samples at GitHub.
... //1 - Determine management node ID. String targetNodeId = getMgmtNodeId(targetNodeFqdn); //2 - List filtered registration info. List<LookupServiceRegistrationInfo> results = lookupSingleServiceUrl(“com.vmware.cis”, “cs.vapi”, “vapi.json.https.public”, “com.vmware.vapi.endpoint”, targetNodeId); //3 - Extract endpoint URL from registration info. LookupServiceRegistrationInfo registrationInfo = results.get(0); LookupServiceRegistrationEndpoint serviceEndpoint = registrationInfo.getServiceEndpoints().get(0); String ssoUrl = serviceEndpoint.getUrl(); ...