AnsweredAssumed Answered

Error when posting to StreamSets UpdateValuesAdHoc method

Question asked by Robert Raesemann on May 28, 2019
Latest reply on May 29, 2019 by Robert Raesemann

I'm hoping that I am just tired and that this is something simple that I'm just not catching.

 

I'm trying to call UpdateValuesAdHoc in the Streamsets controller through Python. This should be reasonably straightforward, but I am getting a response 400 when I try the code. 

 

 

url = f'{BASE_URL}/streamsets/recorded'
json_payload = json.dumps(data)
headers = {'Content-type': 'application/json'}
resp = requests.post(url, json=json_payload, auth=KERBEROS_AUTH, verify=False, headers=headers)

 

The error text is:

 

'{"Errors":["Error reading JArray from JsonReader. Current JsonReader item is not an array: String. Path \'\', line 1, position 1175."]}'

 

Here is my json payload that I am posting. I ran it through a validator and it looks fine and I don't see any difference from the sample in the API docs. Any ideas?

[{
"WebId": "F1DPEg6H3MbtaEKD_OvWG5RFuASQMAAAQ09SUC1QSVxST0JJTldPT0QuVFJBTlNGT1JNRVIxLlRPUF9PSUxfVEVNUA",
"Items": [{
"Timestamp": "2019-05-28T12:59:56",
"Value": 0.9293538422218297
}]
}, {
"WebId": "F1DPEg6H3MbtaEKD_OvWG5RFuARwMAAAQ09SUC1QSVxST0JJTldPT0QuVFJBTlNGT1JNRVIxLkxUQ19UQU5LX1RFTVA",
"Items": [{
"Timestamp": "2019-05-28T12:59:56",
"Value": 0.1313464249248395
}]
}, {
"WebId": "F1DPEg6H3MbtaEKD_OvWG5RFuASgMAAAQ09SUC1QSVxST0JJTldPT0QuVFJBTlNGT1JNRVIyLlRPUF9PSUxfVEVNUA",
"Items": [{
"Timestamp": "2019-05-28T12:59:56",
"Value": 0.9293538422218297
}]
}, {
"WebId": "F1DPEg6H3MbtaEKD_OvWG5RFuASAMAAAQ09SUC1QSVxST0JJTldPT0QuVFJBTlNGT1JNRVIyLkxUQ19UQU5LX1RFTVA",
"Items": [{
"Timestamp": "2019-05-28T12:59:56",
"Value": 0.1313464249248395
}]
}, {
"WebId": "F1DPEg6H3MbtaEKD_OvWG5RFuATAMAAAQ09SUC1QSVxST0JJTldPT0QuVFJBTlNGT1JNRVIzLlRPUF9PSUxfVEVNUA",
"Items": [{
"Timestamp": "2019-05-28T12:59:56",
"Value": 0.9293538422218297
}]
}, {
"WebId": "F1DPEg6H3MbtaEKD_OvWG5RFuASwMAAAQ09SUC1QSVxST0JJTldPT0QuVFJBTlNGT1JNRVIzLkxUQ19UQU5LX1RFTVA",
"Items": [{
"Timestamp": "2019-05-28T12:59:56",
"Value": 0.1313464249248395
}]
}]

Outcomes