I am relatively new to Knime, and am having issues pulling data out of Sumo Logic via their REST API. I can do it successfully in python, but I’m having issues getting a POST workflow to work in KNIME.
API details can be found here
The API flow is I submit an initial POST request with a data payload and authenticate, the API responds with some data that includes a URL for my submitted Sumo query and a cookie that will be used for all additional requests. Once I get the URL back I continue to check the returned URL(using the cookie so I don’t get load balanced to a backend server that doesn’t have my submitted job) until the status is marked as complete. I then can start downloading the data, which typically requires paging.
So far I have:
"POST Request" --> "JSON To Table"
Which works, and I can see the returned URL for checking my submitted job’s status, however I can’t figure out how to grab the cookie that is returned so that I can check the URL using that cookie.
How do I get the cookie from the initial POST Request so that I can use it to make an another POST Request using the URL that was returned from the 1st POST?
In the world of Python I would do the following:
rPOST = requests.post(SUMOurl, auth=(uname, passwd), data=json_data, headers=headers)
JobURL = str(json.loads(rPOST.text)[u’link’][u’href’])
CookieMonster = rPOST.cookies
Then later grab my data with:
rGET = requests.get(JobURL , auth=(uname, passwd), cookies=CookieMonster ))
How do I recreate that python code in a Knime workflow? Other than using a Python extension node to do it