{ "device_role": [ "This field is required." ], "site": [ "This field is required." ], "device_type": [ "This field is required." ]}
curl -X PUT -H "Authorization: Token ####" -H "Accept: application/json; indent=4" http://####/api/dcim/devices/424/ --data
'{"serial": "####"}'
--
You received this message because you are subscribed to the Google Groups "NetBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to netbox-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/d3a69de2-07f8-43cf-a7ca-a9a03c4560a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Use PATCH instead of PUT. PUT requires defining all required fields; PATCH updates an object in place.Jeremy
On Tue, Aug 29, 2017 at 10:03 PM, Jason Kopacko <ja...@kopacko.com> wrote:
I am wanting to do a bulk update on devices but I cannot seem to get the command correct. I get this error:{"device_role": ["This field is required."],"site": ["This field is required."],"device_type": ["This field is required."]}
So I know my ignorance to what I am doing is playing a big part but I cannot seem to pass all the required fields correctly.For example, the site is #21, the device_role is #1, and the device_type is #1 as well. Any advice or examples that give a full set of required options would be really nice.My base command looks like this:curl -X PUT -H "Authorization: Token ####" -H "Accept: application/json; indent=4" http://####/api/dcim/devices/424/ --data
For example, I'm trying to update the serial numbers.'{"serial": "####"}'
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups "NetBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discus...@googlegroups.com.
To post to this group, send email to netbox-...@googlegroups.com.
curl -X PATCH -H "Authorization: Token ####" -H "Accept: application/json; indent=4" http://####/api/dcim/devices/424/ --data '{ "serial": "####" }'