Support of WG4 OpenFronthaul Management-Plane VES
[scp/oam/modeling.git] / data-model / yang / working / o-ran-sc / template / yes-o1-notify-pnf-registration-additional-fields.yang
1 module yes-o1-notify-pnf-registration-additional-fields {
2   yang-version 1.1;
3   namespace "urn:o-ran-sc:params:xml:ns:yang:yes-o1-notify-pnf-registration-additional-fields";
4   prefix ypra;
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-o1-notify-pnf-registration {
12     prefix ypr;
13     reference
14       "O-RAN Operations and Maintenance Interface Specification (O-RAN.WG10.O1-Interface.0-v07.00)
15        section 2.7.2.4 Operations and Notifications";
16   }
17
18   organization
19     "O-RAN Software Community";
20   contact
21     "www.o-ran-sc.org";
22   description
23     "This module is inspired by VES 7.1.1 but uses YANG concepts and types to
24      describe the exchanged data format.
25      This module augments yes-o1-notify-pnf-registration for vendor specific
26      additional fields.
27
28      Copyright 2022 highstreet technologies GmbH and others.
29
30      Licensed under the Apache License, Version 2.0 (the 'License');
31      you may not use this file except in compliance with the License.
32      You may obtain a copy of the License at
33
34       http://www.apache.org/licenses/LICENSE-2.0
35
36      Unless required by applicable law or agreed to in writing, software
37      distributed under the License is distributed on an 'AS IS' BASIS,
38      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39      See the License for the specific language governing permissions and
40      limitations under the License.";
41
42   revision 2022-08-24 {
43     description
44       "Initial version";
45     reference
46       "ONAP SDN-R: wiki.onap.org/display/DW/SDN-R
47        VES: wiki.opnfv.org/display/ves/VES+Home
48             docs.onap.org/en/frankfurt/submodules/dcaegen2.git/docs/sections/services/ves-http
49        YES: wiki.opnfv.org/display/ves/VES+goes+YES
50        O-RAN Operations and Maintenance Interface Specification (O-RAN.WG10.O1-Interface.0-v07.00)
51              section 2.7.2.4 Operations and Notifications";
52   }
53
54   /*
55    * Groupings
56    */
57
58   grouping o1-notify-pnf-registration-additional-fields-grp {
59     // TODO align with ietf-hardware, ONAP AAI, ONF manufactured-thing
60     leaf transport-protocol {
61       type enumeration {
62         enum ssh {
63           description
64             "NETCONF via SSH";
65         }
66         enum tls {
67           description
68             "NETCONF via TLS";
69           reference
70             "RFC7589: Using the NETCONF Protocol over Transport Layer Security (TLS)
71                       with Mutual X.509 Authentication";
72         }
73       }
74       default "ssh";
75       description
76         "Defines the security protocol for NETCONF";
77     }
78     leaf username {
79       type string {
80         length "3..255";
81       }
82       description
83         "The username for the connection.";
84     }
85     choice transport-protocol-details {
86       case ssh {
87         leaf password {
88           type string {
89             length "8..255";
90           }
91           description
92             "The user's password for the SSH session.";
93         }
94         leaf host-key {
95           type string;
96           description
97             "BASE-64 encoded public key which is used by the network-function
98               during the connection.";
99         }
100       }
101       case tls {
102         leaf key-reference {
103           type string;
104           description
105             "Key identifier inside the NETCONF server's keystore.
106               It is used during two-way TLS authentication.";
107           reference
108             "ietf-keystore.yang";
109         }
110       }
111       description
112         "Provides connectivity details for one of the supported transport protocols";
113     }
114     leaf reconnect-on-changed-schema {
115       type boolean;
116       default "false";
117       description
118         "Defines if the NETCONF client should reconnect to the network
119          function, if new YANG capabilities are exposed.";
120     }
121     leaf connection-timeout {
122       type uint32;
123       units "ms";
124       default "20000";
125       description
126         "Defines the NETCONF client timeout to indicate that the connection
127          was lost.";
128     }
129     leaf max-connection-attempts {
130       type uint32;
131       default "0";
132       description
133         "Defines the number of attempts by the NETCONF client to connect
134          to the NETCONF server, before the automated connection function, by
135          the NETCONF client is switched off. The value 0 means 'infinity'.";
136     }
137     leaf between-attempts-timeout {
138       type uint32;
139       units "ms";
140       default "2000";
141       description
142         "Defines the first delay time in milliseconds to try a new reconnect
143          by the NETCONF client. For the next attempts the values is
144          multiplied with the 'sleep-factor'.";
145     }
146     leaf sleep-factor {
147       type decimal64 {
148         fraction-digits 1;
149         range "1.0 .. 10.0";
150       }
151       default "1.5";
152       description
153         "Defines the factor to increase the reconnect attempt.";
154     }
155     leaf keepalive-delay {
156       type uint32;
157       units "s";
158       default "120";
159       description
160         "Defines the time in seconds between two 'empty' NETCONF request to
161          check if the NETCONF server is functional or can be reached. The
162          value 0 turns of such function.";
163     }
164     description
165       "An object class containing o1-notify-pnf-registration additional fields.";
166   }
167
168   /*
169    * Augmentation of o1-notify-pnf-registration
170    */
171
172   augment "/yes:event-history/yes:event/ypr:o1-notify-pnf-registration" {
173     when "derived-from-or-self(/yes:event-history/yes:event/yes:header/yes:domain, 'ypr:o1-notify-pnf-registration')" {
174       description
175         "The event header must indicate 'o1-notify-pnf-registration'.";
176     }
177     if-feature "yes:event-history";
178     uses o1-notify-pnf-registration-additional-fields-grp;
179     description
180       "Adds additional fields to o1-notify-pnf-registration notifications.";
181   }
182
183   augment "/yes:yang-based-event-stream/yes:event/ypr:o1-notify-pnf-registration" {
184     when "derived-from-or-self(/yes:yang-based-event-stream/yes:event/yes:header/yes:domain, 'ypr:o1-notify-pnf-registration')" {
185       description
186         "The event header must indicate 'o1-notify-pnf-registration'.";
187     }
188     uses o1-notify-pnf-registration-additional-fields-grp;
189     description
190       "Adds additional fields to o1-notify-pnf-registration notifications.";
191   }
192 }