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.

Create VdcTemplate using vRO Workflow

Table of Content

What is VDC Template?

A VDC template (vRO Class: VclVMWVdcTemplate) specifies a configuration for an organization VDC and, optionally, an Edge Gateway and organization VDC network. System administrators who want to enable organization administrators to create these resources in their organization can create VDC templates and share them with those organizations.

Advantage

By creating and sharing VDC templates, system administrator can enable self-service provisioning of organization VDCs while retaining administrative control over allocation of system resources such as Provider VDCs and external networks. Organization administrators, or any role that has rights to view and instantiate VDC templates, use an instantiation operation to create organization VDCs from templates. 

My Concern

I realized that Cloud Director plugin for vRO does not come with a workflow to create vdc templates, though comes with workflows for deletion and updation of vdcTemplates and I had a customer requirement to create one. So I and my good friend, Harshit Kesharwani have created one such workflow and would like to share it with you.

Download vRO Package here

What’s inside workflow package?

In this package, you will find 1 major Workflow “Create a VdcTemplate and Add to all Organizations” which creates a property of inputs based on various inputs required to create a vdcTemplate like pVDC, Allocation model (AllocationVapp, AllocationPool, ReservationPool & Flex) and corresponding memory & CPU inputs as well as edge gateway and storage related inputs. There as several actions that are being utilized in this workflow.

Basic flow of this workflow includes validating all the inputs, get Bearer token, check if there is no existing template with same name and then, using REST calls, create a vdcTemplate and add them to all the organizations of your vCD.

If there is any problem or assistance required, feel free to create a issue here. Thank you. See you on other posts.

A 5-min crash course on VdcTemplate

Reference Links