Hi,
I have been working on a few python tools that use the NiFi Rest API to do
a few checks and commands here and there. Since the goal is mainly
monitoring, stopping a processor is a very useful tool. In the previous
version of the API (~0.7) I managed this by creating a dictionary with
purely the processor ID, and the new state (or other parameter I wished to
update), and then I encoded it and made my put request to the right link.
This approach seems to no longer function in v1.0. I have tried create a
small python dictionary to PUT to the server, but I keep on getting more
and more errors, culminating in:
<Response [400]>
The processor id (null) in the request body does not equal the processor id
of the requested resource (d70f5d7d-0157-1000-ffff-ffff80a4d2d7).
Here is what is contained in my request:
update = \
{
"revision": {
"version": processor["revision"]["version"] + 1
},
"id": processor["id"],
"status": {
"aggregateSnapshot": {
"runStatus": "Stopped",
"id": processor["id"]
}
},
"component": {
"state": "STOPPED"
}
}
I am pretty sure my PUT request is correct, and that the problem is
coming from lack or excess of data in my request.
If anyone has managed to achieve starting/stopping processors with the
new API, I would be grateful for the help!
Thanks a lot