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
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.
If you request the Catalog Item, then you should see the automatically generated Deployment Name with the correct locale time.