- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
WAPI (Web API) Sample Code for NIOS
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2015 03:36 PM - edited 08-10-2015 04:04 PM
Sample code showing how to use the WAPI (Web API) for NIOS in various languages. These samples include Java, Python and Javascript.
Re: WAPI (Web API) Sample Code for NIOS
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2016 10:25 AM - edited 03-17-2016 11:47 AM
I've been looking through the javascript sample code you provided and it looks like a great starter. However, there's nowhere that I can see that you're defining/creating a connection to the WAPI (similar to what was done in the python version), i.e. hostname, username, password, etc. Is there a file missing? Or is this an exercise for the user?
You're also using ExtJS in the extjs-example, but it's not included in the zip download, so users will need to find a copy and put it in the right place in order for any of this to work.
Thanks again for the great jumpstart, and if you could answer my question about the WAPI connection settings that would be great.
Re: WAPI (Web API) Sample Code for NIOS
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2016 12:47 PM
I have the trial Infoblox DDI software loaded on Ravello, and I am trying to use these examples or the examples from the online WAPI course, and I keep getting errors. Does the trial software include WAPI support? If so, are there some configuration parameters required to activate it?
Re: WAPI (Web API) Sample Code for NIOS
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2017 05:14 PM
@mlane706 wrote:I have the trial Infoblox DDI software loaded on Ravello, and I am trying to use these examples or the examples from the online WAPI course, and I keep getting errors. Does the trial software include WAPI support? If so, are there some configuration parameters required to activate it?
I know that this is an old post but just wanted to add something in case anyone else runs across this. To confirm- there are no extra requirements when using the trial version, with the main difference being that it will use temporary license keys which are only valid for 60 days. If any errors are encountered, I would recommend starting a new thread in the forums and posting both the sample code that you are attempting to use, along with any errors that you are seeing.
Regards,
Tony
Re: WAPI (Web API) Sample Code for NIOS
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2017 05:14 AM
Hello Eric,
The code samples are a great starting point.
I'm using the java-wapi-client-V1.1.zip.
Can you help with invoking a 'delete' operation?
I've tried:
- -input json -d'{"_ref":"record:a/REF_HASH:myfoo.mysite.com/default"}' - failed
- -d "record:a/REF_HASH:myfoo.mysite.com/default" -> urlencoded, failed
The error is alwatys the same:
{ "Error": "AdmConProtoError: Object ref must be given for DELETE: record:a", "code": "Client.Ibap.Proto", "text": "Object ref must be given for DELETE: record:a"}
Thank you in advance,
Jorden
Re: WAPI (Web API) Sample Code for NIOS
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2017 05:32 AM - edited 08-27-2017 01:45 AM
UPDATE: I missed the '-r' flag, reverted the code change.
I think I've found the issue.
Debugging the flow, I found the in OperationType.DELETE.performOperation, the 'params' string wasn't passed to the 'dao.delete()' method call.
Best,
Jorden
Re: WAPI (Web API) Sample Code for NIOS
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2021 12:46 PM - edited 11-01-2022 10:46 AM
Hi, I've used the Python samples to start building my own scripts. I use Postman a lot to work on the queries and output then I move my queries to Python 3 requests. I mostly use it for quick validations and most of the time I format the JSON in Pandas DataFrames (easier to pivot, filter, order...).
Let's say I want to get ip addresses inside a network (10.148.64.0/25), but I would like to receive only the ones where
"status": "USED"
The URL is this one to query the IPs in the Network
https://{{grid_master}}/wapi/v2.11.2/ipv4address?network=10.148.64.0/25&_return_fields%2b=ip_address,status
But from the WAPI documentation the field status is searchable. Where would this criteria be added in the URL? I finally figured this one out: the filter [&status=USED] should be added at the end of the URL like this.
https://{{grid_master}}/wapi/v2.11.2/ipv4address?network=10.148.64.0/25&_return_fields%2b=ip_address,status&status=USED