nsot icon indicating copy to clipboard operation
nsot copied to clipboard

Properly handle partial update of resource attributes in PATCH requests

Open jathanism opened this issue 9 years ago • 2 comments

For Resource objects (Device, Network, Interface) that are able to have attributes, attributes need to be properly handled.

We should be able to specify a dict of only attributes that we wish to change and have the API properly reconcile them on a PATCH request.

For PUT requests, everything is working as intended. For reference internally, a PATCH request is a an update with the partial=True flag set, where PUT is an update with partial=False.

jathanism avatar Feb 17 '16 18:02 jathanism

The correct solution involves moving all of the attribute "patching" from the pynsot.app.App.process_attributes() method into the NSoT backend.

This way, the API can do the right thing with regard to PATCH requests, and pynsot can become even dumber, which is a good thing.

jathanism avatar Feb 19 '16 22:02 jathanism

PATCH support was added to API in #155. Now we can talk about partial updates of attributes, if that's still a desirable feature.

jathanism avatar Feb 24 '16 15:02 jathanism