Finally got some more time to look at getting data out of the box using API.
And I'm stuck, reading the docs on the box I apparently have API 1.7.3 and have managed
curl -k -u userw https://ipam.our.company/wapi/v1.7.3/network?*Level:=1 > c:\test.txt
which dums the output to the file.
Two questions arise
What if I want all records containing data? (or worst case, all records)
What if the extensible attribute is called something like This fance name? (all attempts so far has failed with "I don't have an attribute called 'This' don't be silly - hoooman; or even 'What is this This_fancy_name you are talking about?)
Maybe this "Fields in objects always start with a letter (a-z) and are followed by a zero or more letters, digits, and underscores. No other characters are used in field identifiers." is the problem? So I'm reading that as "My fancy name" is invalied as a field name in this API and will always result in the "My" is not recognized type of errors? Unless renamed to "My_fancy_name".
2 weeks ago
What do you mean by get all records? Do you want to fetch all the extensible attributes?
If yes, then you need to add the _return_fields parameter to your API.
curl -k -u user:_password_ https://ipam.our.company/wapi/v1.7.3/network?_return_fields%2B=extattrs > c:\test.txt
2 weeks ago - last edited 2 weeks ago
Thanks for your reply.
By all records I mean all instances of extensible "attribute A" whether or not anyone has assigned a value to it in each record.
Record 1: Level = 1
Record 2: Level = 1
Record 3: Level =
Record 4: Level = 3
Is it possible to get the content of fields such as "Contact person"?
2 weeks ago
The example you gave is searching for records that contain a value for the "Level" EA.
If you want to return all records, regardless of EA values, ask it to return all vaules, but also ask it to return the EA values for records containing that EA. This is the example posted by kvasudevan previously.
The API will only return EA attribuute/value pairs for records containing an attribuute/value pair. If the value is not defined, the attribute will not be returned. If you want to display an empty value you would need to add that in your own script.
Maybe I misunderstood the example, or I explained it badly - which was why I posted the reply.
I thought the example gave the value of all EAs. This is not what I want (and it failed on my machine, with iirc some kind of out-of-bounds error), I want all records with any value for Level (e.g.). Another field is all records with a (non-blank) value for "Contact person". I'm fairly new to this so still strugling to understand how this works.