Reply

Infoblox WAPI REST

Not applicable
Posts: 2
5687     0

Using the documentation, I tried creating the JSON object with the name as naptr as well as record:naptr.
I am receiving the error as below:

{ "Error": "AdmConProtoError: Illegal object type (record:naptr)", "code": "Client.Ibap.Proto", "text": "Illegal object type (record:naptr)"}

Any ideas on how to go about this. I am using the sample code provided

 

 

Creating an NAPTR record in Python and Curl

Adviser
Posts: 138
5687     0

I was able to create an NAPTR record using the following Python code:

import requests
import json
r = requests.post('https://gm.example.com/wapi/v1.5/record:naptr',
                  data=json.dumps({'order': 10,
                                   'name': 'foo.example.com',
                                   'preference': 10,
                                   'replacement': '.'}),
                  auth=('admin', 'infoblox'),
                  verify=False)

Note that creation of NAPTR records via the WAPI is apparently not supported prior to WAPI version 1.5 (NIOS 6.11). (I'm running 6.12, and got an "object not supported" error using API versions 1.1 through 1.4.) At a minimum you have to specify the 'name', 'replacement', 'order', and 'preference' values. In practice you'd probably also specify 'services', 'flags', and/or 'regexp' as well.

The code above is equivalent to the following Curl command:

curl -k1 -u 'admin:infoblox' -X POST 'https://gm.example.com/wapi/v1.5/record:naptr' \
     -H 'Content-Type:application/json' \
     -d '{"order": 10, "name": "foo.example.com", "preference": 10, "replacement": "."}'

I've tested both code examples above (with the userids and grid master FQDN changed). They both work and return status code 201.

Thanks for your reply. We are

Not applicable
Posts: 2
5687     0

Thanks for your reply. We are verifying the WAPI version in our system.

 

Creating an NAPTR record in Python and Curl

Techie
Posts: 6
5687     0

Minor correction.  This record was added in code release 6.10.200 and later under WAPI Version 1.4.2.  If you need to test the same code on the 1.4.2 release running 6.10.200 you should change the v1.5 to v1.4.2 in the urls provided by Frank.

Showing results for 
Search instead for 
Did you mean: 

Recommended for You