mirror of
https://github.com/jbowdre/vRealize.git
synced 2024-12-12 08:52:20 +00:00
update workflow
This commit is contained in:
parent
cdef3e72d3
commit
816dfa4e14
2 changed files with 22 additions and 0 deletions
|
@ -0,0 +1,10 @@
|
||||||
|
/* JavaScript: unpack payload
|
||||||
|
Extracts needed variables from the vRA inputProperties
|
||||||
|
Inputs: inputProperties (Properties)
|
||||||
|
Outputs: originalNames (Array/string), domain (string), nameBase (string), endpointId (string), digits (number)
|
||||||
|
*/
|
||||||
|
nameBase = inputProperties.customProperties.nameBase;
|
||||||
|
originalNames = inputProperties.resourceNames;
|
||||||
|
domain = inputProperties.customProperties.domain;
|
||||||
|
endpointId = inputProperties.endpointId;
|
||||||
|
digits = inputProperties.customProperties.digits;
|
|
@ -0,0 +1,12 @@
|
||||||
|
/* JavaScript: get vCenterName
|
||||||
|
Queries vRA to match the vCenter endpointId to a fully-qualified name, which gets returned to vRA as a customProperty on the deployment and also passed to subsequent workflow tasks
|
||||||
|
Inputs: endpointId (string)
|
||||||
|
Outputs: customProperties (Properties), vCenterName (string)
|
||||||
|
*/
|
||||||
|
var cloudAccountId = null;
|
||||||
|
var token = System.getModule("com.virtuallypotato.utility").vraLogin();
|
||||||
|
vCenterName = JSON.parse(System.getModule("com.virtuallypotato.utility").vraExecute(token, "GET", "/iaas/api/cloud-accounts-vsphere/" + endpointId, null)).hostName;
|
||||||
|
System.getModule("com.virtuallypotato.utility").vraLogout(token);
|
||||||
|
System.debug("Found vCenter: " + vCenterName);
|
||||||
|
customProperties = new Properties();
|
||||||
|
customProperties.put("vCenter", vCenterName);
|
Loading…
Reference in a new issue