- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
WAPI DNS & Next IP reserve
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
07-18-2017 11:24 PM
I am new to this API and find the documentation to be very comlex, missing standard JSON schema for objects. I'm a little confused on using the WAPI to complete a DNS & next IP reservation.
Does anyone have an example of this?
Is it done in two parts or can it be done by just using the /wapi/v.x.x/record:host?
How does one initiate a login, etc?
Your help is much appreciated!
Solved! Go to Solution.
Re: WAPI DNS & Next IP reserve
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
07-18-2017 11:32 PM
Here is a curl example using the function nextavialableip().
curl -k -u admin:infoblox -H "Content-Type: application/json" -X POST https://192.168.0.12/wapi/v1.4/record:host?_return_fields=ipv4addrs -d '{ "name":"host66.test.net", "ipv4addrs":[{"ipv4addr":"func:nextavailableip:192.168.32.0/24", "mac":"cafedeadbeef"}]}'
When xou add ?return_fields=ipv4addrs then you get immediatelly back the IP of the new object.
Obviously, you need to add this into any script or orchestration tool.
HTH.
Re: WAPI DNS & Next IP reserve
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
07-18-2017 11:55 PM
Thanks for the fast response. The version of my API is 2.6, would that differ much or should the example you provide be compatible? Also, can this work in a subzone, example hostname1.phone.lab.domain.net ?
Re: WAPI DNS & Next IP reserve
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
07-19-2017 12:15 AM
@thefilmguy wrote:
Thanks for the fast response. The version of my API is 2.6, would that differ much or should the example you provide be compatible? Also, can this work in a subzone, example hostname1.phone.lab.domain.net ?
It will be compatible.
Just for complete reference, your GM also has next to the 2.6 also still the older versions available (1.0, 1.2, 1.3 etc).
Of course, it will also work with subzones, as long as they are added as Authoritative Zones on the Grid and you need to use the full FQDN for adding the record.
Re: WAPI DNS & Next IP reserve
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
07-19-2017 10:04 PM
Thank you. Turns out the view needed to be defined.
curl -k1 -u admin:infobloxpw! -H "Content-Type: application/json" \ -X POST https://10.10.1.12/wapi/v2.6/record:host -d \ '{ "ipv4addrs":[{"ipv4addr":"func:nextavailableip:'$NETWORK'/21","mac":"'$MACADDRESS'"}], "name":"'$HOSTNAME'", "view": "default" }'