Import OPNVF Yang based Event Stream
[scp/oam/modeling.git] / data-model / yang / published / opnfv / yes-pnf-registration.yang
1 module yes-pnf-registration {
2     yang-version 1.1;
3     namespace "urn:opnfv:params:xml:ns:yang:yes-pnf-registration";
4     prefix ypr;
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-inet-types {
17         prefix inet;
18         reference
19           "RFC 6991: YANG data types for Internet addresses and related
20            things.";
21     }
22     import ietf-yang-types {
23         prefix yang;
24         reference
25           "RFC 6991: Common YANG Data Types.";
26     }
27
28     organization
29       "Open Platform for NFV (OPNFV) - Virtual Event Streaming (VES) project";
30     contact
31       "wiki.opnfv.org/display/ves";
32     description
33       "This module is inspired by VES 7.1.1 but uses YANG concepts and types to
34        describe the exchanged data format.
35        The module yes-pnf-registration is only required, if the network function
36        does not support NETCONF CALL HOME but RESTCONF asynchronous messages.
37
38        Copyright 2020 highstreet technologies GmbH and others.
39
40        Licensed under the Apache License, Version 2.0 (the 'License');
41        you may not use this file except in compliance with the License.
42        You may obtain a copy of the License at
43
44         http://www.apache.org/licenses/LICENSE-2.0
45
46        Unless required by applicable law or agreed to in writing, software
47        distributed under the License is distributed on an 'AS IS' BASIS,
48        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
49        See the License for the specific language governing permissions and
50        limitations under the License.";
51
52     revision 2020-06-28 {
53         description
54           "Initial version";
55         reference
56           "ONAP SDN-R: wiki.onap.org/display/DW/SDN-R
57            VES: wiki.opnfv.org/display/ves/VES+Home
58                 docs.onap.org/en/frankfurt/submodules/dcaegen2.git/docs/sections/services/ves-http
59            YES: wiki.opnfv.org/display/ves/VES+goes+YES";
60     }
61
62     /*
63      * Identities
64      */
65     identity pnf-registration {
66         base yt:domain-id;
67         description
68           "Indicates, that the event body contains pnf-registration asynchronous
69            message context.";
70     }
71
72     /*
73      * Groupings
74      */
75     grouping pnf-registration-grp {
76         // TODO align with ietf-hardware, ONAP AAI, ONF manufactured-thing
77         leaf last-service-date {
78             type yang:date-and-time;
79             description
80               "Date when the field operation stuff way on-side.";
81         }
82         leaf mac-address {
83             type yang:mac-address;
84             description
85               "The MAC address of OAM interface of the network function.";
86         }
87         leaf manufacture-date {
88             type yang:date-and-time;
89             description
90               "Manufacture date of the network function.";
91         }
92         leaf model-number {
93             type string {
94                 length "255";
95             }
96             description
97               "Version of the network function from vendor.";
98         }
99         leaf oam-host {
100             type inet:host;
101             description
102               "The m-plane fully qualified domain name (host) or IP address to
103                be used by the manager to contact the PNF.";
104         }
105         leaf oam-port {
106             type inet:port-number;
107             description
108               "The port number the PNF listens for OAM commands..";
109         }
110         leaf serial-number {
111             type string {
112                 length "255";
113             }
114             description
115               "The serial number of the network function.";
116         }
117         leaf software-version {
118             type string {
119                 length "255";
120             }
121             description
122               "The active software version running on the network function.";
123         }
124         leaf family {
125             type string {
126                 length "255";
127             }
128             description
129               "The general type of hardware.";
130         }
131         leaf network-function-type {
132             type string {
133                 length "255";
134             }
135             description
136               "Vendor name for the network function";
137         }
138         leaf vendor-name {
139             type string {
140                 length "255";
141             }
142             description
143               "The company name of manufacturer.";
144         }
145         description
146           "An object class containing pnf-registration specific parameters.";
147     }
148
149     /*
150      * Augmentation of YES
151      */
152     augment "/yes:event-history/yes:event" {
153         when "derived-from-or-self(/yes:event-history/yes:event/yes:header/yes:domain, 'ypr:pnf-registration')" {
154             description
155               "The event header must indicate 'pnf-registration'.";
156         }
157         if-feature yes:event-history;
158         container pnf-registration {
159             uses pnf-registration-grp;
160             description
161               "A single object for specific parameters, used for the registration of
162                physical network functions (PNF).";
163         }
164         description
165           "Adds to YES the specifics of pnf-registration notifications.";
166     }
167
168     augment "/yes:yang-based-event-stream/yes:event" {
169         when "derived-from-or-self(/yes:yang-based-event-stream/yes:event/yes:header/yes:domain, 'ypr:pnf-registration')" {
170             description
171               "The event header must indicate 'pnf-registration'.";
172         }
173         container pnf-registration {
174             uses pnf-registration-grp;
175             description
176               "A single object for specific parameters, used for the registration of
177                physical network functions (PNF).";
178         }
179         description
180           "Adds to YES the specifics of pnf-registration notifications.";
181     }
182 }