- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
API to get IPv4 Network(BOOTP/PXE) information
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2019 10:14 PM
Hi All,
I am newbie, I am working on some integration where I need the IPv4 Network(IPv4 BOOTP/PXE) information, actually, I only need the next server IP from that.
Can anyone please let me know how I can get this information? Also is there any API to update the same?
Thanks in advance.
--
Ankit
Re: API to get IPv4 Network(BOOTP/PXE) information
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2019 06:32 AM
Here's an example to display some PXE/Bootp fields, and also the standard DHCP options field.
curl -k -u admin:infoblox -X GET 'https://192.168.1.2/wapi/v2.3/network' -d 'network=192.168.1.0/24' -d '_return_fields=options,bootfile,bootserver,nextserver'
returns::
[ { "_ref": "network/ZG5zLm5ldHdvcmskMTAuOS4xNi4wLzI0LzA:192.168.1.0/24/default", "bootfile": "pxeboot.com", "bootserver": "192.168.1.100", "nextserver": "192.168.1.100", "options": [ { "name": "dhcp-lease-time", "num": 51, "use_option": false, "value": "43200", "vendor_class": "DHCP" }, { "name": "routers", "num": 3, "use_option": true, "value": "192.168.1.1", "vendor_class": "DHCP" } ] } ]
To update a field, first get the reference for the network, which is shown above.
Then do a PUT call to update the bootserver and nextserver values:
curl -k -u admin:infoblox -H 'Content-Type: application/json' -X PUT https://192.168.1.2/wapi/v2.3/network/ZG5zLm5ldHdvcmskMTAuOS4xNi4wLzI0LzA:192.168.1.0/24/default -d \ '{ "bootserver": "192.168.1.101", "nextserver": "192.168.1.101" }'
Re: API to get IPv4 Network(BOOTP/PXE) information
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2019 03:53 AM
How can this curl call be modified to show only the value of network->options->dhcp-lease-time ?
I'm new to the API and are looking for an example to access a value inside of an array. Is it possible or do I have to post-proces the output for this value?
Re: API to get IPv4 Network(BOOTP/PXE) information
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2019 05:08 AM
The options are returned as an array, we cannot choose to return just one value. Also when writing any changes, the entire array must be sent. When sending the array, it overwrites the existing array with the one being sent.