Import OPNVF Yang based Event Stream
[scp/oam/modeling.git] / data-model / yang / published / opnfv / yes-object-creation.yang
1 module yes-object-creation {
2     yang-version 1.1;
3     namespace "urn:opnfv:params:xml:ns:yang:object-creation";
4     prefix yoc;
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        object creation 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 object-creation-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 data {
68             description
69               "A set of data representing the new created object instance.";
70         }
71         description
72           "An object class containing specific parameters of object creation.";
73     }
74
75     /*
76      * Augmentation of YES
77      */
78     augment "/yes:event-history/yes:event" {
79         when "derived-from-or-self(/yes:event-history/yes:event/yes:header/yes:domain, 'yoc:object-creation')" {
80             description
81               "The event header must indicate 'object-creation'.";
82         }
83         if-feature yes:event-history;
84         list object-creation {
85             uses object-creation-grp;
86             description
87               "A single object for specific parameters, used for the any object
88                creation (list item or container).";
89         }
90         description
91           "Adds to YES the specifics of object-creation notifications.";
92     }
93
94     augment "/yes:yang-based-event-stream/yes:event" {
95         when "derived-from-or-self(/yes:yang-based-event-stream/yes:event/yes:header/yes:domain, 'yoc:object-creation')" {
96             description
97               "The event header must indicate 'object-creation'.";
98         }
99         list object-creation {
100             uses object-creation-grp;
101             description
102               "A single object for specific parameters, used for the any object
103                creation (list item or container).";
104         }
105         description
106           "Adds to YES the specifics of object-creation notifications.";
107     }
108 }