Create automatically a vRealize Automation Deployment Name with locale Date and Time

In this blog post I will show you how you can create automatically a vRealize Automation Deployment name which contains the local Date and Time and makes the Deployment name unique. How you get the local Unix Time with the JavaScript Module “moments” you can reach out the blog Convert the vRO Date with the “moments” Java Script Library.

Prerequisites

  • Installed and configured vRealize Automation and vRealize Orchestrator 8.x
  • The package with the needed actions below
  • A vRealize Automation custom form where we want to create the deployment name with a vRealize Orchestrator action

Download the package

Rename the extension from zip to package and import it into the vRealize Orchestrator.

The actions are stored under the module “com.vmware.pso.util”

The package contains two actions and one configuration Element. In the configuration Element you have to define your vRealize Automation Host as shown below.

The vRA Host should be connected as shared session.

Now you have to create a action which returns the locale Date/Time for you Deployment name:

The action needs no input, but we will define one that we can define a post value.

Create an action with one Input called preValue as string.

if(preValue){
    var localeDate = System.getModule("com.vmware.pso.util").getLocaleDate()
    return preValue + " - " + localeDate
}
return System.getModule("com.vmware.pso.util").getLocaleDate()

Now we can add this action to a custom form.

  • Open a custom form
  • enable it
  • mark the Deployment Name field
  • go to Values
  • add the previous created action
  • bind the pre Deployment Name field to the action input

If you request the Catalog Item, then you should see the automatically generated Deployment Name with the correct locale time.

Similar Posts

Leave a Reply

Your email address will not be published.

WC Captcha − 2 = 3