Introducing SOC Insights for BloxOne Threat Defense: Boost your SOC efficiency with AI-driven insights to eliminate manual work and accelerate investigation and response times. Read the blog announcement here.

API Examples

Reply

REST API call - Getting subnet from IP

Techie
Posts: 10
2166     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: 289
2166     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: 10
2166     0

Thank you @MattR for the prompt response!

Showing results for 
Search instead for 
Did you mean: 

Recommended for You