Reply

API to get IPv4 Network(BOOTP/PXE) information

jankit
Techie
Posts: 1
209     0

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

MRichard Community Manager
Community Manager
Posts: 101
210     0

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

jh
Techie
Posts: 1
210     0

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

MRichard Community Manager
Community Manager
Posts: 101
210     0

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.

Showing results for 
Search instead for 
Do you mean 

Recommended for You