Unlocking the Power of vRealize Automation with vUptime’s REST API Guide

Using vRealize Automation REST API with vCAC plugin in vRO

=====================================================

In this article, we will explore how to use the vRealize Automation (vRA) REST API with the vCAC plugin in vRealize Orchestrator (vRO). We will demonstrate how to list all blueprints defined on a vRA tenant using the vCAC endpoint.

Why use vCAC plugin?

———————–

The vCAC plugin provides a simpler way of accessing the vRA REST API compared to the HTTP-REST plugin. With the vCAC plugin, you can directly access the vRA REST endpoints without having to manually create the REST client. Additionally, the vCAC endpoint is more straightforward and easier to use compared to the HTTP-REST plugin.

Finding the vCAC endpoint

—————————

To start, we need to find the vCAC endpoint for the composition-service. To do this, we can use our favorite REST client (e.g., Postman) to perform the following REST call on our vRA server after being authenticated:

“`bash

GET https:///api/composer/v1/endpoints

“`

This will collect all the vRA REST endpoints. On the result, locate your endpoint and get the `typeId` which is the endpoint name on the vCAC plugin. In this case, the vCAC endpoint found is `com.vmware.csp.core.cafe.catalog.requested.item.info.provider` for the composition-service. Great!

Using the vCAC endpoint in vRO

——————————

Now that we have found the vCAC endpoint, we can use it directly in vRO. To do this, we need to create a REST client with the `vCACCAFEHost` object and its `createRestClient()` method. Here is the code to list all the blueprints defined on a vRA tenant:

“`groovy

import com.vmware.csp.core.cafe.catalog.requested.item.info.provider

// Create a REST client with the vCAC endpoint

def restClient = new vCACCAFEHost().createRestClient(endpoint: ‘com.vmware.csp.core.cafe.catalog.requested.item.info.provider’)

// List all blueprints defined on the vRA tenant

def blueprints = restClient.get(‘blueprints’)

“`

In this example, we create a REST client with the `vCACCAFEHost` object and pass the `endpoint` parameter with the vCAC endpoint found earlier (i.e., `com.vmware.csp.core.cafe.catalog.requested.item.info.provider`). We then call the `get()` method on the REST client to list all blueprints defined on the vRA tenant.

Conclusion

———-

In this article, we have demonstrated how to use the vRealize Automation REST API with the vCAC plugin in vRO. We have shown how to find the vCAC endpoint and use it directly in vRO to perform basic REST operations like GET, POST, and PUT. Using the vCAC plugin simplifies the process of accessing the vRA REST API and makes it more straightforward to use.