Import OPNVF Yang based Event Stream
[scp/oam/modeling.git] / data-model / yang / published / opnfv / yes-performance-monitoring.yang
1 module yes-performance-monitoring {
2     yang-version 1.1;
3     namespace "urn:opnfv:params:xml:ns:yang:yes-performance-monitoring";
4     prefix ypm;
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     import ietf-yang-types {
17         prefix yang;
18         reference
19           "RFC 6991: Common YANG Data Types.";
20     }
21
22     organization
23       "Open Platform for NFV (OPNFV) - Virtual Event Streaming (VES) project";
24     contact
25       "wiki.opnfv.org/display/ves";
26     description
27       "This module is inspired by VES 7.1.1 but uses YANG concepts and types to
28        describe the exchanged data format.
29
30        Copyright 2020 highstreet technologies GmbH and others.
31
32        Licensed under the Apache License, Version 2.0 (the 'License');
33        you may not use this file except in compliance with the License.
34        You may obtain a copy of the License at
35
36         http://www.apache.org/licenses/LICENSE-2.0
37
38        Unless required by applicable law or agreed to in writing, software
39        distributed under the License is distributed on an 'AS IS' BASIS,
40        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41        See the License for the specific language governing permissions and
42        limitations under the License.";
43
44     revision 2020-06-28 {
45         description
46           "Initial version";
47         reference
48           "ONAP SDN-R: wiki.onap.org/display/DW/SDN-R
49            VES: wiki.opnfv.org/display/ves/VES+Home
50                 docs.onap.org/en/frankfurt/submodules/dcaegen2.git/docs/sections/services/ves-http
51            YES: wiki.opnfv.org/display/ves/VES+goes+YES";
52     }
53
54     /*
55      * Identities
56      */
57     identity performance-monitoring {
58         base yt:domain-id;
59         description
60           "Indicates, that the event body contains performance-monitoring
61            related asynchronous message context.";
62     }
63
64     identity granularity-period-id {
65         description
66           "Base identity for the granularity period.  A unique identification of
67            the granularity period. The description of the granularity period
68            value MUST indicate if the granularity period is abstract or not.
69
70            This identity is abstract and MUST NOT be used for granularity
71            period.";
72     }
73
74     identity gp15min {
75         base granularity-period-id;
76         description
77           "Indicates a period length of 900s. The display value is '15min'.";
78     }
79
80     identity gp24h {
81         base granularity-period-id;
82         description
83           "Indicates a period length of maximal 86400s. The display value is
84            '24h'.";
85     }
86
87     /*
88      * Type definitions
89      */
90     typedef granularity-period-type {
91         type identityref {
92             base granularity-period-id;
93         }
94         description
95           "The enumeration with the options for granularity period of the
96            performance measurement data.";
97     }
98
99     /*
100      * Groupings
101      */
102     grouping pm-measurement-grp {
103         leaf pm-key {
104             type yt:performance-measurement-type-id;
105             description
106               "The local identifier of a pm-measurement object.";
107         }
108         leaf pm-value {
109             type yt:pm-value-type;
110             mandatory true;
111             description
112               "The performance measurement value, measured in a certain interval.";
113         }
114         leaf pm-unit {
115             type yt:performance-measurement-unit-id;
116             description
117               "A representing of the unit og the pm-value.";
118         }
119         description
120           "An abstract object class representing a key-value pair for
121            pm-measurement.";
122     }
123
124     grouping performance-monitoring-grp {
125         leaf granularity-period {
126             type granularity-period-type;
127             config false;
128             description
129               "Time period between reset of the underlying counter.";
130         }
131         leaf suspect-interval-flag {
132             type boolean;
133             config false;
134             description
135               "This attribute indicates that the data collected during the interval is suspect.";
136         }
137         leaf period-end-time {
138             type yang:date-and-time;
139             config false;
140             description
141               "Time when the counter values have been recorded and the counter reset.";
142         }
143         list measurement {
144             key pm-key;
145             uses pm-measurement-grp;
146             description
147               "A set of measurement data for this interval.";
148         }
149         description
150           "An object class containing all performance-monitoring specific parameters.";
151     }
152
153     /*
154      * Augmentation of YES
155      */
156     augment "/yes:event-history/yes:event" {
157         when "derived-from-or-self(/yes:event-history/yes:event/yes:header/yes:domain, 'ypm:performance-monitoring')" {
158             description
159               "The event header must indicate 'performance-monitoring'.";
160         }
161         if-feature yes:event-history;
162         list performance-monitoring {
163             uses performance-monitoring-grp;
164             description
165               "A list for performance-monitoring objects.";
166         }
167         description
168           "Adds to YES the specifics of performance-monitoring notifications.";
169     }
170
171     augment "/yes:yang-based-event-stream/yes:event" {
172         when "derived-from-or-self(/yes:yang-based-event-stream/yes:event/yes:header/yes:domain, 'ypm:performance-monitoring')" {
173             description
174               "The event header must indicate 'performance-monitoring'.";
175         }
176         list performance-monitoring {
177             uses performance-monitoring-grp;
178             description
179               "A list for performance-monitoring objects.";
180         }
181         description
182           "Adds to YES the specifics of performance-monitoring notifications.";
183     }
184 }