Clubbing Device Information Using REST API
Hi,
I am stuck with some strange and need your suggestion.
I had run a discovery on a particular node using IPMI method and it could fetch the serial number which other way was not possible on these particular OS (Customized Linux Distro), it's masked, `dmidecode` can not get it, `ipmitool` can.
Now that I have a discovered device with the serial number, IPMI MAC and IPMI IP, no device name and I want to update the Device Name using REST API.
I am trying to use the method mentioned here https://api.device42.com/#update-device-by-name-id-serial-or-asset which looks for either of these name, serial, asset or device_id.
curl -X PUT -d "serial=<serialnumber>&name=DEVICENAME" -u 'admin:adm!nd42' https://yourdevice42address/api/1.0/device/ --insecure
This HTTPS request above gives me {"msg": "device not found", "code": 0}.
Please help.
Thanks,
Dhiman
-
Found it here https://api.device42.com/#create-update-device-by-name
curl -X POST \
'https://device42server/api/1.0/device/?serial_no=<serialnumber>' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'cache-control: no-cache' \
-d 'name=OLDNAME&new_name=<devicename>'0
Please sign in to leave a comment.
Comments
1 comment