This module defines a data model for DP-generic notification mechanism.
Version: 2017-03-16
module tailf-kicker { yang-version 1; namespace "http://tail-f.com/ns/kicker"; prefix kicker; import ietf-yang-types { prefix yang; } import ietf-netconf-acm { prefix nacm; } import tailf-common { prefix tailf; } organization "Tail-f Systems"; description "This module defines a data model for DP-generic notification mechanism."; revision "2017-03-16" { description "Released as part of ConfD-6.4. Added kicker-triggered netconf notification. Added sent-kicker-triggered action. Added notification-kicker definition."; } revision "2016-11-24" { description "Released as part of ConfD-6.3. Added variables."; } revision "2016-05-03" { description "Released as part of NCS-4.2. Reintroduced hidden statement. Removed notification-kicker"; } revision "2015-10-13" { description "Initial release."; } container kickers { tailf:info "Kicker specific configuration"; tailf:hidden "debug"; tailf:action "send-kicker-triggered" { tailf:info "Kicker action to Send a kicker-triggered notification"; tailf:hidden "debug"; description "This action is only expected to be defined as action-name for a data-kicker and will then when triggered send a 'kicker-triggered' notification with current 'kicker-id' and 'path'. This action require a notification stream named 'kicker-events' to be defined to be able to send the notification. The usage is as follows: For instance if the following kicker is defined: 'set kickers data-kicker my-notif-kick monitor /mypath kick-node /kicker:kickers action-name send-kicker-triggered' Then when a change is made under the node /mypath a notification of type 'kicker-triggered' will be sent on the 'kicker-events' stream."; tailf:actionpoint "kicker" { tailf:internal; } input { uses "action-input-params"; } output; } list data-kicker { key "id"; description "Examples: Trigger if the interface 'eth0' is changed: monitor: /interfaces/interface[name='eth0'] Trigger if the oper-state of interface 'eth0' is changed: monitor: /interfaces/interface[name='eth0']/oper-state Trigger if the oper-state of interface 'eth0' is set to 'up': monitor: /interfaces/interface[name='eth0'] trigger-expr: oper-state = 'up' OR monitor: /interfaces/interface[name='eth0']/oper-state trigger-expr: . = 'up' Trigger if any interface's oper-state is set to 'up', or admin-state is set to 'enable' monitor: /interfaces/interface trigger-expr: oper-state = 'up' or admin-state = 'enable' Trigger cfs if rfs changes: monitor: /cpvn-oper/cvpn/cpe-ready kick-node: ../cfs "; leaf id { type string; description "A unique identifier for this subscription."; } leaf monitor { type nacm:node-instance-identifier; mandatory true; description "If a node that matches the value of this leaf is changed, the 'trigger-expr' expression is evaluated, and the 'trigger-type' is used to determine if the kicker triggers or not. The value of this leaf is like an instance-identifier, but a list may be specified without any keys. This is treated like a wildcard that matches all entries in the list."; } leaf trigger-expr { type yang:xpath1.0; description "An XPath 1.0 expression that is evaluated when any node matching 'monitor' is changed. The 'trigger-type' is used to determine if the kicker triggers or not. If no trigger-expr has been defined, the kicker is always triggered when any node matching 'monitor' is changed. This XPath is evaluated with the node that matched 'monitor' as the context node."; } leaf trigger-type { type enumeration { enum "enter-and-leave" { value 0; description "Trigger the kicker whenever the 'trigger-expr' changes from false to true, or from true to false. This is the default behavior."; } enum "enter" { value 1; description "Trigger the kicker only when the 'trigger-expr' changes from false to true."; } } default "enter-and-leave"; } list variable { key "name"; description "A list of variable bindings that will be part of the context when the monitor path expression is installed, and when the trigger expression is evaluated."; leaf name { type string; description "The name of the variable."; } leaf value { type yang:xpath1.0; mandatory true; description "An XPath expression that will be the value of variable 'name'. The expression is only evaluated when used in the monitor or trigger expression, and then it will have the same context as that expression. Note that both expressions and path expressions are allowed, which implies that literals must be quoted."; } } // list variable leaf kick-node { type union { type instance-identifier; type yang:xpath1.0; } mandatory true; description "When the kicker is triggered, the 'action-name' action is invoked on the 'kick-node' instance. If the 'kick-node' is given as an XPath 1.0 expression, the expression is evaluated with the node that matched 'monitor' as the context node, and the expression must return a node set. The 'action-name' action is invoked on the nodes in this node set. For example, suppose a service /bar creates an entry in /bar-data, with the same id as /bar, and the service needs to be re-deployed with the bar-data state changes. list bar-data { key id; leaf id { type string; } leaf state { type ... } } Then a single kicker with: monitor: '/bar-data/state' kick-node: '/bar[name=current()/../id]' action-name: 'reactive-re-deploy' can be created. Alternatively, every service instance can create its own kicker with: monitor: '/bar-data[name=<id>]/state' kick-node: '/bar[name=<id>] action-name: 'reactive-re-deploy' "; } leaf action-name { type yang:yang-identifier; mandatory true; } } // list data-kicker } // container kickers notification kicker-triggered { description "This notification is sent by the 'send-kicker-triggered' action. The action is supposed to be used by a defined kicker. One usage of both the above named action and this notification is when a data-kicker is used to monitor a threshold value on a leaf. When the 'send-kicker-triggered' is invoked a generic 'kicker-triggered' notification is send over the 'kicker-event' stream."; leaf kicker-id { type string; description "Id of the triggered kicker."; } leaf path { type nacm:node-instance-identifier; description "The path to the subtree that triggered the change."; } } // notification kicker-triggered } // module tailf-kicker
© 2023 YumaWorks, Inc. All rights reserved.