All work

Select view

Select search mode

 

snmpConfig ReST response doesn't include location information

Won't Fix

Description

The response for a snmpConfig GET request doesn't include location for a node even though the node has location information. Adding location data would clarify the context of where a SNMP node is from.

 

For example, the result of a GET request with default response type (XML). Having <location>Raleigh</location> would clarify the context.

It gets even more confusing when response content type is of json format. Notice the location's value is incorrectly stated as null

 

 

On another note, the snmp-info.xsd is missing the element name location and ttl even though it's actually supported. May need to get the documentation updated too once the xsd model is updated to reflect what’s actually supported in the codebase. Include an example of an request with location and ttl.

Acceptance / Success Criteria

None

Lucidchart Diagrams

Details

Assignee

Reporter

HB Grooming Date

HB Backlog Status

FD#

Sprint

Priority

PagerDuty

Created November 28, 2022 at 8:55 PM
Updated November 7, 2023 at 4:38 PM
Resolved October 19, 2023 at 1:50 PM

Activity

JianYetNovember 7, 2023 at 4:38 PM

I ditto Mark’s remark, even if the location doesn’t exist, it should default to default value and location = Default explicitly rather than null. As noted by my example in the description, even if the location exist, the data returned is null. That’s confusing.

fookerOctober 26, 2023 at 9:44 AM

The most accurate response is to not respond at all. We resolve the config against the whole snmp profile system and it gives back a config. That config does not contain the location as it is irrelevant for the whole process.

 

Let’s do this by an example:

having the following config:

then we can query:

rest/snmpConfig/192.168.86.4?location=Kanata

Returning Kanata as a location in the result is less correct than not having a location at all.

When we query for a location that has a concrete entry for it, having a result would be semantically correct, but involves a lot of effort to transport this information through the config evaluation engine.

IMO, this is not worth the effort, as the information is already available in the query.

Mark MahacekOctober 19, 2023 at 4:49 PM

If the user specified a location in the request and the response returns a different value (in this case ‘null’ regardless of the query), it doesn't instill confidence that the response is accurate. Given you can have different SNMP config for the same IP at different locations, providing an accurate response is needed.

fookerOctober 19, 2023 at 1:50 PM

This works as intended. The returned SNMP config reflects the actual stored config which matches the given search parameter and not a concrete config matching the requested device.

fookerSeptember 20, 2023 at 12:41 PM

PR: