Search code examples
restrestful-urlapache-nifi

"The revision must be specified." error with status 400 Bad Request when delete controller-services and connections


I try export and import nifi templates via nifi rest api; but when i tried to delete controller-services, connections or import a template i get the response message "The revision must be specified." with '400 bad request' status from nifi rest api. I didn't understand what i have to do.

This my request for delete a control-service, request "/controller-services/{id}" (id is, The controller service id.)

curl -X DELETE \
http://localhost:8090/nifi-api/controller-services/015b1030-a099-13d3-812c-77772afcaeb0 \
-H 'cache-control: no-cache' \
-H 'content-type: application/x-www-form-urlencoded' \

and the response is "The revision must be specified." status : "400 Bad Request"

Any idea please?


Solution

  • I finally got some answers about my mistake after reading this article

    It seems you have to add two information to request url; version and clientId. After make a call and get a component form nifi instance, it sends a version number inside a DTO to you as explained here like this: enter image description here

    and finally i made a call like below and it worked:

    curl -X DELETE \
    'http://localhost:8090/nifi-api/controller-services/015b1030-a099-13d3-812c-77772afcaeb0?version=0&clientId=5ed15669-015d-1000-99cf-bc9c6f378085' \
    -H 'cache-control: no-cache' \
    -H 'content-type: application/x-www-form-urlencoded' \