-
Hello,
I would like to create a Host Address through the API that includes DHCP allocation.
I only have been able to create Host Adresseses marked as static. I have no issues setting the assignment I choose in the web interface.
The attribute "ipv4_assignment" only accepts the values in the dialog "IP: Assignment" () but regardless of the value I send, the Host Address is always static.This is one of my attempts to https://demo.i-doit.com
{ "version": "2.0", "method": "cmdb.category.save", "params": { "object": 1412, "category": "C__CATG__IP", "data": { "net": 20, "ipv4_assignment": "DHCP" }, "apikey": "c1ia5q", "language": "en" }, "id": 1 }
-
Hello @fa__,
you can set the dialog field "ipv4_assignment" via API but you need to add the net_type, too.
Like :{ "jsonrpc": "2.0", "method": "cmdb.category.save", "params": { "object": 1122546692, "category": "C__CATG__IP", "data": { "net_type": "IPv4 (Internet Protocol v4)", "net": 20, "ipv4_assignment": "DHCP" } }, "apikey": "apikey", "language": "en", "id": 1 }
-
Thanks @michael-overkamp!
It works fine.