Frequent Advisor
Re: Call HPOO Workflow through webservice?

Hi All,

 

Please find the script which may useful to you.Please first resolve the SSL connectivity and then you can use this script.

 

function ExecuteFlow(flowname,file)
{
if (flowname == "qprm")
{
var UUID = "e2e863c8-988e-490c-8fbc-c9360afe6b75";
executeQPRMFlow(UUID,file);
}
if (flowname == "ddmiagent")
{
var UUID = "360a76a7-423a-420a-bbe2-1951229d7d2c";
executeDDmiAgent(UUID,file);
}
}
var url_standard = "https://<OOserver url>/PAS/services/rest/run_async/";

function executeQPRMFlow(UUID,file)
{
var url = url_standard + UUID + "?username=hussain&password=milap123&";

url += "strHostIP=" + file.oo_vc_host_ip
+ "&strVMName=" + file.oo_vm_hostname


if(makehttpRequest(url))
{
file.gm_oo_flag = true;
file.doUpdate();
}

}

function executeDDmiAgent(UUID,file)
{
var url = url_standard + UUID + "?username=hussain&password=milap123&";
}

function makehttpRequest(url)
{
var headers = new Array();
try{
print(url);
var WSDLresponse = doHTTPRequest( "POST", url, headers,10,10,10);
print(WSDLresponse);
return true;
}
catch( e )
{
print("There is some internal error try after sometime or provide the service manually");
return false;
}
}

 

Warm regards,

Milap