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