Import OPNVF Yang based Event Stream
[scp/oam/modeling.git] / data-model / yang / published / opnfv / yes-attribute-value-change.yang
1 module yes-attribute-value-change {
2     yang-version 1.1;
3     namespace "urn:opnfv:params:xml:ns:yang:attribute-value-change";
4     prefix yavc;
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 contains a collection of YANG definitions for sending an
23        attribute value change notification.
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-07-04 {
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      * Groupings
51      */
52     grouping attribute-value-change-grp {
53         leaf object-reference {
54             type instance-identifier {
55                 require-instance false;
56             }
57             mandatory true;
58             description
59               "A reference to the object containing the attribute (leaf).";
60         }
61         container schema {
62             uses yt:schema-grp;
63             description
64               "The YANG module, which defines the type of the attribute
65                identified by its namespace.";
66         }
67         anydata new-value {
68             description
69               "The new value which should be use on client datastores.
70                It must be ensured that the value is defined by a yang module.
71                if the new value is not delivered the manager (NMS;
72                SDN-Controller, SMO, MnS, ...) must send a GET of GET-CONFIG
73                request to the API provider. ";
74         }
75         anydata old-value {
76             description
77               "The new value which should be use on client datastores.
78                It must be ensured that the value is defined by a yang module.";
79         }
80         description
81           "An object class containing pnf-registration specific parameters.";
82     }
83
84     /*
85      * Augmentation of YES
86      */
87     augment "/yes:event-history/yes:event" {
88         when "derived-from-or-self(/yes:event-history/yes:event/yes:header/yes:domain, 'yavc:attribute-value-change')" {
89             description
90               "The event header must indicate 'attribute-value-change'.";
91         }
92         if-feature yes:event-history;
93         list attribute-value-change {
94             uses attribute-value-change-grp;
95             description
96               "A single object for specific parameters, used for the any change
97                of value change.";
98         }
99         description
100           "Adds to YES the specifics of attribute-value-change notifications.";
101     }
102
103     augment "/yes:yang-based-event-stream/yes:event" {
104         when "derived-from-or-self(/yes:yang-based-event-stream/yes:event/yes:header/yes:domain, 'yavc:attribute-value-change')" {
105             description
106               "The event header must indicate 'attribute-value-change'.";
107         }
108         list attribute-value-change {
109             uses attribute-value-change-grp;
110             description
111               "A single object for specific parameters, used for the any change
112                of value change.";
113         }
114         description
115           "Adds to YES the specifics of attribute-value-change notifications.";
116     }
117 }