In this post I will walk through steps of integrating vSphere and vROPs in vRLI via API.
Note: All GET & POST calls are done over port 9543 with JSON payloads.
1: Obtain Auth Token:
1 2 3 4 5 6 7 8 9 10 11 |
Method: POST URL: https://<vrli-fqdn>:9543/api/v1/sessions Request Body: { "username":"admin", "password":"VMware1!", "provider":"Local" } |
Response output is a sessionId which is a opaque bearer token valid for a limited time, indicated by the ttl value in the response.
Note: Post obtaining Auth Token, sessionId is passed as type “Bearer Token” under Authorization for all subsequent requests.
2: Test vSphere Connection
1 2 3 4 5 6 7 8 9 10 11 12 |
Method: POST URL: https://<vrli-fqdn>:9543/api/v1/vsphere/testconnection Sample Payload: { "acceptCert":true, "hostname":"vcenter.mgmt.vmw", "username":"administrator@vsphere.local", "password":"VMware1!" } |
3: Configure vSphere Connection
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
Method: POST URL: https://<vrli-fqdn>:9543/api/v1/vsphere Sample Payload: { "acceptCert":true, "hostname":"vcenter.mgmt.vmw", "username":"administrator@vsphere.local", "password":"VMware123!", "syslogProtocol":"tcp", "vsphereEventsEnabled":true, "configureEsxiHostsAutomatically":true, "target":"<vrli-fqdn>" } |
4: Test vROPs Connection
1 2 3 4 5 6 7 8 9 10 11 12 |
Method: POST URL: https://<vrli-fqdn>:9543/api/v1/vrops/testconnection Sample Payload: { "acceptCert":true, "hostname":"vrops01.mgmt.vmw", "username":"admin", "password":"VMware123!" } |
5: Configure vROPs Connection API
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
Method: POST URL: https://<vrli-fqdn>:9543/api/v1/vrops Sample Payload: { "acceptCert":true, "hostname":"vrops01.mgmt.vmw", "username":"admin", "password":"VMware123!", "syslogProtocol":"tcp", "enableAlertsIntegration":true, "enableLaunchInContext":true, "target":"<vrli-fqdn>" } |
Response output will read “Successfully configured vRealize Operations Manager integration”
I hope you enjoyed reading this post. Feel free to share this on social media if it is worth sharing 🙂