07-15-2016 05:50 AM
Trying to use the objtype field in a search object to filter the records, and I'm having inconsistent results. When I use it along with a search_string field like this:
it works, and filters on both object type and search string. But when I try to use it with an address field I get a 400:
I don't see anything in the documentation to suggest the objtype field can only be used with the search_string, but is that the case? Also it appears using the objtype field by itself returns an error as well.
07-15-2016 08:38 AM
'search' comes in 2 forms. If you look at the GUI, you will see that there is 'basic' and 'advanced', but the WAPI docs don't call these out very well.
A basic search is across ALL objects, matching one of ‘address’, ‘mac_address’, ‘duid’ or ‘fqdn’:
An Advanced search is across one or all objects, and all fields, looking for a string:
# matches any 'A record' with a comment, name or EA containing 'servername'
# matches any object with any field containing 'servername'
Search is also used to ONLY search across multiple fields or multiple objects, so your search term is redundant. You could just search the 'record:a' objects:
07-15-2016 08:43 AM
Wow, it seems blindingly obvious now that you've pointed it out. I was so focused on the documentation I didn't even stop to think about what I was actually trying to do. thanks!