02-17-2018 05:36 PM
Can anybody share some example on how to use "structs" for a wapi call ?
For eg, one of the structs from wapi doc is "nodeinfo", and when I try calling https://<ip>/wapi/v2.6/nodeinfo? , i'm getting unknown object type (nodeinfo) which i guess is because "nodeinfo" is not an object.
02-18-2018 06:00 AM
Structs are a structured variable, meaning that it's a complex variable with multiple attribute/value pairs. Those attribute/value pairs could also be structs.
Instead of requesting a struct, you would request an object and ask for specific attributes (structs) of that object. Some attributes are returned by default, some attributes need to be requested.
To return just one attribute, ask for just one attribute. (use "=") To return one attribute and all the defaults, ask to also return that attribute (use "+=").
We can't use a plus "+" character in a URL, so we have to "escape" the character. A plus sign is written as "%2b" in a url.
To display all appliances and their node_info, use this call:
curl -k1 -u admin:infoblox -X GET 'https://10.9.16.6/wapi/v2.6/member?_return_fields%2b=node_info'