Develop a data model: o1-notify-pnf-registration
[scp/oam/modeling.git] / data-model / yang / working / o-ran-sc / template / yes-o1-notify-pnf-registration.yang
1 module yes-o1-notify-pnf-registration {
2   yang-version 1.1;
3   namespace "urn:o-ran-sc:params:xml:ns:yang:yes-o1-notify-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     "O-RAN Software Community";
30   contact
31     "www.o-ran-sc.org";
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-o1-notify-pnf-registration is only required, if the
36      network function does not support NETCONF CALL HOME but RESTCONF
37      asynchronous messages.
38
39      Copyright 2022 highstreet technologies GmbH and others.
40
41      Licensed under the Apache License, Version 2.0 (the 'License');
42      you may not use this file except in compliance with the License.
43      You may obtain a copy of the License at
44
45       http://www.apache.org/licenses/LICENSE-2.0
46
47      Unless required by applicable law or agreed to in writing, software
48      distributed under the License is distributed on an 'AS IS' BASIS,
49      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
50      See the License for the specific language governing permissions and
51      limitations under the License.";
52
53   revision 2022-08-24 {
54     description
55       "Initial version";
56     reference
57       "ONAP SDN-R: wiki.onap.org/display/DW/SDN-R
58        VES: wiki.opnfv.org/display/ves/VES+Home
59             docs.onap.org/en/frankfurt/submodules/dcaegen2.git/docs/sections/services/ves-http
60        YES: wiki.opnfv.org/display/ves/VES+goes+YES
61        O-RAN Operations and Maintenance Interface Specification (O-RAN.WG10.O1-Interface.0-v07.00)
62              section 2.7.2.4 Operations and Notifications";
63   }
64
65   /*
66    * Identities
67    */
68
69   identity o1-notify-pnf-registration {
70     base yt:domain-id;
71     description
72       "Indicates, that the event body contains o1-notify-nf-registration
73        asynchron message context.";
74   }
75
76   /*
77    * Groupings
78    */
79
80   grouping o1-notify-pnf-registration-grp {
81     // TODO align with ietf-hardware, ONAP AAI, ONF manufactured-thing
82     // Parameter Name   S       Information Type        Comment
83     // objectClass      M       ManagedEntity.objectClass       Class of the managed object, registering for service.
84     leaf object-class {
85       type string {
86         length "3..255";
87       }
88       mandatory true;
89       description
90         "The name of the object class describing a PNF in the context of
91          PNF registration. ";
92     }
93     // objectInstance   M       ManagedEntity.objectInstance
94     //  Instance of the managed object, registering for service.
95     leaf object-instance {
96       type yt:resource;
97       mandatory true;
98       description
99         "Reference to the object representing the PNF.";
100     }
101     // notificationId   M       NotificationId  Notification identifier as defined in ITU-T Rec. X. 733
102     leaf notification-identifier {
103       type uint64;
104       mandatory true;
105       description
106         "An notification identifier of this event as defined in ITU-T Rec. X.733.";
107       reference
108         "ITU-T Rec. X.733 - section 8.1.2.8.";
109     }
110     // notificationType M       "o1notifyPnfRegistration"
111     leaf notification-type {
112       type yt:domain-id;
113       mandatory true;
114       description
115         "Only the domain identity 'o1-notify-pnf-registration' is allowed.";
116     }
117     // eventTime        M       DateTime        Time when the NF is sending the registration.
118     leaf event-time {
119       type yang:date-and-time;
120       mandatory true;
121       description
122         "The earliest time aka epoch time associated with the event from
123          any component.";
124     }
125     // systemDN M       SystemDN        DN of the MnS provider of the notification
126     leaf system-distinguished-name {
127       type string;
128       mandatory true;
129       description
130         "Distinguished Name of the management service provider of the notification";
131     }
132     // o1SpecVersion    M       number  Version of the O1 Specification defining the format of this PNF registration notification
133     leaf o1-specification-version {
134       type string {
135         length "1..5";
136       }
137       mandatory true;
138       description
139         "The version of the O1 Specification defining the format of this PNF registration notification";
140     }
141     // serialNumber     M       string  3GPP TS 28.632 [43] serialNumber = serial number of the unit
142     leaf serial-number {
143       type string {
144         length "3..255";
145       }
146       mandatory true;
147       description
148         "The serial number of the network function.";
149       reference
150         "3GPP TS 28.632 serialNumber";
151     }
152     // vendorName       M       string  3GPP TS 28.632 [43] vendorName = name of the NF vendor.
153     choice vendor {
154       case vendor-private-enterprise-number {
155         leaf vendor-pen {
156           type uint32;
157           description
158             "Network function vendor IANA private enterprise number.";
159         }
160       }
161       case name {
162         leaf vendor-name {
163           type string;
164           description
165             "Network function vendor name according to IANA Private Enterprise Numbers";
166         }
167       }
168       description
169         "The network function vendor can be identified by its name or by its
170          IANA private enterprise number (PEN)";
171       reference
172         "IANA Private Enterprise Numbers
173           http://www.iana.org/assignments/enterprise-numbers/enterprise-numbers";
174       // leaf vendor-name {
175       //   type string {
176       //       length "1..255";
177       //   }
178       //   mandatory true;
179       //   description
180       //     "The company name of manufacturer.";
181       //   reference
182       //     "3GPP TS 28.632 vendorName";
183     }
184     // oamV4IpAddress   CM      string  IPv4 m-plane IP address to be used by the manager to contact the NF.
185     // oamV6IpAddress   CM      string  IPv6 m-plane IP address to be used by the manager to contact the NF.
186     leaf oam-host {
187       type inet:host;
188       mandatory true;
189       description
190         "The m-plane fully qualified domain name (host) or IP address to
191          be used by the manager to contact the PNF.";
192       reference
193         "O-RAN Operations and Maintenance Interface Specification (O-RAN.WG10.O1-Interface.0-v07.00)
194            section 2.7.2.4 Operations and Notifications - oamV4IpAddress and oamV6IpAddress";
195     }
196     leaf oam-port {
197       type inet:port-number;
198       default "830";
199       description
200         "The port number the PNF listens for OAM commands..";
201     }
202     // macAddress       O       string  MAC address of the OAM of the unit
203     leaf mac-address {
204       type yang:mac-address;
205       description
206         "The MAC address of OAM interface of the network function.";
207     }
208     // unitFamily       O       string  3GPP TS 28.632 [43] vendorUnitFamilyType = general type of HW unit
209     leaf unit-family {
210       type string {
211         length "1..255";
212       }
213       description
214         "The general type of hardware.";
215       reference
216         "3GPP TS 28.632 vendorUnitFamilyType";
217     }
218     // unitType O       string  3GPP TS 28.632 [43] vendorUnitTypeNumber = vendor name for the unit
219     leaf unit-type {
220       type string {
221         length "1..255";
222       }
223       description
224         "Vendor name for the network function";
225       reference
226         "3GPP TS 28.632 vendorUnitTypeNumber";
227     }
228     // modelNumber      O       string  3GPP TS 28.632 [43] versionNumber = version of the unit from the vendor
229     leaf model-number {
230       type string {
231         length "1..255";
232       }
233       description
234         "Version of the network function from the vendor.";
235       reference
236         "3GPP TS 28.632 versionNumber";
237     }
238     // softwareVersion  O       string  3GPP TS 28.632 [43] swName = software release name.  This is the software provided by the vendor at onboarding to be run on this version of the NF and can contain multiple underlying software images.
239     leaf software-version {
240       type string {
241         length "1..255";
242       }
243       description
244         "The active software version running on the network function.";
245       reference
246         "3GPP TS 28.632 swName";
247     }
248     // restartReason    O       string  Reason the NF restarted, if known
249     leaf restart-reason {
250       type string {
251         length "1..255";
252       }
253       description
254         "The reason the network function restarted.";
255     }
256     // manufactureDate  O       string  3GPP TS 28.632 [43] dateOfManufacture = manufacture date of the unit in ISO 8601 format; e.g.,2016-04-23
257     leaf manufacture-date {
258       type yang:date-and-time;
259       description
260         "Manufacture date of the network function.";
261     }
262     // lastServiceDate  O       string  3GPP TS 28.632 [43] dateOfLastService = date of last service in ISO 8601 format; e.g., 2017-02-15
263     leaf last-service-date {
264       type yang:date-and-time;
265       description
266         "Date when the field operation stuff way on-side.";
267     }
268     // additionalFields O       hashMap Additional registration fields if needed, provided as key-value pairs.
269     description
270       "An object class containing o1-notify-pnf-registration specific parameters.";
271   }
272
273   /*
274    * Augmentation of YES
275    */
276
277   augment "/yes:event-history/yes:event" {
278     when "derived-from-or-self(/yes:event-history/yes:event/yes:header/yes:domain, 'ypr:o1-notify-pnf-registration')" {
279       description
280         "The event header must indicate 'o1-notify-pnf-registration'.";
281     }
282     if-feature "yes:event-history";
283     container o1-notify-pnf-registration {
284       uses o1-notify-pnf-registration-grp;
285       description
286         "A single object for specific parameters, used for the registration of
287          physical network functions (PNF).";
288     }
289     description
290       "Adds to YES the specifics of o1-notify-pnf-registration notifications.";
291   }
292
293   augment "/yes:yang-based-event-stream/yes:event" {
294     when "derived-from-or-self(/yes:yang-based-event-stream/yes:event/yes:header/yes:domain, 'ypr:o1-notify-pnf-registration')" {
295       description
296         "The event header must indicate 'o1-notify-pnf-registration'.";
297     }
298     container o1-notify-pnf-registration {
299       uses o1-notify-pnf-registration-grp;
300       description
301         "A single object for specific parameters, used for the registration of
302          physical network functions (PNF).";
303     }
304     description
305       "Adds to YES the specifics of o1-notify-pnf-registration notifications.";
306   }
307 }