- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
WAPI Request Object Error
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2023 09:55 AM
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?
Solved! Go to Solution.
Re: WAPI Request Object Error
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2023 12:19 PM
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2023 12:24 PM
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 ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2023 12:29 PM - edited 03-13-2023 12:37 PM
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2023 12:47 PM
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2023 06:33 AM
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