This example provides a common pattern for filtering Lookup Service registration data. This example is based on the code in the lookup_service_helper.rb sample file.

This example uses the steps that are described in the Retrieve a vSphere Automation Endpoint on a vCenter Server Instance procedure.

Note: For a complete and up-to-date version of the sample code, see the vSphere Automation SDK Ruby samples at GitHub.
service_infos = lookup_service_infos(prod='com.vmware.cis',
                                              svc_type='cs.vapi',
                                              proto='vapi.json.https.public',
                                              ep_type='com.vmware.vapi.endpoint',
                                              node_id=$my_mgmt_node_id)
service_infos = [service_infos] if service_infos.is_a?Hash
$my_vapi_url = service_infos[0][:service_endpoints][:url]