Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-8521

Documentation for the Requisition ReST API is confusing




      The documentation says that you should use POST for adding elements to the requisition, and PUT for change elements on the requisitions.

      This is true, but not fully accurate.

      With POST, if you push a new node it will be added if it doesn't exist, but if there is already a node with the given foreignID, it will be updated (that's how the new Requisitions UI uses for updating nodes). So, that means, with POST you can add or update elements on requisitions.

      The other important fact is that you can use XML when dealing with POST.

      On the other hand, with PUT you can indeed only perform changes, but you cannot send XML, you have to use a form-url-encoded. This use case might be useful for some people, but not for others (which is why the new Provisioning UI doesn't use it).

      It is important to clarify which kind of data is expected on each HTTP request.

      Here is my proposal:

      • Mention that you can add/update elements with POST using XML
      • Mention that you can only update elements with PUT using form-url-encoded.




            • Assignee:
              agalue Alejandro Galue
              agalue Alejandro Galue
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created: