Gaurav Agrawal
Committed by Gerrit Code Review

[Hummingbird - ONOS4647] Check for the standard l3vpn yang

Change-Id: I3008b9da2ed61c8902789abd064b8f77dfa73245
(cherry picked from commit f6e6037b)
1 +/*
2 + * Copyright 2016-present Open Networking Laboratory
3 + *
4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 + * you may not use this file except in compliance with the License.
6 + * You may obtain a copy of the License at
7 + *
8 + * http://www.apache.org/licenses/LICENSE-2.0
9 + *
10 + * Unless required by applicable law or agreed to in writing, software
11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + * See the License for the specific language governing permissions and
14 + * limitations under the License.
15 + */
16 +
17 +package org.onosproject.yangutils.ietfyang;
18 +
19 +import org.apache.maven.plugin.MojoExecutionException;
20 +import org.junit.Test;
21 +import org.onosproject.yangutils.linker.impl.YangLinkerManager;
22 +import org.onosproject.yangutils.parser.exceptions.ParserException;
23 +import org.onosproject.yangutils.parser.impl.YangUtilsParserManager;
24 +import org.onosproject.yangutils.plugin.manager.YangUtilManager;
25 +import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
26 +import org.onosproject.yangutils.utils.io.impl.YangFileScanner;
27 +
28 +import java.io.IOException;
29 +
30 +import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory;
31 +
32 +/**
33 + * Test cases for testing IETF YANG files.
34 + */
35 +public class IetfYangFileTest {
36 +
37 + private final YangUtilsParserManager manager = new YangUtilsParserManager();
38 + private final YangUtilManager utilManager = new YangUtilManager();
39 + private final YangLinkerManager yangLinkerManager = new YangLinkerManager();
40 +
41 + /**
42 + * Checks hierarchical intra with inter file type linking.
43 + * Reference: https://datatracker.ietf.org/doc/draft-zha-l3sm-l3vpn-onos-deployment
44 + */
45 + @Test
46 + public void l3vpnserviceyang()
47 + throws IOException, ParserException, MojoExecutionException {
48 +
49 + String searchDir = "src/test/resources/ietfyang/l3vpnservice";
50 + utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
51 + utilManager.parseYangFileInfoSet();
52 + utilManager.resolveDependenciesUsingLinker();
53 +
54 + String userDir = System.getProperty("user.dir");
55 + YangPluginConfig yangPluginConfig = new YangPluginConfig();
56 + yangPluginConfig.setCodeGenDir("target/ietfyang/l3vpnservice/");
57 +
58 + utilManager.translateToJava(utilManager.getYangFileInfoSet(), yangPluginConfig);
59 +
60 + deleteDirectory(userDir + "/target/ietfyang/");
61 + }
62 +
63 +}
1 + module ietf-inet-types {
2 +
3 + yang-version 1;
4 +
5 + namespace
6 + "urn:ietf:params:xml:ns:yang:ietf-inet-types";
7 +
8 + prefix inet;
9 +
10 + organization
11 + "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
12 +
13 + contact
14 + "WG Web: <http://tools.ietf.org/wg/netmod/>
15 + WG List: <mailto:netmod@ietf.org>
16 +
17 + WG Chair: David Kessens
18 + <mailto:david.kessens@nsn.com>
19 +
20 + WG Chair: Juergen Schoenwaelder
21 + <mailto:j.schoenwaelder@jacobs-university.de>
22 +
23 + Editor: Juergen Schoenwaelder
24 + <mailto:j.schoenwaelder@jacobs-university.de>";
25 +
26 + description
27 + "This module contains a collection of generally useful derived
28 + YANG data types for Internet addresses and related things.
29 +
30 + Copyright (c) 2013 IETF Trust and the persons identified as
31 + authors of the code. All rights reserved.
32 +
33 + Redistribution and use in source and binary forms, with or
34 + without modification, is permitted pursuant to, and subject
35 + to the license terms contained in, the Simplified BSD License
36 + set forth in Section 4.c of the IETF Trust's Legal Provisions
37 + Relating to IETF Documents
38 + (http://trustee.ietf.org/license-info).
39 +
40 + This version of this YANG module is part of RFC 6991; see
41 + the RFC itself for full legal notices.";
42 +
43 + revision "2013-07-15" {
44 + description
45 + "This revision adds the following new data types:
46 + - ip-address-no-zone
47 + - ipv4-address-no-zone
48 + - ipv6-address-no-zone";
49 + reference
50 + "RFC 6991: Common YANG Data Types";
51 +
52 + }
53 +
54 + revision "2010-09-24" {
55 + description "Initial revision.";
56 + reference
57 + "RFC 6021: Common YANG Data Types";
58 +
59 + }
60 +
61 +
62 + typedef ip-version {
63 + type enumeration {
64 + enum "unknown" {
65 + value 0;
66 + description
67 + "An unknown or unspecified version of the Internet
68 + protocol.";
69 + }
70 + enum "ipv4" {
71 + value 1;
72 + description
73 + "The IPv4 protocol as defined in RFC 791.";
74 + }
75 + enum "ipv6" {
76 + value 2;
77 + description
78 + "The IPv6 protocol as defined in RFC 2460.";
79 + }
80 + }
81 + description
82 + "This value represents the version of the IP protocol.
83 +
84 + In the value set and its semantics, this type is equivalent
85 + to the InetVersion textual convention of the SMIv2.";
86 + reference
87 + "RFC 791: Internet Protocol
88 + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification
89 + RFC 4001: Textual Conventions for Internet Network Addresses";
90 +
91 + }
92 +
93 + typedef dscp {
94 + type uint8 {
95 + range "0..63";
96 + }
97 + description
98 + "The dscp type represents a Differentiated Services Code Point
99 + that may be used for marking packets in a traffic stream.
100 + In the value set and its semantics, this type is equivalent
101 + to the Dscp textual convention of the SMIv2.";
102 + reference
103 + "RFC 3289: Management Information Base for the Differentiated
104 + Services Architecture
105 + RFC 2474: Definition of the Differentiated Services Field
106 + (DS Field) in the IPv4 and IPv6 Headers
107 + RFC 2780: IANA Allocation Guidelines For Values In
108 + the Internet Protocol and Related Headers";
109 +
110 + }
111 +
112 + typedef ipv6-flow-label {
113 + type uint32 {
114 + range "0..1048575";
115 + }
116 + description
117 + "The ipv6-flow-label type represents the flow identifier or Flow
118 + Label in an IPv6 packet header that may be used to
119 + discriminate traffic flows.
120 +
121 + In the value set and its semantics, this type is equivalent
122 + to the IPv6FlowLabel textual convention of the SMIv2.";
123 + reference
124 + "RFC 3595: Textual Conventions for IPv6 Flow Label
125 + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification";
126 +
127 + }
128 +
129 + typedef port-number {
130 + type uint16 {
131 + range "0..65535";
132 + }
133 + description
134 + "The port-number type represents a 16-bit port number of an
135 + Internet transport-layer protocol such as UDP, TCP, DCCP, or
136 + SCTP. Port numbers are assigned by IANA. A current list of
137 + all assignments is available from <http://www.iana.org/>.
138 +
139 + Note that the port number value zero is reserved by IANA. In
140 + situations where the value zero does not make sense, it can
141 + be excluded by subtyping the port-number type.
142 + In the value set and its semantics, this type is equivalent
143 + to the InetPortNumber textual convention of the SMIv2.";
144 + reference
145 + "RFC 768: User Datagram Protocol
146 + RFC 793: Transmission Control Protocol
147 + RFC 4960: Stream Control Transmission Protocol
148 + RFC 4340: Datagram Congestion Control Protocol (DCCP)
149 + RFC 4001: Textual Conventions for Internet Network Addresses";
150 +
151 + }
152 +
153 + typedef as-number {
154 + type uint32;
155 + description
156 + "The as-number type represents autonomous system numbers
157 + which identify an Autonomous System (AS). An AS is a set
158 + of routers under a single technical administration, using
159 + an interior gateway protocol and common metrics to route
160 + packets within the AS, and using an exterior gateway
161 + protocol to route packets to other ASes. IANA maintains
162 + the AS number space and has delegated large parts to the
163 + regional registries.
164 +
165 + Autonomous system numbers were originally limited to 16
166 + bits. BGP extensions have enlarged the autonomous system
167 + number space to 32 bits. This type therefore uses an uint32
168 + base type without a range restriction in order to support
169 + a larger autonomous system number space.
170 +
171 + In the value set and its semantics, this type is equivalent
172 + to the InetAutonomousSystemNumber textual convention of
173 + the SMIv2.";
174 + reference
175 + "RFC 1930: Guidelines for creation, selection, and registration
176 + of an Autonomous System (AS)
177 + RFC 4271: A Border Gateway Protocol 4 (BGP-4)
178 + RFC 4001: Textual Conventions for Internet Network Addresses
179 + RFC 6793: BGP Support for Four-Octet Autonomous System (AS)
180 + Number Space";
181 +
182 + }
183 +
184 + typedef ip-address {
185 + type union {
186 + type ipv4-address;
187 + type ipv6-address;
188 + }
189 + description
190 + "The ip-address type represents an IP address and is IP
191 + version neutral. The format of the textual representation
192 + implies the IP version. This type supports scoped addresses
193 + by allowing zone identifiers in the address format.";
194 + reference
195 + "RFC 4007: IPv6 Scoped Address Architecture";
196 +
197 + }
198 +
199 + typedef ipv4-address {
200 + type string {
201 + pattern
202 + '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\p{N}\p{L}]+)?';
203 + }
204 + description
205 + "The ipv4-address type represents an IPv4 address in
206 + dotted-quad notation. The IPv4 address may include a zone
207 + index, separated by a % sign.
208 +
209 + The zone index is used to disambiguate identical address
210 + values. For link-local addresses, the zone index will
211 + typically be the interface index number or the name of an
212 + interface. If the zone index is not present, the default
213 + zone of the device will be used.
214 +
215 + The canonical format for the zone index is the numerical
216 + format";
217 + }
218 +
219 + typedef ipv6-address {
220 + type string {
221 + pattern
222 + '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\p{N}\p{L}]+)?';
223 + pattern
224 + '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)(%.+)?';
225 + }
226 + description
227 + "The ipv6-address type represents an IPv6 address in full,
228 + mixed, shortened, and shortened-mixed notation. The IPv6
229 + address may include a zone index, separated by a % sign.
230 +
231 + The zone index is used to disambiguate identical address
232 + values. For link-local addresses, the zone index will
233 + typically be the interface index number or the name of an
234 + interface. If the zone index is not present, the default
235 + zone of the device will be used.
236 +
237 +
238 +
239 + The canonical format of IPv6 addresses uses the textual
240 + representation defined in Section 4 of RFC 5952. The
241 + canonical format for the zone index is the numerical
242 + format as described in Section 11.2 of RFC 4007.";
243 + reference
244 + "RFC 4291: IP Version 6 Addressing Architecture
245 + RFC 4007: IPv6 Scoped Address Architecture
246 + RFC 5952: A Recommendation for IPv6 Address Text
247 + Representation";
248 +
249 + }
250 +
251 + typedef ip-address-no-zone {
252 + type union {
253 + type ipv4-address-no-zone;
254 + type ipv6-address-no-zone;
255 + }
256 + description
257 + "The ip-address-no-zone type represents an IP address and is
258 + IP version neutral. The format of the textual representation
259 + implies the IP version. This type does not support scoped
260 + addresses since it does not allow zone identifiers in the
261 + address format.";
262 + reference
263 + "RFC 4007: IPv6 Scoped Address Architecture";
264 +
265 + }
266 +
267 + typedef ipv4-address-no-zone {
268 + type ipv4-address {
269 + pattern '[0-9\.]*';
270 + }
271 + description
272 + "An IPv4 address without a zone index. This type, derived from
273 + ipv4-address, may be used in situations where the zone is
274 + known from the context and hence no zone index is needed.";
275 + }
276 +
277 + typedef ipv6-address-no-zone {
278 + type ipv6-address {
279 + pattern '[0-9a-fA-F:\.]*';
280 + }
281 + description
282 + "An IPv6 address without a zone index. This type, derived from
283 + ipv6-address, may be used in situations where the zone is
284 + known from the context and hence no zone index is needed.";
285 + reference
286 + "RFC 4291: IP Version 6 Addressing Architecture
287 + RFC 4007: IPv6 Scoped Address Architecture
288 + RFC 5952: A Recommendation for IPv6 Address Text
289 + Representation";
290 +
291 + }
292 +
293 + typedef ip-prefix {
294 + type union {
295 + type ipv4-prefix;
296 + type ipv6-prefix;
297 + }
298 + description
299 + "The ip-prefix type represents an IP prefix and is IP
300 + version neutral. The format of the textual representations
301 + implies the IP version.";
302 + }
303 +
304 + typedef ipv4-prefix {
305 + type string {
306 + pattern
307 + '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))';
308 + }
309 + description
310 + "The ipv4-prefix type represents an IPv4 address prefix.
311 + The prefix length is given by the number following the
312 + slash character and must be less than or equal to 32.
313 +
314 + A prefix length value of n corresponds to an IP address
315 + mask that has n contiguous 1-bits from the most
316 + significant bit (MSB) and all other bits set to 0.
317 +
318 + The canonical format of an IPv4 prefix has all bits of
319 + the IPv4 address set to zero that are not part of the
320 + IPv4 prefix.";
321 + }
322 +
323 + typedef ipv6-prefix {
324 + type string {
325 + pattern
326 + '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))';
327 + pattern
328 + '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)(/.+)';
329 + }
330 + description
331 + "The ipv6-prefix type represents an IPv6 address prefix.
332 + The prefix length is given by the number following the
333 + slash character and must be less than or equal to 128.
334 +
335 + A prefix length value of n corresponds to an IP address
336 + mask that has n contiguous 1-bits from the most
337 + significant bit (MSB) and all other bits set to 0.
338 +
339 + The IPv6 address should have all bits that do not belong
340 + to the prefix set to zero.
341 +
342 + The canonical format of an IPv6 prefix has all bits of
343 + the IPv6 address set to zero that are not part of the
344 + IPv6 prefix. Furthermore, the IPv6 address is represented
345 + as defined in Section 4 of RFC 5952.";
346 + reference
347 + "RFC 5952: A Recommendation for IPv6 Address Text
348 + Representation";
349 +
350 + }
351 +
352 + typedef domain-name {
353 + type string {
354 + length "1..253";
355 + pattern
356 + '((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)|\.';
357 + }
358 + description
359 + "The domain-name type represents a DNS domain name. The
360 + name SHOULD be fully qualified whenever possible.
361 +
362 + Internet domain names are only loosely specified. Section
363 + 3.5 of RFC 1034 recommends a syntax (modified in Section
364 + 2.1 of RFC 1123). The pattern above is intended to allow
365 + for current practice in domain name use, and some possible
366 + future expansion. It is designed to hold various types of
367 + domain names, including names used for A or AAAA records
368 + (host names) and other records, such as SRV records. Note
369 + that Internet host names have a stricter syntax (described
370 + in RFC 952) than the DNS recommendations in RFCs 1034 and
371 + 1123, and that systems that want to store host names in
372 + schema nodes using the domain-name type are recommended to
373 + adhere to this stricter standard to ensure interoperability.
374 +
375 + The encoding of DNS names in the DNS protocol is limited
376 + to 255 characters. Since the encoding consists of labels
377 + prefixed by a length bytes and there is a trailing NULL
378 + byte, only 253 characters can appear in the textual dotted
379 + notation.
380 +
381 + The description clause of schema nodes using the domain-name
382 + type MUST describe when and how these names are resolved to
383 + IP addresses. Note that the resolution of a domain-name value
384 + may require to query multiple DNS records (e.g., A for IPv4
385 + and AAAA for IPv6). The order of the resolution process and
386 + which DNS record takes precedence can either be defined
387 + explicitly or may depend on the configuration of the
388 + resolver.
389 +
390 + Domain-name values use the US-ASCII encoding. Their canonical
391 + format uses lowercase US-ASCII characters. Internationalized
392 + domain names MUST be A-labels as per RFC 5890.";
393 + reference
394 + "RFC 952: DoD Internet Host Table Specification
395 + RFC 1034: Domain Names - Concepts and Facilities
396 + RFC 1123: Requirements for Internet Hosts -- Application
397 + and Support
398 + RFC 2782: A DNS RR for specifying the location of services
399 + (DNS SRV)
400 + RFC 5890: Internationalized Domain Names in Applications
401 + (IDNA): Definitions and Document Framework";
402 +
403 + }
404 +
405 + typedef host {
406 + type union {
407 + type ip-address;
408 + type domain-name;
409 + }
410 + description
411 + "The host type represents either an IP address or a DNS
412 + domain name.";
413 + }
414 +
415 + typedef uri {
416 + type string;
417 + description
418 + "The uri type represents a Uniform Resource Identifier
419 + (URI) as defined by STD 66.
420 +
421 + Objects using the uri type MUST be in US-ASCII encoding,
422 + and MUST be normalized as described by RFC 3986 Sections
423 + 6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary
424 + percent-encoding is removed, and all case-insensitive
425 + characters are set to lowercase except for hexadecimal
426 + digits, which are normalized to uppercase as described in
427 + Section 6.2.2.1.
428 +
429 + The purpose of this normalization is to help provide
430 + unique URIs. Note that this normalization is not
431 + sufficient to provide uniqueness. Two URIs that are
432 + textually distinct after this normalization may still be
433 + equivalent.
434 +
435 + Objects using the uri type may restrict the schemes that
436 + they permit. For example, 'data:' and 'urn:' schemes
437 + might not be appropriate.
438 +
439 + A zero-length URI is not a valid URI. This can be used to
440 + express 'URI absent' where required.
441 +
442 + In the value set and its semantics, this type is equivalent
443 + to the Uri SMIv2 textual convention defined in RFC 5017.";
444 + reference
445 + "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax
446 + RFC 3305: Report from the Joint W3C/IETF URI Planning Interest
447 + Group: Uniform Resource Identifiers (URIs), URLs,
448 + and Uniform Resource Names (URNs): Clarifications
449 + and Recommendations
450 + RFC 5017: MIB Textual Conventions for Uniform Resource
451 + Identifiers (URIs)";
452 +
453 + }
454 + } // module ietf-inet-types
1 + module ietf-sd-onos-common-types {
2 + namespace "urn:ietf:params:xml:ns:yang:ietf-sd-onos-common-types";
3 + prefix types ;
4 + /*
5 + import ietf-inet-types{
6 + prefix inet;
7 + }
8 + import ietf-yang-types {
9 + prefix yang-types;
10 + }
11 + */
12 + organization "";
13 + contact "";
14 +
15 + description
16 + "Defines common basic types of L3VPN.";
17 +
18 + revision "2015-12-16" {
19 + reference "";
20 + }
21 +
22 + typedef admin-status {
23 + type enumeration {
24 + enum admin-up {
25 + value 0 ;
26 + description "admin up, the operate-status is depend on the real
27 + running status ." ;
28 + }
29 + enum admin-down {
30 + value 1 ;
31 + description "admin down,the operate-status is forced to down no
32 + matter what the real status is" ;
33 + }
34 + enum config-up {
35 + value 2 ;
36 + description "the operate-status is forced to up no matter what
37 + the real status is." ;
38 + }
39 + }
40 + default admin-up;
41 + description
42 + "The administration status of the service.";
43 + }
44 +
45 + typedef notification-status {
46 + type enumeration {
47 + enum up {
48 + value 0 ;
49 + description "up." ;
50 + }
51 + enum down {
52 + value 1 ;
53 + description "down." ;
54 + }
55 + }
56 + default up;
57 + description
58 + "The notification status of the service.";
59 + }
60 +
61 + typedef notification-type {
62 + type enumeration {
63 + enum ne{
64 + value 0 ;
65 + description "ncd change." ;
66 + }
67 + enum link{
68 + value 1 ;
69 + description "link change." ;
70 + }
71 + enum ltp{
72 + value 2 ;
73 + description "ltp change." ;
74 + }
75 + }
76 + default ltp;
77 + description
78 + "The notification-type of the service.";
79 + }
80 +
81 + typedef operate-status {
82 + type enumeration {
83 + enum operate-up {
84 + value 0 ;
85 + description "operate up." ;
86 + }
87 + enum operate-down {
88 + value 1 ;
89 + description "operate down." ;
90 + }
91 + }
92 + default operate-up;
93 + description
94 + "The operation status of the service.";
95 + }
96 +
97 + grouping command-result {
98 + description
99 + "Reusable container of the result of the command.";
100 + container command-result {
101 + description
102 + "The result of the command.";
103 + leaf result {
104 + type int8;
105 + description
106 + "1 : success, 2 : failed, 3 : partly failed" ;
107 + }
108 + container success-resources {
109 + description
110 + "The resources those are available." ;
111 + list success-resource-list {
112 + description
113 + "The resource list shows those are available." ;
114 + leaf resource-id {
115 + type string;
116 + description
117 + "The available resource id." ;
118 + }
119 + }
120 + }
121 + container failed-resources {
122 + description
123 + "The resources those are failed." ;
124 + list failed-resource-list {
125 + description
126 + "The resources list shows those are failed." ;
127 + leaf resource-id {
128 + type string;
129 + description
130 + "The failed resources ids." ;
131 + }
132 + leaf error-code {
133 + type string;
134 + description
135 + "The error code." ;
136 + }
137 + }
138 + }
139 + }
140 + }
141 + }
1 + module ietf-sd-onos-service-l3vpn {
2 + namespace "urn:ietf:params:xml:ns:yang:ietf-sd-onos-service-l3vpn";
3 + prefix l3vpn ;
4 + /*
5 + import ietf-inet-types{
6 + prefix inet;
7 + }
8 + import ietf-yang-types {
9 + prefix yang-types;
10 + }
11 + */
12 + import ietf-sd-onos-service-types {
13 + prefix service-types;
14 + }
15 + import ietf-sd-onos-common-types {
16 + prefix types;
17 + }
18 + organization "";
19 + contact "";
20 +
21 + description
22 + "L3vpn configuration model in ONOS.";
23 +
24 + revision "2015-12-16" {
25 + reference "";
26 + }
27 +
28 + grouping l3vpn {
29 + description
30 + "The configuration module of l3 vpn.";
31 + leaf name {
32 + type string ;
33 + mandatory true;
34 + description "name of snc eline." ;
35 + }
36 + leaf id {
37 + type uint32 ;
38 + mandatory true;
39 + description "ID of snc eline." ;
40 + }
41 + leaf user-label {
42 + type string ;
43 + description "user label of snc eline." ;
44 + }
45 + leaf parent-ncd-id {
46 + type string ;
47 + description "parent ncd id." ;
48 + }
49 +
50 + leaf admin-status {
51 + type types:admin-status;
52 + description "administration status." ;
53 + }
54 + leaf operate-status {
55 + type types:operate-status;
56 + description "operation status." ;
57 + }
58 +
59 + uses service-type-grouping;
60 + container acess-information {
61 + description "access information of the l3 vpn." ;
62 +
63 + uses service-types:l3-ac; }
64 +
65 + container protect-policy{
66 + description "L3VPN Service protect policy." ;
67 + uses service-types:protect-policy;
68 + }
69 + container tunnel-service {
70 + description "tunnel service." ;
71 + uses service-types:tunnel-service;
72 + }
73 +
74 + }
75 +
76 + grouping service-type-grouping {
77 + description "Basic service type" ;
78 + leaf service-topology {
79 + type enumeration {
80 + enum full-mesh {
81 + value 1 ;
82 + description "full-mesh." ;
83 + }
84 + enum hub-spoke {
85 + value 2 ;
86 + description "hub-spoke." ;
87 + }
88 + }
89 + default full-mesh;
90 + description "service topology type." ;
91 + }
92 + }
93 +
94 + container service {
95 + description
96 + "Root level of L3vpn service module.";
97 + container l3vpn-cfg {
98 + description
99 + "L3vpn configuration model in ONOS.";
100 + list vpn-cfg {
101 + key name;
102 + description
103 + "vpn configuration parameter list.";
104 + uses l3vpn;
105 + }
106 + }
107 + container service-paths {
108 + description
109 + "The service path of the l3 vpn.";
110 + }
111 + }
112 +
113 +
114 +
115 + rpc create-l3vpn-instance {
116 + description "Create l3vpn instance." ;
117 + input {
118 + container l3vpn-instance {
119 + description "Create l3vpn instance." ;
120 + uses l3vpn;
121 + }
122 + }
123 + }
124 +
125 + rpc delete-l3vpn-instance {
126 + description "Delete l3vpn instance." ;
127 + input {
128 + leaf l3vpn-id {
129 + type string;
130 + description "vpn id." ;
131 + }
132 + }
133 + }
134 +
135 + rpc close-l3vpn {
136 + description "Close l3vpn." ;
137 + input {
138 + leaf l3vpn-id {
139 + type string;
140 + description "vpn id." ;
141 + }
142 + container ac-status {
143 + description "Access status of the vpn." ;
144 + list acs{
145 + key "id";
146 + description "Access information." ;
147 + leaf id {
148 + type string;
149 + description "Access id." ;
150 + }
151 + leaf admin-status {
152 + type types:admin-status;
153 + description "Administration status." ;
154 + }
155 + }
156 + }
157 + }
158 + }
159 +
160 + rpc modify-l3vpn-instance-basic {
161 + description "Modify l3vpn instance basic information." ;
162 + input {
163 + leaf l3vpn-id {
164 + type string;
165 + description "vpn id." ;
166 + }
167 + leaf user-label {
168 + type string ;
169 + description "user label." ;
170 + }
171 + }
172 + }
173 +
174 + rpc modify-l3vpn-instance-ac-qos {
175 + description "Modify l3vpn instance ac qos information." ;
176 + input {
177 + leaf l3vpn-id {
178 + type string;
179 + description "L3vpn ID." ;
180 + }
181 + container ac-qos {
182 + description "ac qos information." ;
183 + list acs{
184 + key "id";
185 + description "acs list." ;
186 + leaf id {
187 + type string;
188 + description "acs ID." ;
189 + }
190 + container qos-policy {
191 + description "qos policy." ;
192 + container qos-if-cars {
193 + description "cars qos policy." ;
194 + uses service-types:qos-if-car;
195 +
196 + }
197 + }
198 + }
199 + }
200 + }
201 + }
202 + rpc modify-l3vpn-instance-connection {
203 + description "Modify a l3vpn connection." ;
204 + input {
205 + leaf l3vpn-id {
206 + type string;
207 + description "L3vpn ID." ;
208 + }
209 + container ac-connection {
210 + description "ac connection." ;
211 + list acs{
212 + key "id";
213 + description "acs ID." ;
214 + leaf id {
215 + type string ;
216 + description "acs ID." ;
217 + }
218 + container connection {
219 + description "CE to PE connection." ;
220 + uses service-types:connection;
221 + }
222 + }
223 + }
224 + }
225 + }
226 + rpc inquire-l3vpn-instance-work-path {
227 + description "Inquire a L3VPN instance work path." ;
228 + input {
229 + leaf service-id {
230 + type string;
231 + description "service ID." ;
232 + }
233 + leaf ingress-ne-id {
234 + type string ;
235 + description "ingress network element ID." ;
236 + }
237 + leaf destination-ne-id {
238 + type string ;
239 + description "destination network element ID." ;
240 + }
241 + leaf ingress-ac-id {
242 + type string ;
243 + description "ingress ac ID." ;
244 + }
245 + leaf destination-ac-id {
246 + type string ;
247 + description "destination ac ID." ;
248 + }
249 + leaf path-layer {
250 + type string ;
251 + description "path layer." ;
252 + }
253 + leaf path-role {
254 + type string ;
255 + description "path role." ;
256 + }
257 + }
258 + output {
259 + container service-path {
260 + description "service path." ;
261 + leaf service-id {
262 + type string;
263 + description "service ID." ;
264 + }
265 + leaf ingress-ne-id {
266 + type string ;
267 + description "ingress network element ID." ;
268 + }
269 + leaf destination-ne-id {
270 + type string ;
271 + description "destination network element ID." ;
272 + }
273 + leaf ingress-ac-id {
274 + type string ;
275 + description "ingress access circuit ID." ;
276 + }
277 + leaf destination-ac-id {
278 + type string ;
279 + description "destination access circuit ID." ;
280 + }
281 + leaf path-layer {
282 + type string ;
283 + description "path layer." ;
284 + }
285 + leaf path-role {
286 + type string ;
287 + description "path role." ;
288 + }
289 + list path-list {
290 + key "ne-id";
291 + description "path list." ;
292 + leaf ne-id {
293 + type string;
294 + description "network element ID." ;
295 + }
296 + leaf ingress-ltp-id {
297 + type string;
298 + description "LTP ID." ;
299 + }
300 + leaf backward-peer-id {
301 + type string;
302 + description "backward peer ID." ;
303 + }
304 + leaf egress-ltp-id {
305 + type string;
306 + description "egress ltp ID." ;
307 + }
308 + leaf forward-peer-id {
309 + type string;
310 + description "forward peer ID." ;
311 + }
312 + }
313 + }
314 + }
315 + }
316 + }
1 + module ietf-sd-onos-service-types {
2 + namespace "urn:ietf:params:xml:ns:yang:ietf-sd-onos-service-types";
3 + prefix service-types ;
4 +
5 + import ietf-inet-types {prefix inet; }
6 + import ietf-sd-onos-common-types {prefix types;}
7 +
8 + organization "";
9 + contact "";
10 +
11 + description
12 + "Defines basic service types for L3VPN service.";
13 +
14 + revision "2015-12-16" {
15 + reference "";
16 + }
17 +
18 + typedef exp {
19 + type enumeration {
20 + enum BE {
21 + value 0 ;
22 + description "BE." ;
23 + }
24 + enum AF1 {
25 + value 1 ;
26 + description "AF1." ;
27 + }
28 + enum AF2 {
29 + value 2 ;
30 + description "AF2." ;
31 + }
32 + enum AF3 {
33 + value 3 ;
34 + description "AF3." ;
35 + }
36 + enum AF4 {
37 + value 4 ;
38 + description "AF4." ;
39 + }
40 + enum EF {
41 + value 5 ;
42 + description "EF." ;
43 + }
44 + enum CS6 {
45 + value 6 ;
46 + description "CS6." ;
47 + }
48 + enum CS7 {
49 + value 7 ;
50 + description "CS7." ;
51 + }
52 + }
53 + default CS7;
54 + description
55 + "exp parameter.";
56 + }
57 +
58 + typedef pw-role{
59 + type enumeration {
60 + enum normal{
61 + value 0 ;
62 + description "normal." ;
63 + }
64 + enum master {
65 + value 1 ;
66 + description "master." ;
67 + }
68 + enum slave {
69 + value 2 ;
70 + description "slave." ;
71 + }
72 + enum DNI-PW {
73 + value 3 ;
74 + description "DNI PW." ;
75 + }
76 + }
77 + default normal;
78 + description
79 + "The role of the PW.";
80 + }
81 +
82 + grouping qos-if-car {
83 + description "qos parameter." ;
84 + list qos-if-car {
85 + key "direction";
86 + description "cars qos policy." ;
87 + leaf direction {
88 + type enumeration {
89 + enum inbound{
90 + value 0 ;
91 + description "inbound." ;
92 + }
93 + enum outbound {
94 + value 1 ;
95 + description "outbound." ;
96 + }
97 + }
98 + description "qos for interface car" ;
99 + }
100 +
101 + leaf cir {
102 + type int32;
103 + description "forward CIR. unit:Kbps" ;
104 + }
105 + leaf pir {
106 + type int32;
107 + description "forward PIR. unit:Kbps" ;
108 + }
109 + leaf cbs {
110 + type int32;
111 + description "forward CBS. unit:Kbps" ;
112 + }
113 + leaf pbs {
114 + type int32;
115 + description "forward PBS. unit:Kbps" ;
116 + }
117 + }
118 + }
119 +
120 + grouping protect-policy {
121 + description "The protect policy of the VPN" ;
122 + leaf protect-type {
123 + type enumeration {
124 + enum unprotected {
125 + value 0 ;
126 + description "unprotected." ;
127 + }
128 + enum protected {
129 + value 1 ;
130 + description "protection." ;
131 + }
132 + }
133 + default unprotected ;
134 + description "protection type" ;
135 + }
136 +
137 + leaf revertive-type {
138 + type enumeration {
139 + enum no-revertive {
140 + value 0 ;
141 + description "unprotected." ;
142 + }
143 + enum revertive {
144 + value 1 ;
145 + description "protection." ;
146 + }
147 + }
148 + description "revertive mode" ;
149 + }
150 + leaf wtr {
151 + type uint32;
152 + default 300;
153 + description "WTR.unit:s" ;
154 + }
155 + }
156 + grouping oam-policy {
157 + description "The oam policy of the vpn service." ;
158 + leaf detect-type {
159 + type enumeration {
160 + enum undetect {
161 + value 0 ;
162 + description "unprotected." ;
163 + }
164 + enum APS {
165 + value 1 ;
166 + description "protection." ;
167 + }
168 + enum BFD {
169 + value 2 ;
170 + description "unprotected." ;
171 + }
172 + }
173 + description "detect type" ;
174 + }
175 + container bfd-detect-para {
176 + description "bfd detect parameters." ;
177 + leaf ingress-discriminator {
178 + type int32;
179 + description "ingress-discriminator" ;
180 + }
181 + leaf egress-discriminator {
182 + type int32;
183 + description "egress-discriminator" ;
184 + }
185 + leaf tx-interval {
186 + type int32;
187 + description "tx-interval" ;
188 + }
189 + leaf rx-interval {
190 + type int32;
191 + description "rx-interval" ;
192 + }
193 + leaf detect-interval {
194 + type int32;
195 + description "detect-interval" ;
196 + }
197 + }
198 + }
199 + grouping ac {
200 + description "Access information." ;
201 + leaf id{
202 + type string;
203 + mandatory true;
204 + description "ac id." ;
205 + }
206 + leaf name{
207 + type string;
208 + config false;
209 + description "ac name." ;
210 + }
211 +
212 + leaf ne-id {
213 + type string ;
214 + mandatory true;
215 + description "ne id." ;
216 + }
217 +
218 + leaf ltp-id {
219 + type string ;
220 + mandatory true;
221 + description "ltp id." ;
222 + }
223 + leaf admin-status {
224 + type types:admin-status;
225 + description "Administration status." ;
226 + }
227 + leaf operate-status {
228 + type types:operate-status;
229 + description "Operation status." ;
230 + }
231 + container l2-access {
232 + description "link layer access information of ac." ;
233 + uses l2-access;
234 + }
235 +
236 + leaf role {
237 + type enumeration {
238 + enum master {
239 + value 0 ;
240 + description "master." ;
241 + }
242 + enum slave {
243 + value 1 ;
244 + description "slave." ;
245 + }
246 + enum hub {
247 + value 2 ;
248 + description "slave." ;
249 + }
250 + enum spoke {
251 + value 3 ;
252 + description "slave." ;
253 + }
254 + }
255 + default master;
256 + description "role of snc lsp." ;
257 + }
258 + container qos-policy {
259 + description "The qos policy of the vpn service." ;
260 + container qos-if-cars {
261 + description "qos policy if car." ;
262 + list qos-if-car {
263 + //key "direction";
264 + uses qos-if-car;
265 + description "List of qos parameters." ;
266 + }
267 + }
268 + }
269 + }
270 + grouping l3-ac {
271 + description "Access information of l3vpn." ;
272 + list access-circuit {
273 + key "id";
274 + description "list of access circuit." ;
275 + uses ac;
276 + container connection {
277 + description "connection information of ac." ;
278 + uses connection;
279 + }
280 + }
281 + }
282 + grouping l2-access {
283 + description "Access information of l2vpn." ;
284 + leaf access-type{
285 + type enumeration {
286 + enum Port {
287 + value 0 ;
288 + description "master." ;
289 + }
290 + enum Dot1Q {
291 + value 1 ;
292 + description "slave." ;
293 + }
294 + enum QinQ {
295 + value 2 ;
296 + description "master." ;
297 + }
298 + }
299 + mandatory true;
300 + description "The access type of the vpn service." ;
301 + }
302 + leaf dot1q-vlan-bitmap {
303 + type string;
304 + mandatory true;
305 + description "Dot1Q Vlan Bitmap." ;
306 + }
307 +
308 + leaf qinq-svlan-bitmap {
309 + type string;
310 + mandatory true;
311 + description "QinQ svlan Bitmap." ;
312 + }
313 +
314 + leaf qinq-cvlan-bitmap {
315 + type string;
316 + mandatory true;
317 + description "QinQ cvlan Bitmap." ;
318 + }
319 + leaf access-action {
320 + type enumeration {
321 + enum Keep {
322 + value 0 ;
323 + description "keep." ;
324 + }
325 + enum Push {
326 + value 1 ;
327 + description "push." ;
328 + }
329 + enum Pop {
330 + value 2 ;
331 + description "pop." ;
332 + }
333 + enum Swap {
334 + value 3 ;
335 + description "swap." ;
336 + }
337 + }
338 + mandatory true;
339 + description "access type." ;
340 + }
341 +
342 + leaf action-vlan-id {
343 + type int32 {
344 + range "1..4094";
345 + }
346 + description "action vlan id." ;
347 + }
348 + }
349 + grouping connection {
350 + description "Describe the connection of the vpn service." ;
351 + leaf ip-address {
352 + type inet:ip-address ;
353 + description "ip address of access circuit's connection." ;
354 + }
355 + leaf mask-length {
356 + type int32 {
357 + range "1..32";
358 + }
359 + description "mask length of ip address." ;
360 + }
361 + leaf protocols {
362 + type enumeration {
363 + enum static {
364 + value 0 ;
365 + description "static." ;
366 + }
367 + enum ospf {
368 + value 1 ;
369 + description "ospf." ;
370 + }
371 + enum isis {
372 + value 2 ;
373 + description "bgp" ;
374 + }
375 + enum bgp {
376 + value 3 ;
377 + description "bgp" ;
378 + }
379 + }
380 + description "protocols between PE and CE." ;
381 + }
382 + container static-routes {
383 + description "Defines the static routes." ;
384 + list static-route {
385 + key "ip-prefix mask-length";
386 + description "List of static route." ;
387 + leaf ip-prefix {
388 + type inet:ipv4-address;
389 + description "ip prefix" ;
390 + }
391 + leaf mask-length {
392 + type uint32 {
393 + range "1..32";
394 + }
395 + description "mast length" ;
396 + }
397 + leaf next-hop {
398 + type inet:ipv4-address ;
399 + description "next hop" ;
400 + }
401 + leaf preference {
402 + type uint32 {
403 + range "1..65535";
404 + }
405 + description "preference of the route." ;
406 + }
407 + }
408 + }
409 + }
410 +
411 + grouping pw{
412 + description "PW definition ";
413 + leaf id {
414 + type string ;
415 + description "ID of pw." ;
416 + }
417 + uses encaplate-type-grouping;
418 +
419 + leaf ingress-ne-id {
420 + type string ;
421 + description "ingress ne id." ;
422 + }
423 +
424 + leaf egress-ne-id {
425 + type string ;
426 + description "egress ne id." ;
427 + }
428 +
429 + leaf ctrl-word-support {
430 + type enumeration {
431 + enum not-support {
432 + value 0 ;
433 + description "pw doesn't support control word" ;
434 + }
435 + enum support {
436 + value 1 ;
437 + description "pw supports control word" ;
438 + }
439 + }
440 + default support;
441 + description "ctrl word support. 0 : not support, 1 : support" ;
442 + }
443 +
444 + leaf sn-support {
445 + type enumeration {
446 + enum not-support {
447 + value 0 ;
448 + description "pw doesn't support control word" ;
449 + }
450 + enum support {
451 + value 1 ;
452 + description "pw supports control word" ;
453 + }
454 + }
455 + default not-support;
456 + description "serial number support. 0 : not support, 1 : support" ;
457 + }
458 +
459 + leaf vccv-type {
460 + type enumeration {
461 + enum not-support {
462 + value 0 ;
463 + description "pw doesn't support vccv" ;
464 + }
465 + enum CWD {
466 + value 1 ;
467 + description "pw supports vccv" ;
468 + }
469 + enum Label-alert {
470 + value 2 ;
471 + description "pw supports vccv" ;
472 + }
473 + enum TTL {
474 + value 3 ;
475 + description "pw supports vccv" ;
476 + }
477 + enum CWD&Label-alert {
478 + value 4 ;
479 + description "pw supports vccv" ;
480 + }
481 + enum CWD&TTL {
482 + value 5 ;
483 + description "pw supports vccv" ;
484 + }
485 + enum Label-alert&TTL {
486 + value 6 ;
487 + description "pw supports vccv" ;
488 + }
489 + enum CWD&Label-alert&TTL {
490 + value 7 ;
491 + description "pw supports vccv" ;
492 + }
493 + }
494 + default not-support;
495 + description "vccv type" ;
496 + }
497 +
498 + leaf conn-ack-type {
499 + type enumeration {
500 + enum not-support {
501 + value 0 ;
502 + description "pw doesn't support connection ack" ;
503 + }
504 + enum support {
505 + value 1 ;
506 + description "pw supports connection ack" ;
507 + }
508 + }
509 + default not-support;
510 + description "Connectivity test type" ;
511 + }
512 + container tunnels {
513 + description "Define tunnels." ;
514 + list tunnel{
515 + key "tunnel-id";
516 + description "The list of tunnel id." ;
517 + uses tunnel;
518 + }
519 + }
520 + }
521 + grouping tunnel {
522 + description "Reusable entity of tunnel." ;
523 + leaf tunnel-id {
524 + type string ;
525 + description "ID of tunnel." ;
526 + }
527 + }
528 + grouping encaplate-type-grouping {
529 + description "encaplate type" ;
530 + leaf encaplate-type {
531 + type enumeration {
532 + enum NONE {
533 + value 0 ;
534 + description "none." ;
535 + }
536 + enum fr-dlci-martini {
537 + value 1 ;
538 + description "fr-dlci-martini." ;
539 + }
540 + enum atm-aal5-sdu {
541 + value 2 ;
542 + description "atm-aal5-sdu." ;
543 + }
544 + enum atm-transparent {
545 + value 3 ;
546 + description "atm-transparent." ;
547 + }
548 + enum ethernet-vlan {
549 + value 4 ;
550 + description "ethernet-vlan." ;
551 + }
552 + enum ethernet {
553 + value 5 ;
554 + description "ethernet ." ;
555 + }
556 + enum hdlc {
557 + value 6 ;
558 + description " hdlc." ;
559 + }
560 + enum ppp {
561 + value 7 ;
562 + description "ppp." ;
563 + }
564 + enum cep-mpls {
565 + value 8 ;
566 + description " cep-mpls." ;
567 + }
568 + enum atm-ntol {
569 + value 9 ;
570 + description "atm-ntol." ;
571 + }
572 + enum atm-nto1-vpc {
573 + value 10 ;
574 + description "atm-nto1-vpc." ;
575 + }
576 + enum ip-layer2 {
577 + value 11 ;
578 + description " ip-layer2." ;
579 + }
580 + enum atm-1to1-vcc {
581 + value 12 ;
582 + description "atm-1to1-vcc." ;
583 + }
584 + enum atm-1to1-vpc {
585 + value 13 ;
586 + description "atm-1to1-vpc." ;
587 + }
588 + enum atm-aal5-pdu {
589 + value 14 ;
590 + description "atm-aal5-pdu." ;
591 + }
592 + enum fr-port {
593 + value 15 ;
594 + description "fr-port." ;
595 + }
596 + enum cep-packet {
597 + value 16 ;
598 + description "cep-packet." ;
599 + }
600 + enum e1 {
601 + value 17 ;
602 + description "e1." ;
603 + }
604 + enum t1 {
605 + value 18 ;
606 + description "t1." ;
607 + }
608 + enum e3 {
609 + value 19 ;
610 + description "e3." ;
611 + }
612 + enum t3 {
613 + value 20 ;
614 + description " t3." ;
615 + }
616 + enum cesopsn-basic {
617 + value 21 ;
618 + description "cesopsn-basic." ;
619 + }
620 + enum tdmoip-aal1 {
621 + value 22 ;
622 + description "tdmoip-aal1." ;
623 + }
624 + enum cesopsn-tdm {
625 + value 23 ;
626 + description "cesopsn-tdm." ;
627 + }
628 + enum tdmoip-aal2 {
629 + value 24 ;
630 + description "tdmoip-aal2." ;
631 + }
632 + enum fr-dlci {
633 + value 25 ;
634 + description "fr-dlci." ;
635 + }
636 + }
637 + description "encaplate type." ;
638 + }
639 + }
640 +
641 + grouping pw-trail{
642 + description "pw trail information." ;
643 + leaf id {
644 + type string ;
645 + description "ID of pw-trail." ;
646 + }
647 +
648 + leaf role {
649 + type pw-role;
650 + description "role of pw-trail." ;
651 + }
652 + container pw-lists {
653 + description "List of pw information." ;
654 + list pw-list {
655 + key id;
656 + description "List of pw information." ;
657 + uses pw ;
658 + }
659 + }
660 + }
661 + grouping tunnel-service {
662 + description "Reusable entity of tunnel service." ;
663 + leaf signaling-type {
664 + type enumeration {
665 + enum RSVP-TE {
666 + value 0 ;
667 + description "RSVP-TE" ;
668 + }
669 + enum LDP {
670 + value 1 ;
671 + description "LDP" ;
672 + }
673 + enum GRE {
674 + value 2 ;
675 + description "GRE" ;
676 + }
677 + enum SR-BE {
678 + value 3 ;
679 + description "SR-BE" ;
680 + }
681 + enum SR-TE {
682 + value 4 ;
683 + description "SR-TE" ;
684 + }
685 + }
686 + default RSVP-TE;
687 + description "signaling type." ;
688 + }
689 + leaf tunnel-mode {
690 + type enumeration {
691 + enum Nto1 {
692 + value 0 ;
693 + description "multi service one tunnel" ;
694 + }
695 + enum 1to1 {
696 + value 1 ;
697 + description "oner service one tunnel" ;
698 + }
699 + }
700 + default Nto1;
701 + description "service to tunnel mode." ;
702 + }
703 + container protect-policy {
704 + description "Protect policy." ;
705 + uses protect-policy;
706 + }
707 + container oam-policy {
708 + description "oam policy." ;
709 + uses oam-policy;
710 + }
711 + leaf latency {
712 + type int32;
713 + description "tunnel latency requirement." ;
714 + }
715 + }
716 + grouping service-path {
717 + description "Service path of l3vpn." ;
718 + list service-path{
719 + key "service-id source-ne-id source-ac-id destination-ne-id destination-ac-id";
720 + description
721 + "The list of service path.";
722 + leaf service-id {
723 + type string ;
724 + description "l2vpn or l3vpn service id." ;
725 + }
726 + leaf source-ne-id {
727 + type string ;
728 + description "source ne id." ;
729 + }
730 +
731 + leaf source-ac-id {
732 + type string ;
733 + description "source ltp id." ;
734 + }
735 + leaf destination-ne-id {
736 + type string ;
737 + description "destination ne id." ;
738 + }
739 +
740 + leaf destination-ac-id {
741 + type string ;
742 + description "destination ltp id." ;
743 + }
744 + container path-lists{
745 + description "The path list of service path." ;
746 + list path-list {
747 + key "path-layer path-role";
748 + description "The path list of service path." ;
749 + leaf path-layer {
750 + type enumeration {
751 + enum PW {
752 + value 0 ;
753 + description "pw path." ;
754 + }
755 + enum BGP-LSP {
756 + value 1 ;
757 + description "BGP-LSP Path." ;
758 + }
759 + enum LSP {
760 + value 2 ;
761 + description "LSP Path." ;
762 + }
763 + }
764 + description "path type. 0 : PW, 1 : BGP-LSP, 2 : PW" ;
765 + }
766 + leaf path-role {
767 + type enumeration {
768 + enum Primary {
769 + value 0 ;
770 + description "master path." ;
771 + }
772 + enum Backup {
773 + value 1 ;
774 + description "backup path." ;
775 + }
776 + enum Active {
777 + value 2 ;
778 + description "active path." ;
779 + }
780 + }
781 + description "path role.. 0 : master, 1 : backup, 2 :
782 + Bypass." ;
783 + }
784 + container paths {
785 + description "path definition." ;
786 + list path {
787 + key "ne-id";
788 + description "Network element id list." ;
789 + leaf ne-id {
790 + type string;
791 + description "Network element id." ;
792 + }
793 + leaf ingress-ltp-id {
794 + type string;
795 + description "ingress ltd id." ;
796 + }
797 + leaf backward-peer-id {
798 + type string;
799 + description "backward peer id." ;
800 + }
801 + leaf egress-ltp-id {
802 + type string;
803 + description "egress ltd id." ;
804 + }
805 + leaf forward-peer-id {
806 + type string;
807 + description "forward peer id." ;
808 + }
809 + }
810 + }
811 + }
812 + }
813 +
814 + }
815 + }
816 + }