{"id":134,"date":"2019-03-14T12:52:05","date_gmt":"2019-03-14T11:52:05","guid":{"rendered":"http:\/\/thomas-kopton.de\/vblog\/?p=134"},"modified":"2020-07-31T11:55:33","modified_gmt":"2020-07-31T10:55:33","slug":"adding-custom-objects-to-vrealize-operations-with-the-rest-api-and-vrealize-orchestrator-workflows","status":"publish","type":"post","link":"https:\/\/thomas-kopton.de\/vblog\/?p=134","title":{"rendered":"Adding custom objects to vRealize Operations with the REST API and vRealize Orchestrator workflows"},"content":{"rendered":"\n<p>In a recent blog post \u201c<a href=\"https:\/\/blogs.vmware.com\/management\/2019\/02\/adding-custom-metrics-and-properties-to-vrealize-operations-objects-with-the-rest-api.html\">Adding Custom Metrics and Properties to vRealize Operations Objects with the REST API<\/a>\u201d I have described how to add additional metrics and properties to existing objects in <a href=\"http:\/\/www.vmware.com\/products\/vrealize-operations.html?src=so_5703fb3d92c20&amp;cid=70134000001M5td\">vRealize Operations<\/a> using the REST API and Postman.<\/p>\n\n\n\n<p>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?<\/p>\n\n\n\n<p>Let\u2019s imagine you have a cool Smart Home system and you would like to get it integrated into your <a href=\"http:\/\/www.vmware.com\/products\/vrealize-operations.html?src=so_5703fb3d92c20&amp;cid=70134000001M5td\">vRealize Operations<\/a>. You would like to have all the various elements as objects in vRealize Operations to push metrics and properties to those objects.<\/p>\n\n\n\n<p>In this post I will show you how to create your own custom environments in <strong>vRealize Operations<\/strong> using <strong>REST<\/strong> and <a href=\"https:\/\/www.vmware.com\/products\/vrealize-orchestrator.html?src=so_5703fb3d92c20&amp;cid=70134000001M5td\"><strong>vRealize Orchestrator<\/strong><\/a>.<\/p>\n\n\n\n<p>Of course, this is just an example and the environment, and the corresponding inputs are \u201cvirtual\u201d. The used vRealize Orchestrator workflows are examples and there are different ways to achieve the same outcome.<\/p>\n\n\n\n<p>The <a href=\"https:\/\/www.vmware.com\/products\/vrealize-orchestrator.html?src=so_5703fb3d92c20&amp;cid=70134000001M5td\">vRealize Orchestrator<\/a> workflows, actions etc. related to this post can be found here:<\/p>\n\n\n\n<p><a href=\"https:\/\/code.vmware.com\/samples?id=5457\">https:\/\/code.vmware.com\/samples?id=5457<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The REST API call<\/h3>\n\n\n\n<p>There are several REST API calls available to create new objects in vRealize Operations. In this example we will use the method \u201ccreateResourceUsingAdapterKind\u201d:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>POST \/api\/resources\/adapterkinds\/{adapterKindKey}<\/code><\/pre>\n\n\n\n<p>A sample URL body of the call can be as complex as in the official documentation or as easy as this one:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">https:\/\/VROPS-FQDN\/suite-api\/api\/resources\/adapterkinds\/MySmartHome<\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"description\": \"My new entry\",\n    \"creationTime\": null,\n    \"resourceKey\": {\n        \"name\": \"Living Room\",\n        \"adapterKindKey\": \"MyHouse\",\n        \"resourceKindKey\": \"Lightning\"\n    },\n    \"resourceStatusStates\": &#91;],\n    \"dtEnabled\": true,\n    \"monitoringInterval\": 5\n}<\/code><\/pre>\n\n\n\n<p>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.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Input data<\/h3>\n\n\n\n<p>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.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\"SmartHome\": {\n    \"Climate\": &#91;\n      {\"Name\": \"Living Room\", \"Properties\": &#91;\n        { \"Manufacturer\" : \"CompanyA\", \"FWVersion\" : \"2.01\" }\n        ], \"Metrics\": &#91;\n          { \"Temperatur\" : \"21\", \"Humidity\" : \"40\", \"BateryStatus\" : \"94%\"}\n          ]},\n      {\"Name\": \"Kitchen\", \"Properties\": &#91;\n        { \"Manufacturer\" : \"CompanyA\", \"FWVersion\" : \"1.90\" }\n        ], \"Metrics\": &#91;\n          { \"Temperatur\" : \"13\", \"Humidity\" : \"87\", \"BateryStatus\" : \"10%\"}\n          ]},\n      {\"Name\": \"Bedroom\", \"Properties\": &#91;\n        { \"Manufacturer\" : \"CompanyA\", \"FWVersion\" : \"2.1\" }\n        ], \"Metrics\": &#91;\n          { \"Temperatur\" : \"16\", \"Humidity\" : \"35\", \"BateryStatus\" : \"74%\"}\n          ]}\n    ],\n    \"Door\": &#91;\n        {\"Name\": \"Front\", \"Properties\": &#91;\n          { \"Manufacturer\" : \"CompanyA\", \"FWVersion\" : \"1.95\" }\n          ], \"Metrics\": &#91;\n            { \"Status\" : \"OPEN\"}\n            ]},\n        {\"Name\": \"Garden\", \"Properties\": &#91;\n          { \"Manufacturer\" : \"CompanyA\", \"FWVersion\" : \"2.1\" }\n          ], \"Metrics\": &#91;\n            { \"Status\" : \"CLOSED\"}\n            ]}\n      ],\n      \"Lightning\": &#91;\n        {\"Name\": \"Living Room\", \"Properties\": &#91;\n          { \"Manufacturer\" : \"CompanyB\", \"FWVersion\" : \"0.91\" }\n          ], \"Metrics\": &#91;\n            { \"Status\" : \"ON\", \"Level (%)\" : \"100%\", \"BateryStatus\" : \"76%\"}\n            ]},\n        {\"Name\": \"Kitchen\", \"Properties\": &#91;\n          { \"Manufacturer\" : \"CompanyC\", \"FWVersion\" : \"1.00\" }\n          ], \"Metrics\": &#91;\n            { \"Status\" : \"ON\", \"Level (%)\" : \"75%\", \"BateryStatus\" : \"45%\"}\n            ]},\n        {\"Name\": \"Bedroom\", \"Properties\": &#91;\n          { \"Manufacturer\" : \"CompanyA\", \"FWVersion\" : \"2.90\" }\n          ], \"Metrics\": &#91;\n            { \"Status\" : \"OFF\", \"Level (%)\" : \"0%\", \"BateryStatus\" : \"14%\"}\n            ]}\n      ]\n  }\n}<\/code><\/pre>\n\n\n\n<p><em>Code 1: SmartHome Data as JSON<\/em><\/p>\n\n\n\n<p>In this JSON example our Smart Home consists of three types of devices: Climate, Door and Lightning.<\/p>\n\n\n\n<p>The instances of those devices can be located in different rooms and have various properties and metrics.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">vRealize Orchestrator Preparation &#8211; Resource Element<\/h3>\n\n\n\n<p>To consume our JSON file in a vRealize Orchestrator workflow we need to import that file as \u201cResource Element\u201d.<\/p>\n\n\n\n<figure class=\"wp-block-image alignnone wp-image-23540 size-full\"><img decoding=\"async\" src=\"http:\/\/blogs.vmware.com\/management\/files\/2019\/03\/tkopton_01_Picture1.png\" alt=\"\" class=\"wp-image-23540\"\/><figcaption>JSON file as vRealize Orchestrator Resource Element<\/figcaption><\/figure>\n\n\n\n<p>After importing the JSON file into vRealize Orchestrator it can be used as an attribute in any vRealize Orchestrator workflow.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">vRealize Orchestrator Preparation &#8211; Configuration Element<\/h3>\n\n\n\n<p>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 \u201cConfiguration Element\u201d. Such values are for example user credentials and token related information.<\/p>\n\n\n\n<figure class=\"wp-block-image alignnone wp-image-23542 size-full\"><img decoding=\"async\" src=\"http:\/\/blogs.vmware.com\/management\/files\/2019\/03\/tkopton_01_Picture2.png\" alt=\"\" class=\"wp-image-23542\"\/><figcaption>vRealize Orchestrator Configuration Element<\/figcaption><\/figure>\n\n\n\n<p>A vRealize Orchestrator configuration element is a kind of dictionary data structure storing key:value pairs for ease of use in vRealize Orchestrator workflows.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">vRealize Orchestrator Preparation \u2013 REST Endpoint and Operations<\/h3>\n\n\n\n<p>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.<\/p>\n\n\n\n<figure class=\"wp-block-image alignnone wp-image-23543 size-full\"><img decoding=\"async\" src=\"http:\/\/blogs.vmware.com\/management\/files\/2019\/03\/tkopton_01_Picture3.png\" alt=\"\" class=\"wp-image-23543\"\/><figcaption>vRealize Orchestrator Out-of-the-Box REST Configuration Workflows<\/figcaption><\/figure>\n\n\n\n<p>Basically, we will use following REST calls:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">POST \/api\/auth\/token\/acquire\n\nPOST \/api\/resources\/adapterkinds\/{adapterKindKey}<\/pre>\n\n\n\n<p>For details, please check the vRealize Operations REST API documentation provided by your vRealize Operations instance at:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">https:\/\/$VROPSFQDN\/suite-api\/docs\/rest\/index.html<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Authenticating to vRealize Operations using vRealize Orchestrator<\/h3>\n\n\n\n<p>As described in my post \u201c<a href=\"https:\/\/blogs.vmware.com\/management\/2019\/02\/adding-custom-metrics-and-properties-to-vrealize-operations-objects-with-the-rest-api.html\">Adding Custom Metrics and Properties to vRealize Operations Objects with the REST API<\/a>\u201d we will use the token based authentication in this example, too. This is how the AquireToken workflow looks like:<\/p>\n\n\n\n<figure class=\"wp-block-image alignnone wp-image-23545 size-full\"><img decoding=\"async\" src=\"http:\/\/blogs.vmware.com\/management\/files\/2019\/03\/tkopton_01_Picture4.png\" alt=\"\" class=\"wp-image-23545\"\/><figcaption>AquireToken Workflow<\/figcaption><\/figure>\n\n\n\n<p>In the first step we are creating the JSON body:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>jsonBody = {\n  \"username\": \"\",\n  \"authSource\": \"\",\n  \"password\": \"\",\n  \"others\": &#91;],\n  \"otherAttributes\": {}\n};\n\nvar userName = vropsConfig.getAttributeWithKey(\"userName\");\nvar userPassword = vropsConfig.getAttributeWithKey(\"userPassword\");\nvar authSource = vropsConfig.getAttributeWithKey(\"authSource\");\njsonBody.username = userName.value;\njsonBody.password = userPassword.value;\njsonBody.authSource = authSource.value;<\/code><\/pre>\n\n\n\n<p><em>Code 2: createJsonBody Snippet<\/em><\/p>\n\n\n\n<p>The next scripting element, callREST, executes the REST call:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  \nrequestBody = JSON.stringify(jsonBody);\nrequest = aquireToken.createRequest(null, requestBody);\nrequest.contentType = \"application\/json\";\nrequest.setHeader(\"accept\", \"application\/json\");\nresponse = request.execute();\njsonObject = JSON.parse(response.contentAsString);\nvropsToken = jsonObject.token;\nvropsTokenValidity = jsonObject.validity;<\/code><\/pre>\n\n\n\n<p><em>Code 3: callREST Snippet<\/em><\/p>\n\n\n\n<p>Third element saves the received token, including the expiration information, in the configuration element:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vropsConfig.setAttributeWithKey(\"token\",vropsToken); vropsConfig.setAttributeWithKey(\"tokenValidity\",vropsTokenValidity);<\/code><\/pre>\n\n\n\n<p><em>Code 4: saveToken Snippet<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Creating Custom Objects<\/h3>\n\n\n\n<p>The actual job is being done in the CreateCustomObjects workflow:<\/p>\n\n\n\n<figure class=\"wp-block-image alignnone wp-image-23547 size-full\"><img decoding=\"async\" src=\"http:\/\/blogs.vmware.com\/management\/files\/2019\/03\/tkopton_01_Picture5.png\" alt=\"\" class=\"wp-image-23547\"\/><figcaption>CreateCustomObjects Workflow<\/figcaption><\/figure>\n\n\n\n<p>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 .<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>template = newObjectsJSONFile.getContentAsMimeAttachment();\njsonObject = JSON.parse(template.content);\nvar objects1 = jsonObject.SmartHome&#91;\"Climate\"];\u2026\u2026\nnewResources1 = new Array();\nfor (object1 in objects1) {\n  newResources1.push(objects1&#91;object1].Name);\n}\nnumberResource1 = newResources1.length;<\/code><\/pre>\n\n\n\n<p><em>Code 5: newObjectsinfo Snippet<\/em><\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>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:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>var vropsTokenValidity = vropsConfig.getAttributeWithKey(\"tokenValidity\");\nif (vropsTokenValidity.value != null) {\n  var dateNow = new Date();\n  var diff = vropsTokenValidity.value - dateNow.getTime();\n  tokenRemainigVaidity = diff \/ 1000 \/ 60;\n} else {\n  tokenRemainigVaidity = 0;\n}<\/code><\/pre>\n\n\n\n<p><em>Code 6: checkToken Snippet<\/em><\/p>\n\n\n\n<p>The following scripting elements take care of looping through the arrays of strings to create all object one by one.<\/p>\n\n\n\n<p>The main part related to creating new vR Ops objects consists of creating the JSON body:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>jsonBody = {\n  \"description\": \"New SmartHome entry\",\n  \"creationTime\": null,\n  \"resourceKey\": {\n    \"name\": \"\",\n    \"adapterKindKey\": \"\",\n    \"resourceKindKey\": \"\"\n  },\n  \"resourceStatusStates\": &#91;],\n  \"dtEnabled\": true,\n  \"monitoringInterval\": 5\n};\nif (creatingResource1) {\n  jsonBody.resourceKey.name = newResources1&#91;numberResource1 - 1];\n  jsonBody.resourceKey.adapterKindKey = adapterKindKey;\n  jsonBody.resourceKey.resourceKindKey = resourceKind1;\n  numberResource1--;\n}<\/code><\/pre>\n\n\n\n<p><em>Code 7: createJSONBody Snippet<\/em><br><br>The very last step is to execute the REST API call to create a custom object:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>var params = &#91;encodedAdapterKind];\nvar token = vropsConfig.getAttributeWithKey(\"token\").value;\nvar request = createResourceCall.createRequest(params, JSON.stringify(jsonBody));\n\nrequest.contentType = \"application\/json\";\nrequest.setHeader(\"accept\", \"application\/json\");\nrequest.setHeader(\"Authorization\", \"vRealizeOpsToken \" + token);\nvar response = request.execute();\n\nif (response.statusCode >= 400) {\n  System.log(response.contentAsString);\n  throw \"HTTPError: status code: \" + response.statusCode;\n}<\/code><\/pre>\n\n\n\n<p><em>Code 8: callREST Snippet<\/em><\/p>\n\n\n\n<p>If everything worked out as expected, we will see our new object types and instances of those types in vRealize Operations.<\/p>\n\n\n\n<p>After importing the vRealize Orchestrator package you will need to <strong>configure the REST operation according to your environment:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image alignnone wp-image-23549 size-full\"><img decoding=\"async\" src=\"http:\/\/blogs.vmware.com\/management\/files\/2019\/03\/tkopton_01_Picture6.png\" alt=\"\" class=\"wp-image-23549\"\/><figcaption>Workflow Attributes &#8211; REST Operation<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Our Smart Home in vRealize Operations<\/h3>\n\n\n\n<p>The Environment view in vRealize Operations 7.0 including our custom objects:<\/p>\n\n\n\n<figure class=\"wp-block-image alignnone wp-image-23550 size-full\"><img decoding=\"async\" src=\"http:\/\/blogs.vmware.com\/management\/files\/2019\/03\/tkopton_01_Picture7.png\" alt=\"\" class=\"wp-image-23550\"\/><figcaption>vRealize Operations Environment View<\/figcaption><\/figure>\n\n\n\n<p>In some subsequent posts I am going to explain how to push metrics and properties to such custom objects.<\/p>\n\n\n\n<p>Some other interesting object types which may become relevant in the future, where vRealize Operations instances will be found even on space ships use the following JSON as input:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"StarFleet\": {\n      \"Ships\": &#91;\n          {\n              \"Name\": \"Enterprise\",\n              \"Properties\": &#91;\n                  {\n                      \"Class\": \"Galaxy\",\n                      \"Registry\": \"NCC-1701-D\",\n                      \"Captain\": \"Picard\"\n                  }\n              ],\n              \"Metrics\": &#91;\n                  {\n                      \"CurrentSpeed\": \"9\",\n                      \"ShieldStatus\": \"100\"\n                  }\n              ]\n          },\n          {\n              \"Name\": \"Voyager\",\n              \"Properties\": &#91;\n                  {\n                      \"Class\": \"Intrepid\",\n                      \"Registry\": \"NCC-74656\",\n                      \"Captain\": \"Janeway\"\n                  }\n              ],\n              \"Metrics\": &#91;\n                  {\n                      \"CurrentSpeed\": \"9\",\n                      \"ShieldStatus\": \"90\"\n                  }\n              ]\n          },\n          {\n              \"Name\": \"Defiant\",\n              \"Properties\": &#91;\n                  {\n                      \"Class\": \"Defiant\",\n                      \"Registry\": \"NX-74205\",\n                      \"Captain\": \"Worf\"\n                  }\n              ],\n              \"Metrics\": &#91;\n                  {\n                      \"CurrentSpeed\": \"7\",\n                      \"ShieldStatus\": \"80\"\n                  }\n              ]\n          }\n      ],\n      \"Planets\": &#91;\n          {\n              \"Name\": \"United Earth\",\n              \"Properties\": &#91;\n                  {\n                      \"Capital\": \"San Francisco, Paris\",\n                      \"Founded\": \"2150\",\n                      \"MajorSpecies\": \"Humans\"\n                  }\n              ],\n              \"Metrics\": &#91;\n                  {\n                      \"Population\": \"0\"\n                  }\n              ]\n          },\n          {\n              \"Name\": \"Vulcan\",\n              \"Properties\": &#91;\n                  {\n                      \"Capital\": \"ShiKahr\",\n                      \"Founded\": \"400\",\n                      \"MajorSpecies\": \"Vulcanians\"\n                  }\n              ],\n              \"Metrics\": &#91;\n                  {\n                      \"Population\": \"0\"\n                  }\n              ]\n          },\n          {\n              \"Name\": \"Andorian Empire\",\n              \"Properties\": &#91;\n                  {\n                      \"Capital\": \"Andor\",\n                      \"Founded\": \"0000\",\n                      \"MajorSpecies\": \"Andorians\"\n                  }\n              ],\n              \"Metrics\": &#91;\n                  {\n                      \"Population\": \"0\"\n                  }\n              ]\n          },\n          {\n              \"Name\": \"Tellar\",\n              \"Properties\": &#91;\n                  {\n                      \"Capital\": \"Tellar Prime\",\n                      \"Founded\": \"0000\",\n                      \"MajorSpecies\": \"Tellarites\"\n                  }\n              ],\n              \"Metrics\": &#91;\n                  {\n                      \"Population\": \"0\"\n                  }\n              ]\n          }\n      ]\n  }\n}<\/code><\/pre>\n\n\n\n<p>With some modifications to the newObjectsInfo scripting element:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>template = newObjectsJSONFile.getContentAsMimeAttachment();\njsonObject = JSON.parse(template.content);\n\nvar objects1 = jsonObject.StarFleet&#91;\"Ships\"];\nvar objects2 = jsonObject.StarFleet&#91;\"Planets\"];\nvar properties;\nvar metrics;\n\nnewResources1 = new Array();\nnewResources2 = new Array();\n\nfor (object1 in objects1)\n{\n\tSystem.log(objects1&#91;object1].Name);\n\t\n\tnewResources1.push(objects1&#91;object1].Name);\n\t\n\tproperties = objects1&#91;object1].Properties;\n\tmetrics = objects1&#91;object1].Metrics;\n\t\n\tfor (property in properties)\n\t{\n\t\tSystem.log(objects1&#91;object1].Properties&#91;property].Class);\n\t\tSystem.log(objects1&#91;object1].Properties&#91;property].Registry);\n\t\tSystem.log(objects1&#91;object1].Properties&#91;property].Captain);\n\t}\n\t\n\tfor (metric in metrics)\n\t{\n\t\tSystem.log(objects1&#91;object1].Metrics&#91;metric].CurrentSpeed);\n\t\tSystem.log(objects1&#91;object1].Metrics&#91;metric].ShieldStatus);\n\t}\n}\n\nfor (object2 in objects2)\n{\n\tSystem.log(objects2&#91;object2].Name);\n\t\n\tnewResources2.push(objects2&#91;object2].Name);\n\t\n\tproperties = objects2&#91;object2].Properties;\n\tmetrics = objects2&#91;object2].Metrics;\n\t\n\tfor (property in properties)\n\t{\n\t\tSystem.log(objects2&#91;object2].Properties&#91;property].Capital);\n\t\tSystem.log(objects2&#91;object2].Properties&#91;property].Founded);\n\t\tSystem.log(objects2&#91;object2].Properties&#91;property].MajorSpecies);\n\t}\n\t\n\tfor (metric in metrics)\n\t{\n\t\tSystem.log(objects2&#91;object2].Metrics&#91;metric].Population);\n\t}\n}\n\nnumberResource1 = newResources1.length;\nnumberResource2 = newResources2.length;<\/code><\/pre>\n\n\n\n<p>Run the adjusted workflow:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"596\" src=\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/03\/image.png\" alt=\"\" class=\"wp-image-138\" srcset=\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/03\/image.png 750w, https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/03\/image-300x238.png 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n\n\n\n<p>And vR Ops ready to help to <strong>boldly go where no one has gone before&#8230;<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"252\" height=\"424\" src=\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/03\/image-1.png\" alt=\"\" class=\"wp-image-139\" srcset=\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/03\/image-1.png 252w, https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/03\/image-1-178x300.png 178w\" sizes=\"auto, (max-width: 252px) 100vw, 252px\" \/><\/figure>\n\n\n\n<p>Happy coding&#8230;<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Thomas<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a recent blog post \u201cAdding Custom Metrics and Properties to vRealize Operations Objects with the REST API\u201d I have described how to add additional metrics and properties to existing objects in vRealize Operations using the REST API and Postman. But what if you would like to use the outstanding vRealize Operations engine to manage &#8230;<\/p>\n","protected":false},"author":1,"featured_media":139,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34,2],"tags":[6,36,3],"class_list":["post-134","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vrealize-operations","category-vrops","tag-rest","tag-vrealize-operations","tag-vrops"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Adding custom objects to vRealize Operations with the REST API and vRealize Orchestrator workflows - TOMsOps<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thomas-kopton.de\/vblog\/?p=134\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Adding custom objects to vRealize Operations with the REST API and vRealize Orchestrator workflows - TOMsOps\" \/>\n<meta property=\"og:description\" content=\"In a recent blog post \u201cAdding Custom Metrics and Properties to vRealize Operations Objects with the REST API\u201d I have described how to add additional metrics and properties to existing objects in vRealize Operations using the REST API and Postman. But what if you would like to use the outstanding vRealize Operations engine to manage ...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thomas-kopton.de\/vblog\/?p=134\" \/>\n<meta property=\"og:site_name\" content=\"TOMsOps\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-14T11:52:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-07-31T10:55:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/03\/image-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"252\" \/>\n\t<meta property=\"og:image:height\" content=\"424\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Thomas Kopton\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thomas Kopton\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=134#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=134\"},\"author\":{\"name\":\"Thomas Kopton\",\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/#\\\/schema\\\/person\\\/892d6b96c66b1dd4b75c6e32fdbfea82\"},\"headline\":\"Adding custom objects to vRealize Operations with the REST API and vRealize Orchestrator workflows\",\"datePublished\":\"2019-03-14T11:52:05+00:00\",\"dateModified\":\"2020-07-31T10:55:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=134\"},\"wordCount\":1059,\"commentCount\":1,\"image\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=134#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/image-1.png\",\"keywords\":[\"REST\",\"vRealize Operations\",\"vROps\"],\"articleSection\":[\"vRealize Operations\",\"vROps\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=134#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=134\",\"url\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=134\",\"name\":\"Adding custom objects to vRealize Operations with the REST API and vRealize Orchestrator workflows - TOMsOps\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=134#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=134#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/image-1.png\",\"datePublished\":\"2019-03-14T11:52:05+00:00\",\"dateModified\":\"2020-07-31T10:55:33+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/#\\\/schema\\\/person\\\/892d6b96c66b1dd4b75c6e32fdbfea82\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=134#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=134\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=134#primaryimage\",\"url\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/image-1.png\",\"contentUrl\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/image-1.png\",\"width\":252,\"height\":424},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=134#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Adding custom objects to vRealize Operations with the REST API and vRealize Orchestrator workflows\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/#website\",\"url\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/\",\"name\":\"TOMsOps\",\"description\":\"Just another VMware Cloud Management Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/#\\\/schema\\\/person\\\/892d6b96c66b1dd4b75c6e32fdbfea82\",\"name\":\"Thomas Kopton\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e746aafbd3733172ceb4d600ba1feda61bc87cd3b70f5a9dfb581907cc7973b1?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e746aafbd3733172ceb4d600ba1feda61bc87cd3b70f5a9dfb581907cc7973b1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e746aafbd3733172ceb4d600ba1feda61bc87cd3b70f5a9dfb581907cc7973b1?s=96&d=mm&r=g\",\"caption\":\"Thomas Kopton\"},\"url\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Adding custom objects to vRealize Operations with the REST API and vRealize Orchestrator workflows - TOMsOps","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/thomas-kopton.de\/vblog\/?p=134","og_locale":"en_US","og_type":"article","og_title":"Adding custom objects to vRealize Operations with the REST API and vRealize Orchestrator workflows - TOMsOps","og_description":"In a recent blog post \u201cAdding Custom Metrics and Properties to vRealize Operations Objects with the REST API\u201d I have described how to add additional metrics and properties to existing objects in vRealize Operations using the REST API and Postman. But what if you would like to use the outstanding vRealize Operations engine to manage ...","og_url":"https:\/\/thomas-kopton.de\/vblog\/?p=134","og_site_name":"TOMsOps","article_published_time":"2019-03-14T11:52:05+00:00","article_modified_time":"2020-07-31T10:55:33+00:00","og_image":[{"width":252,"height":424,"url":"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/03\/image-1.png","type":"image\/png"}],"author":"Thomas Kopton","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Thomas Kopton","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thomas-kopton.de\/vblog\/?p=134#article","isPartOf":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=134"},"author":{"name":"Thomas Kopton","@id":"https:\/\/thomas-kopton.de\/vblog\/#\/schema\/person\/892d6b96c66b1dd4b75c6e32fdbfea82"},"headline":"Adding custom objects to vRealize Operations with the REST API and vRealize Orchestrator workflows","datePublished":"2019-03-14T11:52:05+00:00","dateModified":"2020-07-31T10:55:33+00:00","mainEntityOfPage":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=134"},"wordCount":1059,"commentCount":1,"image":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=134#primaryimage"},"thumbnailUrl":"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/03\/image-1.png","keywords":["REST","vRealize Operations","vROps"],"articleSection":["vRealize Operations","vROps"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thomas-kopton.de\/vblog\/?p=134#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thomas-kopton.de\/vblog\/?p=134","url":"https:\/\/thomas-kopton.de\/vblog\/?p=134","name":"Adding custom objects to vRealize Operations with the REST API and vRealize Orchestrator workflows - TOMsOps","isPartOf":{"@id":"https:\/\/thomas-kopton.de\/vblog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=134#primaryimage"},"image":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=134#primaryimage"},"thumbnailUrl":"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/03\/image-1.png","datePublished":"2019-03-14T11:52:05+00:00","dateModified":"2020-07-31T10:55:33+00:00","author":{"@id":"https:\/\/thomas-kopton.de\/vblog\/#\/schema\/person\/892d6b96c66b1dd4b75c6e32fdbfea82"},"breadcrumb":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=134#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thomas-kopton.de\/vblog\/?p=134"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/thomas-kopton.de\/vblog\/?p=134#primaryimage","url":"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/03\/image-1.png","contentUrl":"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/03\/image-1.png","width":252,"height":424},{"@type":"BreadcrumbList","@id":"https:\/\/thomas-kopton.de\/vblog\/?p=134#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thomas-kopton.de\/vblog"},{"@type":"ListItem","position":2,"name":"Adding custom objects to vRealize Operations with the REST API and vRealize Orchestrator workflows"}]},{"@type":"WebSite","@id":"https:\/\/thomas-kopton.de\/vblog\/#website","url":"https:\/\/thomas-kopton.de\/vblog\/","name":"TOMsOps","description":"Just another VMware Cloud Management Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thomas-kopton.de\/vblog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/thomas-kopton.de\/vblog\/#\/schema\/person\/892d6b96c66b1dd4b75c6e32fdbfea82","name":"Thomas Kopton","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/e746aafbd3733172ceb4d600ba1feda61bc87cd3b70f5a9dfb581907cc7973b1?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/e746aafbd3733172ceb4d600ba1feda61bc87cd3b70f5a9dfb581907cc7973b1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e746aafbd3733172ceb4d600ba1feda61bc87cd3b70f5a9dfb581907cc7973b1?s=96&d=mm&r=g","caption":"Thomas Kopton"},"url":"https:\/\/thomas-kopton.de\/vblog\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=\/wp\/v2\/posts\/134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=134"}],"version-history":[{"count":7,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=\/wp\/v2\/posts\/134\/revisions"}],"predecessor-version":[{"id":382,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=\/wp\/v2\/posts\/134\/revisions\/382"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=\/wp\/v2\/media\/139"}],"wp:attachment":[{"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}