Add supoprt for D release use-case.
[sim/o1-interface.git] / ntsimulator / deploy / o-ran-ru-fh / yang / ietf-network-instance@2019-01-21.yang
1 module ietf-network-instance {
2   yang-version 1.1;
3   namespace "urn:ietf:params:xml:ns:yang:ietf-network-instance";
4   prefix ni;
5
6   // import some basic types
7
8   import ietf-interfaces {
9     prefix if;
10     reference
11       "RFC 8343: A YANG Data Model for Interface Management";
12   }
13   import ietf-ip {
14     prefix ip;
15     reference
16       "RFC 8344: A YANG Data Model for IP Management";
17   }
18   import ietf-yang-schema-mount {
19     prefix yangmnt;
20     reference
21       "RFC 8528: YANG Schema Mount";
22   }
23
24   organization
25     "IETF Routing Area (rtgwg) Working Group";
26   contact
27     "WG Web:   <https://datatracker.ietf.org/wg/rtgwg>
28      WG List:  <mailto:rtgwg@ietf.org>
29
30      Author:   Lou Berger
31                <mailto:lberger@labn.net>
32      Author:   Christian Hopps
33                <mailto:chopps@chopps.org>
34      Author:   Acee Lindem
35                <mailto:acee@cisco.com>
36      Author:   Dean Bogdanovic
37                <mailto:ivandean@gmail.com>";
38   description
39     "This module is used to support multiple network instances
40      within a single physical or virtual device.  Network
41      instances are commonly known as VRFs (VPN Routing and
42      Forwarding) and VSIs (Virtual Switching Instances).
43      The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
44      'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
45      'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
46      are to be interpreted as described in BCP 14 (RFC 2119)
47      (RFC 8174) when, and only when, they appear in all capitals,
48       as shown here.
49
50      Copyright (c) 2019 IETF Trust and the persons identified as
51      authors of the code.  All rights reserved.
52
53      Redistribution and use in source and binary forms, with or
54      without modification, is permitted pursuant to, and subject
55      to the license terms contained in, the Simplified BSD
56      License set forth in Section 4.c of the IETF Trust's Legal
57      Provisions Relating to IETF Documents
58      (https://trustee.ietf.org/license-info).
59
60      This version of this YANG module is part of RFC 8529; see
61      the RFC itself for full legal notices.";
62
63   revision 2019-01-21 {
64     description
65       "Initial revision.";
66     reference
67       "RFC 8529";
68   }
69
70   // top-level device definition statements
71
72   container network-instances {
73     description
74       "Network instances, each of which consists of
75        VRFs and/or VSIs.";
76     reference
77       "RFC 8349: A YANG Data Model for Routing Management";
78     list network-instance {
79       key "name";
80       description
81         "List of network instances.";
82       leaf name {
83         type string;
84         mandatory true;
85         description
86           "device-scoped identifier for the network
87            instance.";
88       }
89       leaf enabled {
90         type boolean;
91         default "true";
92         description
93           "Flag indicating whether or not the network
94            instance is enabled.";
95       }
96       leaf description {
97         type string;
98         description
99           "Description of the network instance
100            and its intended purpose.";
101       }
102       choice ni-type {
103         description
104           "This node serves as an anchor point for different types
105            of network instances.  Each 'case' is expected to
106            differ in terms of the information needed in the
107            parent/core to support the NI and may differ in their
108            mounted-schema definition.  When the mounted schema is
109            not expected to be the same for a specific type of NI,
110            a mount point should be defined.";
111       }
112       choice root-type {
113         mandatory true;
114         description
115           "Well-known mount points.";
116         container vrf-root {
117           description
118             "Container for mount point.";
119           yangmnt:mount-point "vrf-root" {
120             description
121               "Root for L3VPN-type models.  This will typically
122                not be an inline-type mount point.";
123           }
124         }
125         container vsi-root {
126           description
127             "Container for mount point.";
128           yangmnt:mount-point "vsi-root" {
129             description
130               "Root for L2VPN-type models.  This will typically
131                not be an inline-type mount point.";
132           }
133         }
134         container vv-root {
135           description
136             "Container for mount point.";
137           yangmnt:mount-point "vv-root" {
138             description
139               "Root models that support both L2VPN-type bridging
140                and L3VPN-type routing.  This will typically
141                not be an inline-type mount point.";
142           }
143         }
144       }
145     }
146   }
147
148   // augment statements
149
150   augment "/if:interfaces/if:interface" {
151     description
152       "Add a node for the identification of the network
153        instance associated with the information configured
154        on a interface.
155
156        Note that a standard error will be returned if the
157        identified leafref isn't present.  If an interface cannot
158        be assigned for any other reason, the operation SHALL fail
159        with an error-tag of 'operation-failed' and an
160        error-app-tag of 'ni-assignment-failed'.  A meaningful
161        error-info that indicates the source of the assignment
162        failure SHOULD also be provided.";
163     leaf bind-ni-name {
164       type leafref {
165         path "/network-instances/network-instance/name";
166       }
167       description
168         "Network instance to which an interface is bound.";
169     }
170   }
171   augment "/if:interfaces/if:interface/ip:ipv4" {
172     description
173       "Add a node for the identification of the network
174        instance associated with the information configured
175        on an IPv4 interface.
176
177        Note that a standard error will be returned if the
178        identified leafref isn't present.  If an interface cannot
179        be assigned for any other reason, the operation SHALL fail
180        with an error-tag of 'operation-failed' and an
181        error-app-tag of 'ni-assignment-failed'.  A meaningful
182        error-info that indicates the source of the assignment
183        failure SHOULD also be provided.";
184     leaf bind-ni-name {
185       type leafref {
186         path "/network-instances/network-instance/name";
187       }
188       description
189         "Network instance to which IPv4 interface is bound.";
190     }
191   }
192   augment "/if:interfaces/if:interface/ip:ipv6" {
193     description
194       "Add a node for the identification of the network
195        instance associated with the information configured
196        on an IPv6 interface.
197
198        Note that a standard error will be returned if the
199        identified leafref isn't present.  If an interface cannot
200        be assigned for any other reason, the operation SHALL fail
201        with an error-tag of 'operation-failed' and an
202        error-app-tag of 'ni-assignment-failed'.  A meaningful
203        error-info that indicates the source of the assignment
204        failure SHOULD also be provided.";
205     leaf bind-ni-name {
206       type leafref {
207         path "/network-instances/network-instance/name";
208       }
209       description
210         "Network instance to which IPv6 interface is bound.";
211     }
212   }
213
214   // notification statements
215
216   notification bind-ni-name-failed {
217     description
218       "Indicates an error in the association of an interface to an
219        NI.  Only generated after success is initially returned when
220        bind-ni-name is set.
221
222        Note: Some errors may need to be reported for multiple
223        associations, e.g., a single error may need to be reported
224        for an IPv4 and an IPv6 bind-ni-name.
225
226        At least one container with a bind-ni-name leaf MUST be
227        included in this notification.";
228     leaf name {
229       type leafref {
230         path "/if:interfaces/if:interface/if:name";
231       }
232       mandatory true;
233       description
234         "Contains the interface name associated with the
235          failure.";
236     }
237     container interface {
238       description
239         "Generic interface type.";
240       leaf bind-ni-name {
241         type leafref {
242           path "/if:interfaces/if:interface"
243              + "/ni:bind-ni-name";
244         }
245         description
246           "Contains the bind-ni-name associated with the
247            failure.";
248       }
249     }
250     container ipv4 {
251       description
252         "IPv4 interface type.";
253       leaf bind-ni-name {
254         type leafref {
255           path "/if:interfaces/if:interface/ip:ipv4/ni:bind-ni-name";
256         }
257         description
258           "Contains the bind-ni-name associated with the
259            failure.";
260       }
261     }
262     container ipv6 {
263       description
264         "IPv6 interface type.";
265       leaf bind-ni-name {
266         type leafref {
267           path "/if:interfaces/if:interface/ip:ipv6"
268              + "/ni:bind-ni-name";
269         }
270         description
271           "Contains the bind-ni-name associated with the
272            failure.";
273       }
274     }
275     leaf error-info {
276       type string;
277       description
278         "Optionally, indicates the source of the assignment
279          failure.";
280     }
281   }
282 }