How to filter with WAPI for "struct" datatypes

Posts: 2
2407     2

I want to get a list of all fixedaddress objects, filtered by the ms_server attribute. The API documentation sais, that this attribute is searchable but as "struct" datatype.

I´m not able to execute this with a result:


https://ipamipaddress/wapi/v2.7.1/fixedaddress?_max_results=1&ms_server={'_struct': 'msdhcpserver', 'ipv4addr': 'XXXXX'}


AdmConProtoError: Structure expected in ms_server ({'_struct': 'msdhcpserver', 'ipv4addr....


Any idea how to build the GET request (GET´s dont allow a body element).


Thanks and regards,


Re: How to filter with WAPI for "struct" datatypes

Posts: 18
2407     2

Hi Christoph,


While GET requests are not typically made with a body, it does permit a body that it can use. 


I was able to get the desired output with the below WAPI (using curl):


curl -k -u admin:infoblox -X GET https://grid.master/wapi/v2.7/fixedaddress -d '{"ms_server":{"_struct": "msdhcpserver","ipv4addr": ""}}' -H 'content-type: application/json'


Hope this helps.



Re: How to filter with WAPI for "struct" datatypes

Posts: 2
2407     2


thanks for your information. As you write, GET doesn´t allow a body. With curl you can append a body to this request, but this is not allowed in the standard and many other API tools sadly don´t allow that type of malformed GET request.


I found a solution with using a other Method that allows a body (PUT, POST) and tell the WAPI that this request is a GET request by attaching the _method=GET string.


curl -k -u admin:infoblox -X PUT https://grid.master/wapi/v2.7/fixedaddress?_method=GET -d '{"ms_server":{"_struct": "msdhcpserver","ipv4addr": ""}}' -H 'content-type: application/json'



Showing results for 
Search instead for 
Did you mean: 

Recommended for You