Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alarm validation against inventory is too strict #2

Open
jktjkt opened this issue Oct 23, 2024 · 0 comments
Open

Alarm validation against inventory is too strict #2

jktjkt opened this issue Oct 23, 2024 · 0 comments

Comments

@jktjkt
Copy link
Collaborator

jktjkt commented Oct 23, 2024

The RFC defines some extra rules when matching the resource against the inventory and the shelving rules:

  • XPath rules should be supported (which means that, e.g., the inventory might contain a resource set to the XPath /ietf-interfaces:interfaces/ietf-interfaces:interface[ietf-interfaces:type='ianaift:ethernetCsmacd'], and then we should recognize that this matches when fed with, e.g., /if:interfaces/if:interface[if:name='eth1']). This will be rather expensive because any alarm would require fetching arbitrary content of the operational DS (with bonus points in case the XPath refers to the ietf-alarms module :) ). As a minimal fix, we should relax the inventory validation so that it doesn't reject these alarms, but I think that we will have to fetch everything so that we can implement shelving properly.
  • The yang:object-identifier should be implemented as a prefix match (TODO when implementing this: also catch derived types).
  • If it's an UUID or a string (and there's no difference between these on the YANG type level, apparently!), then it's supposed to be a regular expression.

Right now we are comparing strings for equality, which is a wrong thing to do.

jktjkt pushed a commit that referenced this issue Nov 28, 2024
After implementing alarm-history we also must implement actions for
compressing the status changes history. Those two actions delete all
status entries except the latest ones. [1]

We can reuse a part of already written Filter for purging alarms. There
is similar logic so let's subclass these two filters from the same class
implementing the filtering algorithm.

The compress action can filter according to the alarm resource. However,
in case we filter regular alarms, then it is more complicated (see [2],
this has to wait until we support regular expressions in libyang-cpp).

[1] https://datatracker.ietf.org/doc/rfc8632/
[2] #2

Change-Id: Iddcd94976f63f22a7a141faee674dd003424c5f5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant