IPAM IPv4 DHCP options python script

[ Edited ]
Posts: 2
3252     0

IPv4 DHCP Options.PNGMember Assignment.PNG


I am trying to write a script in Pyhton using API Calls. I want to set following parameters: Lease time, Routers, Domain Name, DNS Servers and I have two members to assign for multiple networks in IPAM. Is this possible and could someone give me an example? I searched through the documentation but didn't find examples nor do I know how those parameters are called. Thanks in advance!

Re: IPAM IPv4 DHCP options python script

Posts: 18
3253     0



I believe you are looking for the below API calls (using curl examples):


1. To call the mentioned object parameters (Lease time, DNS Servers, Domain Name, Routers and Members):


curl -k -u admin:infoblox -X GET https://infoblox.local/wapi/v2.7/network?_return_fields%2B=options,members


2. To modify the parameters using API (with curl):


curl -k -u admin:infoblox -X PUT https://infoblox.local/wapi/v2.7/network/ZG5zLm5ldHdvcmskMS4xLjEwLjAvMjQvMA: -d '{"options":[{"name": "dhcp-lease-time","use_option": true,"value":"7777"},{"name": "domain-name-servers", "use_option": true, "value": ","},{"name": "domain-name", "use_option": true, "value": ""},{"name": "routers", "use_option": true, "value": ""}], "members":[{"_struct":"dhcpmember","ipv4addr":""}]}' -H "content-type: application/json"



Hope this helps.



Showing results for 
Search instead for 
Did you mean: 

Recommended for You

Businesses are investing heavily into securing company resources from cyber-attacks form cybercrimin