Reply
Highlighted

WAPI (Web API) Sample Code for NIOS

[ Edited ]
Adviser
Posts: 267
13070     12

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

If you appreciate my efforts, please give me a kudo ↓ or Accept as solution to help others find it faster.

Re: WAPI (Web API) Sample Code for NIOS

[ Edited ]
elewis33
Techie
Posts: 2
13071     12

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

mlane706
Techie
Posts: 1
13071     12

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

TTiscareno Community Manager
Community Manager
Posts: 325
13071     12

@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

yardenbar
Techie
Posts: 8
13071     12

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 ]
yardenbar
Techie
Posts: 8
13071     12

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

Showing results for 
Search instead for 
Do you mean 

Recommended for You

Demo: Infoblox IPAM plug-in integration with OpenStack Newton