ScottLaser
Contributor
Contributor

vRO Swagger workflow execution data example

Working with Swagger to execute a workflow.  When the body = {}, the workflow succeeds with a 202 response.  Using the example in Swagger and other posts I have found, I expected:  '{"parameters": [{"name":"vmName","type":"string","value":{"text":"testVm1"}}]}'  to work.  A 400 response code is returned.  Any help would be appreciated.

0 Kudos
2 Replies
ScottLaser
Contributor
Contributor

Switched the body to xml in my java code and got it work with a 202 response code.  Would be nice to know how to do it in JSON.

String xml = new StringBuilder()
.append('<execution-context xmlns="http://www.vmware.com/vco">\n' +
' <parameters>\n' +
' <parameter name="vmName" type="string">\n' +
' <string>' + vmName + '</string>\n' +
' </parameter>\n' +
' </parameters>\n' +
'</execution-context>').toString()

 

0 Kudos
xian_
Expert
Expert

Just ran a WF from the GUI, the payload was:

{
  "parameters": [
    {
      "name": "projectID",
      "type": "string",
      "value": {
        "string": {
          "value": "str1"
        }
      }
    },
    {
      "name": "category",
      "type": "string",
      "value": {
        "string": {
          "value": "str2"
        }
      }
    }
  ],
  "profilerOptions": {
    "enabled": true,
    "debuggerEnabled": false,
    "tokenReplayEnabled": false
  }
}