Task Name | Converting Variables in UCSD |
Description |
|
Prerequisites | - Tested on 5.3
|
Category | Workflow |
Components | vSphere 5.x |
User Inputs | |
Instructions for Regular Workflow Use:
- Download the attached .ZIP file below to your computer. *Remember the location of the saved file on your computer.
- Unzip the file on your computer. Should end up with a .WFD file.
- Log in to UCS Director as a user that has "system-admin" privileges.
- Navigate to "Policies-->Orchestration" and click on "Import".
- Click "Browse" and navigate to the location on your computer where the .WFD file resides. Choose the .WFD file and click "Open".
- Click "Upload" and then "OK" once the file upload is completed. Then click "Next".
- Click the "Select" button next to "Import Workflows". Click the "Check All" button to check all checkboxes and then the "Select" button.
- Click "Submit".
- A new folder should appear in "Policies-->Orchestration" that contains the imported workflow. You will now need to update the included tasks with information about the specific environment.
This examples shows ho to convert a generic Text to a VLAN ID variable.
The custom task:

The Generic Input Text:

The VLAN ID output varaible:

The Script in the Custom Task:
importPackage(java.util);
importPackage(java.lang);
importPackage(java.io);
importPackage(com.cloupia.model.cEvent.notify);
importPackage(com.cloupia.model.cIM);
importPackage(com.cloupia.lib.util.mail);
importPackage(com.cloupia.fw.objstore);
importPackage(com.cloupia.lib.util.managedreports);
var a1 = input.A;
logger.addInfo("a1 ; " + a1);
output.A_Prime = a1;
The use of the Custom task:
The workflow:

The input is generic text:

Now using a task that has a VLAN ID as input the output of the custom task does show up:

The workflow:

The actual content of the variable may be another problem…
So for example …
If variable A has a content of A@B@C@D
But variable B expects some format like D@B@A
Then you would have to massage the input (A) to be of the expected format for variable (B).
Tthere are usually two parts to this…
1) Variable type
2) Content of the variable..
As to 1)
https://communities.cisco.com/docs/DOC-56419
#173
As to 2)
https://communities.cisco.com/docs/DOC-56419
#229
#282
#123 (building of the vSwitch name buried in the code)