Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

JSON usage with vCO 5.1 REST API

$
0
0

I'm trying to develop a simple REST client to execute a workflow in vCO.  I'm using perl and the REST::Client module, which is pretty straight forward.  I can retrieve the inventory and definition objects for my target workflow, but when I try to POST an execution, I get an error report back stating:

 

The request sent by the client was syntactically incorrect ().

 

I am using JSON (as that is both the default output from vCO if no Content-Type is specified and my personal preference), and the documentation on JSON formatting is quite sparse compared to the supplied XML documentation.  The docs describe the execution-context as follows:

 

{"parameters":[{"name":"...","type":"...","description":"...","scope":"local","value":{}},...]}

 

My workflow accepts two string parameters for input and returns one string parameter as output.  I've read that the scope and description fields are optional, and I am omitting both.  Clearly however, I am missing something necessary about the structure of the execution-context.  Can anyone help shed some light on this?

 

Full debugging:

 

 

Accept: application/json
Accept-Encoding: gzip, x-gzip, deflate, x-bzip2
Authorization: *******
User-Agent: REST::Client/249
Content-Length: 137
Content-Type: application/json
{"parameters":[{"value":"10.0.0.0/24","name":"network","type":"string"},{"value":"test-hostname.dom","name":"hostname","type":"string"}]}

HTTP/1.1 400 Bad Request
Connection: close
Date: Wed, 05 Dec 2012 19:01:11 GMT
Server: vCO Server
Content-Length: 965
Content-Type: text/html;charset=utf-8
Client-Date: Wed, 05 Dec 2012 19:06:21 GMT
Client-Peer: ******:8281
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /C=US/O=VMware/OU=VMware/CN=localhost.localdom
Client-SSL-Cert-Subject: /C=US/O=VMware/OU=VMware/CN=localhost.localdom
Client-SSL-Cipher: DHE-RSA-AES256-SHA
Client-SSL-Socket-Class: IO::Socket::SSL
Client-SSL-Warning: Peer certificate not verified
Title: JBossWeb/2.0.1.GA - Error report


<html><head><title>JBossWeb/2.0.1.GA - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 400 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The request sent by the client was syntactically incorrect ().</u></p><HR size="1" noshade="noshade"><h3>JBossWeb/2.0.1.GA</h3></body></html>


Viewing all articles
Browse latest Browse all 6251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>