- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
GET /range?_return_fields=extattrs returns an empty extattrs object
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2022 11:38 AM
Hello everyone!
I'm making an API GET request against the /range object, specifying extattrs in the _return_fields parameter, but get an empty extattrs object back. I have verified that extensible attributes exist and I can see them through the GUI.
Any idea what I am doing wrong? Thank you!
Request:
/wapi/v2.10.5/range?_return_fields=comment,network,network_view,start_addr,end_addr,dhcp_utilization,dhcp_utilization_status,dynamic_hosts,static_hosts,total_hosts,extattrs
Return:
[
{
"_ref": "range/ZG5zLmRfdfdfd2UkMTcyLjMxLjY3LjEvMTcyLjMxLjY3LjEyNC8vLzAv:10.31.67.1/10.31.67.124/default",
"comment": "Template: IP_Phones",
"dhcp_utilization": 145,
"dhcp_utilization_status": "NORMAL",
"dynamic_hosts": 18,
"end_addr": "10.31.67.124",
"extattrs": {},
"network": "10.31.67.0/25",
"network_view": "default",
"start_addr": "10.31.67.1",
"static_hosts": 0,
"total_hosts": 124
}
]
Solved! Go to Solution.
Re: GET /range?_return_fields=extattrs returns an empty extattrs object
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2022 06:16 AM
Hello,
The API call looks good and should return the extensible attributes if any.
If the range EA is inherited form the network, make sure the Inheritance State is set to "inherited" or "overridden" and not "Not Inherited".
Re: GET /range?_return_fields=extattrs returns an empty extattrs object
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2022 06:42 AM
Thank you for your response. When I look in the GUI, I see the Extensible Attributes on these objects set with an Inheritance State of "Disabled" and "Required" set to "Yes".
So it appears these attributes were specifically set on this object. Shouldn't that even be more reason for these attributes to be returned?
Re: GET /range?_return_fields=extattrs returns an empty extattrs object
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2022 03:46 AM
Just wanted to post a follow-up.
I could never get the extattrs to work on the /range object, but I was able to retrieve these via the /network object. Unfortunately, the /network object does not know about the DHCP properties, like start_addr, end_addr, dhcp_utilization etc.
So best I could come up with is by retrieving all /range objects and all /network objects, and essentially enriching the /range result set with data from /network for those DHCP ranges. Not ideal, but probably the most efficient way to do this considering this issue.
If anyone has any better recommendations, I'd still be very interested in hearing them.
Thanks everyone!