06-22-2018 07:42 AM - edited 03-01-2019 06:27 AM
Hi,
I have added UCSD (as a REST host with API access key) in vRealize orchestrator and is invoking a REST host command. The workflow runs successfully in vRO, but doesnot create a new service request (as it suppose to) in UCSD for new VM creation. The worksflow script is
var operationUrl = "/app/api/rest?formatType=json&opName=userAPISubmitServiceRequest&opData=%7Bparam0:'CentOS7',param1:'BSC&vDC',param2:1,param3:-1,param4:1,param5:'Provisioning%20VM%20from%20vRA'%7D"
var requestType = "POST"
System.log("Host: " + restHost + ", operation: " + operationUrl + ", Request Type: " + requestType);
var request = restHost.createRequest(requestType, operationUrl);
request.setHeader("X-Cloupia-Request-Key","XXXXXX");
System.log("request: " + request.fullUrl);
var response = request.execute();
System.log("response: " + response.contentAsString);
result = new Properties();
result.put("statusCode", response.statusCode);
result.put("contentLength", response.contentLength);
result.put("headers", response.getAllHeaders());
result.put("contentAsString", response.contentAsString);
Here are the orchestrator workflow logs
[2018-06-22 09:22:22.673] [I] Host: DynamicWrapper (Instance) : [RESTHost]-[class com.vmware.o11n.plugin.rest.RESTHost] -- VALUE : RESTHost [name=UCSDirector, id=9b1024f4-0e50-4e01-bb73-98bad7be38dc, url=https://bscccucsd.sentinelbsc.com, connectionTimeout=30, operationTimeout=1200, hostVerification=false, proxyHost=, proxyPort=0, schemaRepo=com.vmware.o11n.plugin.rest.schema.SchemaRespository@18152643, resourceId=null, privateKeyId=null], operation: /app/api/rest?formatType=json&opName=userAPISubmitServiceRequest&opData=%7Bparam0:'CentOS7',param1:'BSC&vDC',param2:1,param3:-1,param4:1%7D, Request Type: undefined
[2018-06-22 09:22:22.675] [I] request: https://bscccucsd.sentinelbsc.com/app/api/rest?formatType=json&opName=userAPISubmitServiceRequest&opData=%7Bparam0:'CentOS7',param1:'BSC&vDC',param2:1,param3:-1,param4:1%7D
[2018-06-22 09:27:22.773] [I] response: { "serviceResponse":null, "serviceError":"SERVICE_CALL_EXCEPTION: Requested timeout", "serviceName":"InfraMgr", "opName":"userAPISubmitServiceRequest" }..
Any thoughts?
Thanks
Solved! Go to Solution.
06-22-2018 08:23 AM
A space/blank is a %20 not a &
I would rename your VDC or what ever you have with out spaces and special chars.
Can you make it work with the curl?
06-22-2018 08:09 AM
Try the curl command in here first…
https://communities.cisco.com/docs/DOC-55973
I would suspect the & (BSC&vDC)in your name is the issue… also spaces in nems are usually the issue…
06-22-2018 08:19 AM
I have verified the url with Postman..no issues..Added & for a blank in vDS name..Thanks
06-22-2018 08:23 AM
A space/blank is a %20 not a &
I would rename your VDC or what ever you have with out spaces and special chars.
Can you make it work with the curl?
06-22-2018 08:37 AM
Created a new vDC without special character and boom..it created a service request..Thanks for your help..
06-22-2018 08:41 AM
Awesome!
Yes I have struggled though this as well…
KISS
Keep it simply Simple
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide