Hi,
I try to update the host dependencies by API.
curl --cacert /etc/apache2/ssl.crt/ca.crt -sS -X PATCH -d '{"field": "dependency_parent_hostname","data":"PARENT_HOSTNAME"}' -H 'X-Auth-Token:MY_TOKEN' 'https://MY_SERVER_URL/api/v0/devices/HOSTNAME_RECIEVING_THE_PARENT' { "status": "ok", "message": "Device dependency_parent_hostname field has been updated" }
When I look into the host object, nothing hast changed.
What’s wrong?
The validate.php - Output:
https://p.libren.ms/view/fe6245cd
EDIT:
I just found out
- even if You use non-existing fieldnames in the { }-construct, You always get the status “ok” and the message “Device DIRDARIQUATSCH field has been updates”
- parent-child dependencies are kept in a separate table;
So I guess:
- the API is broken when it comes to updating fields
- I would have to update that separate tabel
Is there a way to do that with an API call?