PATCH Request on core-metadata failing #40
-
|
Hi Team, My core-metadata version is: 2.1.1 and I am unable to send PATCH request successfully to update an existing devices attribute. I have a existing device which I can get using core-metadata REST API {{Hostname}}:59881/api/v2/device/name/Temp-Device01: Now lets say I need to update description of the device and adminState so I sent below PATCH request to core-metadata using Postman: PATCH: {{Hostname}}:59881/api/v2/device Body I have set to RAW : JSON which looks as below: I get below response when I sent above PATCH request: In core-metadata logs I see similar error: Then I happened to have a look at this UpdateDevice Struct Could you please help me out on where I could be going wrong. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
It was my bad I am making incorrect JSON body, device is an object and not an array of objects, by mistake I have made device as array and inside that I put device object. With below Update it works fine: Body I have set to RAW : JSON which looks as below: |
Beta Was this translation helpful? Give feedback.
It was my bad I am making incorrect JSON body, device is an object and not an array of objects, by mistake I have made device as array and inside that I put device object.
With below Update it works fine:
PATCH: {{Hostname}}:59881/api/v2/device
Body I have set to RAW : JSON which looks as below: