summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/devicemanager-onap/onf14/provider/src/test/resources/currentRevision/ietf-network-instance@2019-01-21.yang
blob: f52375a2cc76a8cbc8f36468197b4bb11016f23b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
module ietf-network-instance {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-network-instance";
  prefix ni;

  import ietf-interfaces {
    prefix if;
    reference
      "RFC 8343: A YANG Data Model for Interface Management";
  }
  import ietf-ip {
    prefix ip;
    reference
      "RFC 8344: A YANG Data Model for IP Management";
  }
  import ietf-yang-schema-mount {
    prefix yangmnt;
    reference
      "RFC 8528: YANG Schema Mount";
  }

  organization
    "IETF Routing Area (rtgwg) Working Group";
  contact
    "WG Web:   <https://datatracker.ietf.org/wg/rtgwg>
     WG List:  <mailto:rtgwg@ietf.org>

     Author:   Lou Berger
               <mailto:lberger@labn.net>
     Author:   Christian Hopps
               <mailto:chopps@chopps.org>
     Author:   Acee Lindem
               <mailto:acee@cisco.com>
     Author:   Dean Bogdanovic
               <mailto:ivandean@gmail.com>";
  description
    "This module is used to support multiple network instances
     within a single physical or virtual device.  Network
     instances are commonly known as VRFs (VPN Routing and
     Forwarding) and VSIs (Virtual Switching Instances).
     The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
     'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
     'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
     are to be interpreted as described in BCP 14 (RFC 2119)
     (RFC 8174) when, and only when, they appear in all capitals,
      as shown here.

     Copyright (c) 2019 IETF Trust and the persons identified as
     authors of the code.  All rights reserved.

     Redistribution and use in source and binary forms, with or
     without modification, is permitted pursuant to, and subject
     to the license terms contained in, the Simplified BSD
     License set forth in Section 4.c of the IETF Trust's Legal
     Provisions Relating to IETF Documents
     (https://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC 8529; see
     the RFC itself for full legal notices.";

  revision 2019-01-21 {
    description
      "Initial revision.";
    reference
      "RFC 8529";
  }

  container network-instances {
    description
      "Network instances, each of which consists of
       VRFs and/or VSIs.";
    reference
      "RFC 8349: A YANG Data Model for Routing Management";
    list network-instance {
      key "name";
      description
        "List of network instances.";
      leaf name {
        type string;
        mandatory true;
        description
          "device-scoped identifier for the network
           instance.";
      }
      leaf enabled {
        type boolean;
        default "true";
        description
          "Flag indicating whether or not the network
           instance is enabled.";
      }
      leaf description {
        type string;
        description
          "Description of the network instance
           and its intended purpose.";
      }
      choice ni-type {
        description
          "This node serves as an anchor point for different types
           of network instances.  Each 'case' is expected to
           differ in terms of the information needed in the
           parent/core to support the NI and may differ in their
           mounted-schema definition.  When the mounted schema is
           not expected to be the same for a specific type of NI,
           a mount point should be defined.";
      }
      choice root-type {
        mandatory true;
        description
          "Well-known mount points.";
        container vrf-root {
          yangmnt:mount-point "vrf-root" {
            description
              "Root for L3VPN-type models.  This will typically
               not be an inline-type mount point.";
          }
          description
            "Container for mount point.";
        }
        container vsi-root {
          yangmnt:mount-point "vsi-root" {
            description
              "Root for L2VPN-type models.  This will typically
               not be an inline-type mount point.";
          }
          description
            "Container for mount point.";
        }
        container vv-root {
          yangmnt:mount-point "vv-root" {
            description
              "Root models that support both L2VPN-type bridging
               and L3VPN-type routing.  This will typically
               not be an inline-type mount point.";
          }
          description
            "Container for mount point.";
        }
      }
    }
  }

  augment "/if:interfaces/if:interface" {
    description
      "Add a node for the identification of the network
       instance associated with the information configured
       on a interface.

       Note that a standard error will be returned if the
       identified leafref isn't present.  If an interface cannot
       be assigned for any other reason, the operation SHALL fail
       with an error-tag of 'operation-failed' and an
       error-app-tag of 'ni-assignment-failed'.  A meaningful
       error-info that indicates the source of the assignment
       failure SHOULD also be provided.";
    leaf bind-ni-name {
      type leafref {
        path "/network-instances/network-instance/name";
      }
      description
        "Network instance to which an interface is bound.";
    }
  }
  augment "/if:interfaces/if:interface/ip:ipv4" {
    description
      "Add a node for the identification of the network
       instance associated with the information configured
       on an IPv4 interface.

       Note that a standard error will be returned if the
       identified leafref isn't present.  If an interface cannot
       be assigned for any other reason, the operation SHALL fail
       with an error-tag of 'operation-failed' and an
       error-app-tag of 'ni-assignment-failed'.  A meaningful
       error-info that indicates the source of the assignment
       failure SHOULD also be provided.";
    leaf bind-ni-name {
      type leafref {
        path "/network-instances/network-instance/name";
      }
      description
        "Network instance to which IPv4 interface is bound.";
    }
  }
  augment "/if:interfaces/if:interface/ip:ipv6" {
    description
      "Add a node for the identification of the network
       instance associated with the information configured
       on an IPv6 interface.

       Note that a standard error will be returned if the
       identified leafref isn't present.  If an interface cannot
       be assigned for any other reason, the operation SHALL fail
       with an error-tag of 'operation-failed' and an
       error-app-tag of 'ni-assignment-failed'.  A meaningful
       error-info that indicates the source of the assignment
       failure SHOULD also be provided.";
    leaf bind-ni-name {
      type leafref {
        path "/network-instances/network-instance/name";
      }
      description
        "Network instance to which IPv6 interface is bound.";
    }
  }

  notification bind-ni-name-failed {
    description
      "Indicates an error in the association of an interface to an
       NI.  Only generated after success is initially returned when
       bind-ni-name is set.

       Note: Some errors may need to be reported for multiple
       associations, e.g., a single error may need to be reported
       for an IPv4 and an IPv6 bind-ni-name.

       At least one container with a bind-ni-name leaf MUST be
       included in this notification.";
    leaf name {
      type leafref {
        path "/if:interfaces/if:interface/if:name";
      }
      mandatory true;
      description
        "Contains the interface name associated with the
         failure.";
    }
    container interface {
      description
        "Generic interface type.";
      leaf bind-ni-name {
        type leafref {
          path "/if:interfaces/if:interface/ni:bind-ni-name";
        }
        description
          "Contains the bind-ni-name associated with the
           failure.";
      }
    }
    container ipv4 {
      description
        "IPv4 interface type.";
      leaf bind-ni-name {
        type leafref {
          path "/if:interfaces/if:interface/ip:ipv4/ni:bind-ni-name";
        }
        description
          "Contains the bind-ni-name associated with the
           failure.";
      }
    }
    container ipv6 {
      description
        "IPv6 interface type.";
      leaf bind-ni-name {
        type leafref {
          path "/if:interfaces/if:interface/ip:ipv6/ni:bind-ni-name";
        }
        description
          "Contains the bind-ni-name associated with the
           failure.";
      }
    }
    leaf error-info {
      type string;
      description
        "Optionally, indicates the source of the assignment
         failure.";
    }
  }
}