Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
REST API call - Getting subnet from IP
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 04:44 PM
3883     1
Is there a WAPI REST API call to get the subnet for an IP address?
Thanks in advance.
Solved! Go to Solution.
Labels:
Re: REST API call - Getting subnet from IP
[ Edited ]Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2023 06:18 AM - edited 09-29-2023 06:19 AM
3883     1
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
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2023 08:21 AM
3884     1
Thank you @MattR for the prompt response!