- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

get list of valid values for a attribute
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-28-2017 12:26 AM
Hi All
what is the easy REST-way to get a list of possible values in a extattr ?
We have a attribute with a list of possible values - let's call it rack-number
Now we are working on automating a function, where we need to check if the rack-number is within the allowed list, before making the create-REST-call.
If the create-call has a extattr value that is not in the list, it will fail,
and we want to catch the error, before making the create-call
we are using wapi 2.2.2, not sure if the server supports anything newer
Solved! Go to Solution.

Re: get list of valid values for a attribute
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-28-2017 11:37 AM
curl -k1 -u admin:infoblox -H "Content-Type: application/json" -X GET https://10.60.27.4/wapi/v2.7/extensibleattributedef?_return_fields=list_values -d '{"name":"TestList"}'
Results in:
[
{
"_ref": "extensibleattributedef/b25lLmV4dGVuc2libGVfYXR0cmlidXRlc19kZWYkLlRlc3RMaXN0:TestList",
"list_values": [
{
"value": "TestValue1"
},
{
"value": "TestValue2"
}
]
}
]
Re: get list of valid values for a attribute
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
09-29-2017 04:50 AM
Thanks, it works great
Re: get list of valid values for a attribute
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-15-2019 07:57 AM - edited 01-15-2019 07:59 AM
Hi tried giving , to list all our VLAN-ID
GET : https://ipman/wapi/v2.6.1/extensibleattributedef?_return_fields=list_values –d '{"name":"VLAN-ID"}'
but it shows error as follows :
{
"Error": "AdmConProtoError: Unknown argument/field: 'list_values –d '{\"name\":\"VLAN-ID\"}''",
"code": "Client.Ibap.Proto",
"text": "Unknown argument/field: 'list_values –d '{\"name\":\"VLAN-ID\"}''"
}
BUT When I tried
GET : https://ipman/wapi/v2.6.1/extensibleattributedef?_return_fields=list_values
Which could list all the EA list
{
"_ref": "extensibleattributedef/b25lLmV4dGVuc2libGVfYXR0cmlidXRlc19kZWYkLlZMQU4tSUQ:VLAN-ID",
"list_values": [
{
"value": "kein"
},
{
"value": "2"
},
{
"value": "3"
},
{....
Where I have gone wrong!!
and Additionally , is there any way I could sort the VLAN ID as numerically ?
thank you
Re: get list of valid values for a attribute
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-15-2019 09:13 AM
If your're sending JSON data you also need to include the header telling it you're sending JSON data. Otherwise your request looks good.
"Content-Type: application/json"
Or, you could put the name of the EA directly in the URL and get the same results:
GET : https://ipman/wapi/v2.6.1/extensibleattributedef?name=VLAN-ID&_return_fields=list_values
Re: get list of valid values for a attribute
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-17-2019 05:58 AM - edited 01-17-2019 06:00 AM
Thanks it works fine !
is there any way I could sort the VLAN-ID ie. sorting Values in ascending order.
like 1,2,3 rather than 1,10,11.. etc
Re: get list of valid values for a attribute
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-17-2019 07:08 AM
No, you would need to sort on the client side. While you can view the REST API output directly, generally API output is intended to be loaded into a client and parsed before being displayed for human consumption.