But what if you would like to use the outstanding vRealize Operations engine to manage and visualize objects which cannot be collected using the rich Management Pack ecosystem?

Let’s imagine you have a cool Smart Home system and you would like to get it integrated into your vRealize Operations. You would like to have all the various elements as objects in vRealize Operations to push metrics and properties to those objects.

In this post I will show you how to create your own custom environments in vRealize Operations using REST and vRealize Orchestrator.

Of course, this is just an example and the environment, and the corresponding inputs are “virtual”. The used vRealize Orchestrator workflows are examples and there are different ways to achieve the same outcome.

This Entry will initially create our OPENAPI adapter instance for the new custom environment using the REST API. This environment will reflect a Smart Home installation containing various devices. This call will create a lightning device located in the living room. How to execute that call using vRealize Orchestrator will be described later on.

Input data

If we are going to use automation to create our objects it would be not very sophisticated to enter every value manually. Therefor as first step we design and create a JSON file describing the model of our Smart Home. This is an example how a very simple model may look like. The included properties and metrics will play a role in some subsequent blog posts.

In this JSON example our Smart Home consists of three types of devices: Climate, Door and Lightning.

The instances of those devices can be located in different rooms and have various properties and metrics.

vRealize Orchestrator Preparation – Resource Element

To consume our JSON file in a vRealize Orchestrator workflow we need to import that file as “Resource Element”.

JSON file as vRealize Orchestrator Resource Element

After importing the JSON file into vRealize Orchestrator it can be used as an attribute in any vRealize Orchestrator workflow.

vRealize Orchestrator Preparation – Configuration Element

Acquiring a valid vRealize Operations authentication token is one part of our workflow. To make the process as automated as possible, we will store frequently used values in a vRealize Orchestrator “Configuration Element”. Such values are for example user credentials and token related information.

vRealize Orchestrator Configuration Element

A vRealize Orchestrator configuration element is a kind of dictionary data structure storing key:value pairs for ease of use in vRealize Orchestrator workflows.

vRealize Orchestrator Preparation – REST Endpoint and Operations

The last pre-requisite is a working REST endpoint including REST operations configured in our vRealize Orchestrator instance. vRealize Orchestrator provides appropriate workflows in the out-of-the-box library to add new REST hosts and operations offered by those hosts. The following figure shows the location of the workflows which can be used to configure a REST API provider.

Creating Custom Objects

The actual job is being done in the CreateCustomObjects workflow:

CreateCustomObjects Workflow

After some URL-encoding for inputs containing e.g. white spaces, we collect information about the new objects using the JSON file (newObjecstInfo), the code snippet here has been shortened and includes only one object category. All workflows can be .

What we are doing here is basically creating an array of strings containing the names of our new custom objects. At this point the code needs to be adopted to the model defined in the JSON file to parse the data correctly.

The next steps are fairly simple, we check the validity of the token which we saved in a configuration element and acquire a new token in case our token is valid for less than 10 minutes: