Reply

REST API call - Getting subnet from IP

Techie
Posts: 11
3991     0

Is there a WAPI REST API call to get the subnet for an IP address?

 

Thanks in advance.

Re: REST API call - Getting subnet from IP

[ Edited ]
Moderator
Moderator
Posts: 315
3991     0

Yes, request the ipv4address object, and ask for the network field:

 

curl -k1 -u admin:infoblox -X GET 'https://gm.example.com/wapi/v2.11/ipv4address?ip_address=192.168.2.1&_return_fields=network'

which returns:

[
    {
        "_ref": "ipv4address/Li5pcHY0X2FkZHJlc3MkMTkyLjE2OC4yLjEvMA:192.168.2.1", 
        "network": "192.168.2.0/24"
    }
]

Re: REST API call - Getting subnet from IP

Techie
Posts: 11
3991     0

Thank you @MattR for the prompt response!

Showing results for 
Search instead for 
Did you mean: 

Recommended for You