WAPI (Web API) Sample Code for NIOS

Sample code showing how to use the WAPI (Web API) for NIOS in various languages. These samples include Java, Python and Javascript. 

Tagged:

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • 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. 

  • 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?

  • Thanks for sharing!


  • @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

  • 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

  • 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

  • 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+=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+=ip_address,status&status=USED

     

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.