THE GAME HAS CHANGED

Introducing Infoblox Universal DDI ManagementTM

Watch the launch to discover the new era of management for critical network services. Watch Now

API Examples

Reply

REST API call - Getting subnet from IP

Techie
Posts: 11
4500     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: 321
4501     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
4501     0

Thank you @MattR for the prompt response!

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