Reply

WAPI Request Object Error

New Member
Posts: 4
3884     1

I need some direction for properly using the Request object in the Infoblox WAPI. I have reviewed through many examples found in WAPI docs and other Infoblox resources, but I continue to receive the same error message. 


Example:

curl -k -u admin:password -H 'content-type:application/json' -X POST "https://infoblox_server/wapi/v2.11.3/request" -d '[{"method":"GET","object":"network","data":{"network":10.1.0.0/16"},"args":{"_return_fields+":"extattrs"},"discard":true}]

 

Error Received
{ "Error": "AdmConProtoError: None ('NoneType' object is not iterable)",
"code": "Server.Ibap.Internal",
"text": "Internal Error"

 

Any idea what the "AdmConProtoError: None ('NoneType' object is not iterable)" mean and how to troubleshoot?

Re: WAPI Request Object Error

Moderator
Moderator
Posts: 315
3884     1

It's missing a quote " character in front of the address space.

 

Also note that the statement "discard": true will discard everythign that you haven't saved in a variable, so this call by itself will return an empty result even if it matches a network.

Re: WAPI Request Object Error

Moderator
Moderator
Posts: 315
3884     1

Reformatted for readability, fixiing the missing quote, and not discarding the result:

curl -k -u admin:password -H 'content-type:application/json' \
-X POST  "https://infoblox_server/wapi/v2.11.3/request" -d \
'[
	{
		"method":"GET",
		"object":"network",
		"data":{"network":"10.1.0.0/16"},
		"args":{"_return_fields+":"extattrs"},
		"discard":false
	}
]'
		

Re: WAPI Request Object Error

[ Edited ]
New Member
Posts: 4
3885     1

Hey thanks for reviewing. I think the missing "" and the discard attribute helped, but did not resolve the issue. See my latest output below:

c:\curl -k -u adminr:password -H 'content-type:application/json' \
-X POST "https://infobloxserver/wapi/v2.11.3/request" -d \ 
'[
       {
"method":"GET",
"object":"network",
"data":{"network":"10.1.0.0/16"},
"args":{"_return_fields+":"extattrs"}
}
]' { "Error": "AdmConProtoError: None ('NoneType' object is not iterable)", "code": "Server.Ibap.Internal", "text": "Internal Error"
c:\

 

 

Anything additional I am missing?

Re: WAPI Request Object Error

New Member
Posts: 4
3885     1

Not sure what the issue that I was experiencing with using the curl command through Windows CMD, but when I import the cURL command into Postman I was able to run and receive the expected output. Thank you for your assistance. 

Re: WAPI Request Object Error

New Member
Posts: 4
3885     1

I discovered the issue with inputting your suggestion in a Windows 10 command prompt. When inputing the curl using multiple lines the ^ is needed at the end of the line. Additionally, the quotation character " needs to be escaped with the \ inside of the JSON. Below is working command line:

curl -k -u userid:password -H "content-type:application/json"  -X POST  "https://infobloxserver/wapi/v2.11.3/request" -d ^
"[^
	{^
		\"method\":\"GET\",^
		\"object\":\"network\",^
		\"data\":{\"network\":\"10.1.0.0/16\"},^
		\"args\":{\"_return_fields+\":\"extattrs\"}^
	}^
]"

Hope this helps others!
- Cheers

Showing results for 
Search instead for 
Did you mean: 

Recommended for You