Import OPNVF Yang based Event Stream
[scp/oam/modeling.git] / data-model / yang / published / opnfv / yes-heartbeat.yang
1 module yes-heartbeat {
2     yang-version 1.1;
3     namespace "urn:opnfv:params:xml:ns:yang:yes-heartbeat";
4     prefix yh;
5
6     import yang-based-event-stream {
7         prefix yes;
8         reference
9           "wiki.opnfv.org/display/ves/VES+goes+YES";
10     }
11     import yes-types {
12         prefix yt;
13         reference
14           "wiki.opnfv.org/display/ves/VES+goes+YES";
15     }
16
17     organization
18       "Open Platform for NFV (OPNFV) - Virtual Event Streaming (VES) project";
19     contact
20       "wiki.opnfv.org/display/ves";
21     description
22       "This module is inspired by VES 7.1.1 but uses YANG concepts and types to
23        describe the exchanged data format.
24        The module yes-heartbeat is only required, if the network function sends
25        HTTP-POST RESTCONF messages to the SMO, otherwise the native NETCONF
26        capabilities will be sufficient.
27
28        Copyright 2020 highstreet technologies GmbH and others.
29
30        Licensed under the Apache License, Version 2.0 (the 'License');
31        you may not use this file except in compliance with the License.
32        You may obtain a copy of the License at
33
34         http://www.apache.org/licenses/LICENSE-2.0
35
36        Unless required by applicable law or agreed to in writing, software
37        distributed under the License is distributed on an 'AS IS' BASIS,
38        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39        See the License for the specific language governing permissions and
40        limitations under the License.";
41
42     revision 2020-06-28 {
43         description
44           "Initial version";
45         reference
46           "ONAP SDN-R: wiki.onap.org/display/DW/SDN-R
47            VES: wiki.opnfv.org/display/ves/VES+Home
48                 docs.onap.org/en/frankfurt/submodules/dcaegen2.git/docs/sections/services/ves-http
49            YES: wiki.opnfv.org/display/ves/VES+goes+YES";
50     }
51
52     /*
53      * Identities
54      */
55     identity heartbeat {
56         base yt:domain-id;
57         description
58           "Indicates, that the event body contains heartbeat asynchronous
59            message context.";
60     }
61
62     /*
63      * Groupings
64      */
65     grouping heartbeat-grp {
66         leaf interval {
67             type uint32 {
68                 range "60 .. 84600";
69             }
70             units "s";
71             mandatory true;
72             description
73               "The current heartbeat interval in seconds. The minimal heartbeat
74                interval is 1 minute avoiding overloading the management plane
75                network. The maximal interval is 24h to ensure a daily
76                heartbeat.";
77         }
78         description
79           "An object class containing heartbeat specific parameters.";
80     }
81
82     /*
83      * Augmentation of YES
84      */
85     augment "/yes:event-history/yes:event" {
86         when "derived-from-or-self(/yes:event-history/yes:event/yes:header/yes:domain, 'yh:heartbeat')" {
87             description
88               "The event header must indicate 'heartbeat'.";
89         }
90         if-feature yes:event-history;
91         container heartbeat {
92             uses heartbeat-grp;
93             description
94               "A single object for heartbeat specific parameters.";
95         }
96         description
97           "Adds to YES the specifics of heartbeat notifications.";
98     }
99
100     augment "/yes:yang-based-event-stream/yes:event" {
101         when "derived-from-or-self(/yes:yang-based-event-stream/yes:event/yes:header/yes:domain, 'yh:heartbeat')" {
102             description
103               "The event header must indicate 'heartbeat'.";
104         }
105         container heartbeat {
106             uses heartbeat-grp;
107             description
108               "A single object for heartbeat specific parameters.";
109         }
110         description
111           "Adds to YES the specifics of heartbeat notifications.";
112     }
113 }