- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Please help : How to get all the unused IP's from a subnet
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2019 11:38 AM
Hi Everyone,
I understand that you can fetch unused IP's from a subnet by API call like:
curl -k1 -u testuser -X GET 'https://10.10.100.51/wapi/v1.4/ipv4address?network=10.10.10.0/24&status=UNUSED'
But if I replace value of status from Unused to used or to an extensible attribute ( status) value like Blocked
In the below code as suggested by you, if i change the status to USED or to an extrensible attribute value as status=blocked, will the api give me used ip address and blocked ip address respectively ??
Re: Please help : How to get all the unused IP's from a subnet
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2019 06:28 AM
The status values for an IP address are either "USED" or "UNUSED". The "USED" status indicates there is an object of some sort associated with the IP address.
EAs are stored on objects (such as hosts, fixedaddrs, networks, etc) , not on IP addresses. When you search for EA values on an IP address ytou get matches for objects associated with that address.
It's a ssubtle diffference but important to understand.
You can search for IPs where the value of an EA is "blocked". You would need to know which EA holds the value. To keep yourself from getting confused, don't call the EA "stauts"! Call it somehting else instead. Perhaps "Condition".
And you would not need to specify status = USED because the presense of an object on that address implies that the state is USED.
curl -k1 -u admin:infoblox -X GET 'https://192.16.1.2/wapi/v2.8/ipv4address' -d 'network=192.168.1.0/24&*Conditon:=BLOCKED' -d '_return_fields%2b=status,extattrs'
Re: Please help : How to get all the unused IP's from a subnet
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2019 10:04 AM
Thanks Richard. That explains a lot.