02-16-2015 02:51 PM - edited 03-01-2019 06:33 AM
Task Name | Convert vDC name to vDC ID |
Description | |
Prerequisites |
|
Category | Workflow |
Components | vSphere 5.x |
User Inputs |
Instructions for Regular Workflow Use:
Workflow Input:
The Log File:
The Clopia Script:
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 searchVDC = [ ctxt.getInput("SearchVDC") ];
function VDCName2VDCid(P1) {
var networkPolicyReport = ctxt.getAPI().userAPIFilterTabularReport("10","null","VDC-T45","vDC_Name",P1);
logger.addInfo("vdc networkPolicyReport = " + networkPolicyReport);
var policyList = networkPolicyReport.rows;
logger.addInfo("policyList = " + policyList);
if(policyList != null && policyList.size() > 0){
var map = networkPolicyReport.getRow(0);
logger.addInfo("VDC_ID = " + map.get("vDC_ID"));
}
return map.get("vDC_ID");
}
var x = VDCName2VDCid(searchVDC);
logger.addInfo("VDC_ID = " + x);
When i'm running this task using admin user it works fine, when i try to execute it inside a WF using a non admin user i'm getting error message about privilege
I'm using UCSD6
--- Nov 05, 2016 18:52:50 UTC Task: getIP-phpIPAM (custom_VDC_ID_2_VDC_Name) failed with error - java.lang.RuntimeException: java.lang.Exception: No such report exists or user does not have access privileges: VDC-T45, selectedContext=<None>
---- Nov 05, 2016 18:52:50 UTC Task #2 (getIP-phpIPAM (custom_VDC_ID_2_VDC_Name)) failed after 1 seconds
Update
Solved it with change initiating user task
I have a task out there that swaps user swap to admin I your workflow
I needed exactly this workflow for my customer. Great Job Orf
I am glad it is working.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: