mehmetue
mehmetue

Reputation: 33

Bluemix WorkLoad Scheduler Process creation REST API does not accept queryparameters and headers in restfulstep

I am using the Bluemix Workload Scheduler REST API to create Processes with a Scheduled Trigger having a oneTimeProperty and a startDate.
Additionally the json i am sending also has a restfulStep.
The issue i have is, that no matter how i provide the "queryParameters" and "headers" for the restfulStep, they are not accepted/configured in the process after the successful process creation.
Here is the json i am using:

{
  "name": "my process name",
  "processlibraryid": 1234,
  "processstatus": true,
  "triggers": [
    {
      "name": "Scheduled Trigger",
      "triggerType": "OnceTrigger",
      "oneTimeProperty": {
        "startDate": "TIMEVALUE"
       }
     }
  ],
  "steps": [
    {
      "restfulStep": {
        "agent": "AGENTNAME}",
        "action": {
          "uri": "MYCUSTOMURL",
          "contentType": "application/json",
          "method": "POST",
          "verifyHostname": true,
          "queryParameters": [
            ["param1", "value1"], 
            ["param2", "value2"]
          ],
          "headers": [
            ["param3", "param4"]
          ],
          "numberOfRetries": 3,
          "retryIntervalSeconds": 30
        },
        "authdata": {
          "username": "USERNAME",
          "password": "PASSWORD"
        },
        "input": {
          "input": "",
          "isFile": false
         }
        }  
      }
  ]
}

Upvotes: 0

Views: 47

Answers (2)

Andrea I
Andrea I

Reputation: 26

issue has been fixed with last Workload Scheduler upgrade. Could you try using a Json like the following?

{
  "name": "myname",
  "processlibraryid": <1234>,
  "processstatus": false,
  "triggers": [
    {
      "name": "Scheduled Trigger",
      "triggerType": "OnceTrigger",
      "oneTimeProperty": {
        "startDate": "2016-12-16T10:30:43.218Z"
       }
     }
  ],
  "steps": [
    {
      "restfulStep": {
        "agent": "<MY_AGENT_NAME>",
        "action": {
          "uri": "<MY_URL>",
          "contentType": "application/json",
          "method": "GET",
          "verifyHostname": true,
          "queryParameters": [
            ["param1", "value1"], 
            ["param2", "value2"]
          ],
          "headers": [            
            ["Accept", "application/json"],
            ["User-Agent",  "Mozilla/5.0 "]
          ],
          "numberOfRetries": 3,
          "retryIntervalSeconds": 30
        },
        "authdata": {
          "username": "USERNAME",
          "password": "PASSWORD"
        },
        "input": {
          "input": "",
          "isFile": false
         }
        }  
      }
  ]
}

Regards

Andrea I

Upvotes: 1

Andrea I
Andrea I

Reputation: 26

your json is correct but there is a little bug in Workload Scheduler service. A fix will be released by the end of December.

As workaround, you could use Application Lab in order to create your Restful step. In addition, you could append the queryParameters to your uri address. At the moment, there is no workarounds for headers.

If you find other issue using the service, do not hesitate to post your comments. Thanks!

Andrea I

Upvotes: 0

Related Questions