Configuring vCenter Adapter in vROPs via API

In this post we will learn how to install Management Packs in vROPs via API. 

For vCenter we don’t have to install any management pack as its shipped with vROPs by default and we just have to create vCenter credentials and configure adapter. Below steps can be followed to configure VC adapter.

1: Obtain Session Token: vROPs session token is obtained via POST call. 

Sample Output:

The token id obtained in output is passed as “Authorization: vRealizeOpsToken token_value” header in all subsequent GET and POST calls.

2: Obtain Collector ID: By default, for a distributed vROPs deployment, collector-id of master node is 1 and replica node is 2. But we can fetch collector id via API call as well. Collector ID is needed when configuring various adapters.

Sample Output

3: Configure vCenter Adapter: Before configuring adapters, we need to add credential for the solution first. Below payload used for VC adapter configuration, creates VC credentials and configures adapter in one shot.

Note: To get information about types of adapter that can be configured in vROPs, you can use below GET call.

GET https://<vrops-fqdn>/suite-api/api/adapterkinds

Sample Output: From response output, grab the adapter uuid as it will be used in subsequent calls. Adapter uuid corresponds to field “id” in output.

Note: Below output is a trimmed output. The actual output is a slightly big json which we need to pass in next API call.

4: Patch vCenter Adapter:  In this step we tell vROPS to start trusting certs returned by vCenter. For this we will pass the entire payload json in body which we obtained as output of step 3.

5: Start Collecting data from vCenter: Use adapter id from step-3 in below call.

I hope you enjoyed reading this post. Feel free to share this on social media if it is worth sharing 🙂

Leave a Reply