How to modify vRO Workflow description using REST

  1. Requirement
  2. Procedure
  3. Steps
    1. Response body from GET call
    2. Body with updated description for PUT call

Requirement

If you want to update a Workflow’s description as and when you want while working in vRO or from outside, you can use this quick method using vRO’s REST APIs. If we want, we can easily create a workflow out of it.

Procedure

We will be using two REST APIs from vRO.

GET schema: for getting the schema content of the WF which will be modified and used later.

PUT schema: for updating the description of the WF.

Steps

  • Click Execute. If status is 200, you will see the response body with workflow content and obviously its description as well.
  • Now modify this response body so that the new body has updated description.

Response body from GET call

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <schema-workflow xmlns:ns2="http://www.vmware.com/vco" root-name="item1" object-name="workflow:name=generic" id="bddbcab3-b4b7-4577-b76e-3301374d805f" version="0.0.0" api-version="6.0.0" restartMode="1" resumeFromFailedMode="0" editor-version="2.0">
    <display-name>demo test</display-name>
    <description>This description needs to be updated programmatically, but how?</description>
    <position y="50.0" x="100.0"/>
    <input/>
    <output/>
.
.
.

Body with updated description for PUT call

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <schema-workflow xmlns:ns2="http://www.vmware.com/vco" root-name="item1" object-name="workflow:name=generic" id="bddbcab3-b4b7-4577-b76e-3301374d805f" version="0.0.0" api-version="6.0.0" restartMode="1" resumeFromFailedMode="0" editor-version="2.0">
    <display-name>demo test</display-name>
    <description>The description has been updated using REST API</description>
    <position y="50.0" x="100.0"/>
    <input/>
    <output/>
.
.
.
  • Go to PUT request and provide parameters, id and updated body content. Click Execute.
  • You should see the updated description in the workflow.

Now you can easily automate this to create an action or Workflow where you can simply pass all the IDs of all workflows to update and the Description as well. Let me know in the comment if you want me to create a workflow for this.

That’s it in this post. You can check this question in the VMTN Community for which I have created this post. Don’t forget to subscribe.