Support of WG4 OpenFronthaul Management-Plane VES
[scp/oam/modeling.git] / data-model / yang / published / opnfv / yang-based-event-stream.yang
1 module yang-based-event-stream {
2   yang-version 1.1;
3   namespace "urn:opnfv:params:xml:ns:yang:yang-based-event-stream";
4   prefix yes;
5
6   import yes-types {
7     prefix yt;
8     reference
9       "wiki.opnfv.org/display/ves/VES+goes+YES";
10   }
11   import ietf-yang-types {
12     prefix yang;
13     reference
14       "RFC 6991: Common YANG Data Types.";
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
25      Copyright 2020 highstreet technologies GmbH and others.
26
27      Licensed under the Apache License, Version 2.0 (the 'License');
28      you may not use this file except in compliance with the License.
29      You may obtain a copy of the License at
30
31       http://www.apache.org/licenses/LICENSE-2.0
32
33      Unless required by applicable law or agreed to in writing, software
34      distributed under the License is distributed on an 'AS IS' BASIS,
35      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
36      See the License for the specific language governing permissions and
37      limitations under the License.";
38
39   revision 2020-06-28 {
40     description
41       "Initial version";
42     reference
43       "ONAP SDN-R: wiki.onap.org/display/DW/SDN-R
44        VES: wiki.opnfv.org/display/ves/VES+Home
45             docs.onap.org/en/frankfurt/submodules/dcaegen2.git/docs/sections/services/ves-http
46        YES: wiki.opnfv.org/display/ves/VES+goes+YES";
47   }
48
49   /*
50    * Feature
51    */
52
53   feature event-history {
54     description
55       "This feature means that the server supports local
56         storage (memory, flash, or disk) of send event
57         messages.";
58   }
59
60   /*
61    * Groupings
62    */
63
64   grouping header-grp {
65     leaf domain {
66       type yt:domain-id;
67       mandatory true;
68       description
69         "The eventing domain associated with the event";
70     }
71     leaf event-id {
72       type string {
73         length "1..255";
74       }
75       mandatory true;
76       description
77         "The event key that is unique to the event source.";
78     }
79     leaf event-name {
80       type string;
81       mandatory true;
82       description
83         "A unique event name. A names space ensures the uniqueness
84          between the data-models.";
85     }
86     leaf event-type {
87       type yt:event-type-id;
88       description
89         "Copy from VES description
90          'for example - applicationNf, guestOS, hostOS, platform.'
91
92          TODO: Open! How should this field by used and what is the
93          difference to 'yes:domain'? From the VES description it looks,
94          more like a VNF type than an event-type.";
95     }
96     leaf last-epoch {
97       type yang:date-and-time;
98       mandatory true;
99       description
100         "The latest time aka epoch time associated with the event from any component.";
101     }
102     leaf nfc-naming-code {
103       type string {
104         length "3";
105       }
106       description
107         "The network function component type, aligned with vfc naming
108          standards.
109
110          TODO: Add a reference to the VFC naming standard.";
111     }
112     leaf nf-naming-code {
113       type string {
114         length "4";
115       }
116       description
117         "The network function type, aligned with network-function (NF)
118          naming standards.
119
120          TODO: Add a reference to the NF naming standard.";
121     }
122     choice nf-vendor {
123       case nf-vendor-private-enterprise-number {
124         leaf nf-vendor-pen {
125           type uint32;
126           description
127             "Network function vendor IANA private enterprise number.";
128         }
129       }
130       case name {
131         leaf nf-vendor-name {
132           type string;
133           description
134             "Network function vendor name according to IANA Private Enterprise Numbers";
135         }
136       }
137       description
138         "The network function vendor can be identified by its name or by its
139          IANA private enterprise number (PEN)";
140       reference
141         "IANA Private Enterprise Numbers
142           http://www.iana.org/assignments/enterprise-numbers/enterprise-numbers";
143     }
144     leaf priority {
145       type yt:priority;
146       mandatory true;
147       description
148         "The event priority to control the processing of the event.";
149     }
150     leaf reporting-entity-id {
151       type yang:uuid;
152       description
153         "The entity reporting the event, for example an OAM VM.";
154     }
155     leaf reporting-entity-name {
156       type string {
157         length "1..255";
158       }
159       mandatory true;
160       description
161         "The name of the entity reporting the event, for example, an EMS
162          name; may be the same as 'source-name'.";
163     }
164     leaf sequence {
165       type uint64;
166       mandatory true;
167       description
168         "Ordering of events communicated by an event source instance or 0, if not needed.";
169     }
170     leaf source-id {
171       type yang:uuid;
172       description
173         "UUID identifying the entity experiencing the event issue.";
174     }
175     leaf source-name {
176       type string;
177       mandatory true;
178       description
179         "The name of the entity experiencing the event issue,";
180     }
181     leaf start-epoch {
182       type yang:date-and-time;
183       mandatory true;
184       description
185         "The earliest time aka epoch time associated with the event from
186          any component.";
187     }
188     description
189       "An object class containing common parameters to all types of
190        events.";
191   }
192
193   grouping event-grp {
194     container header {
195       uses header-grp;
196       description
197         "This contains all the parameters which are common to all
198          events.";
199     }
200     description
201       "An object class defining the data structure of a single
202        event. An event is an asynchronous message send from the system to its
203        manager.";
204   }
205
206   /*
207    * Data
208    */
209
210   container event-history {
211     if-feature "event-history";
212     config false;
213     leaf maximum-number-of-entries {
214       type uint16 {
215         range "10..max";
216       }
217       default "255";
218       description
219         "The maximum number of item in the event list supported by
220          the server.";
221     }
222     list event {
223       description
224         "This contains the set of asynchronous messages.";
225       uses event-grp;
226     }
227     description
228       "The root container of an event log. ";
229   }
230
231   /*
232    * Notifications
233    */
234
235   notification yang-based-event-stream {
236     description
237       "This notification contains list of events.";
238     list event {
239       description
240         "This contains the set of asynchronous messages.";
241       uses event-grp;
242     }
243   }
244 }