e9a971db1e976e08dd30de6e2778efbc0b514e71
[vpnservice.git] / vpnintent / api / src / main / yang / vpnintent.yang
1 /*
2  * Copyright (c) 2016 Inocybe Technologies and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
7  */
8 module vpnintent {
9     yang-version 1;
10     namespace "urn:opendaylight:params:xml:ns:yang:vpnintent";
11     prefix "vpnintent";
12
13     import ietf-inet-types { prefix inet; revision-date 2010-09-24;}
14
15     revision "2015-01-05" {
16         description "Initial revision of VPN intent model.
17             Create VPN via Intent, keep VPN state and manage MPLS labels";
18     }
19
20     container vpns{
21         list vpn-intents {
22             key "vpn-name";
23             uses vpn-intent;
24         }
25     }
26
27     typedef failover-type {
28         type enumeration {
29             enum fast-reroute {
30                 value 1;
31             }
32             enum slow-reroute {
33                 value 2;
34             }
35         }
36     }
37
38     grouping vpn-intent {
39         leaf vpn-name {
40             type string;
41             description "VPN name";
42             mandatory true;
43         }
44         leaf path-protection {
45             type boolean;
46         }
47         leaf failover-type {
48             type failover-type;
49         }
50         list endpoint {
51             key "site-name";
52             uses endpoint-fields;
53             description "List to keep track site name and endpoint.";
54           }
55     }
56
57     grouping endpoint-fields {
58         leaf site-name{
59             type string;
60             description "VPN member site name.";
61         }
62
63         leaf ip-prefix {
64             type inet:ip-prefix;
65             description "VPN member IP prefix.";
66         }
67
68         leaf switch-port-id {
69             type string;
70             description "Switch and port ID that VPN member is connected to.";
71         }
72     }
73
74     grouping labels {
75         list label {
76             key "label-id";
77             leaf "label-id"{
78                 type uint32 {
79                     range "0 .. 524288";
80                 }
81                 description "20 bit MPLS label ID";
82                 mandatory true;
83             }
84             uses endpoint-fields;
85             description "Keep track of MPLS/other label endpoint relation.";
86         }
87      }
88
89     container mpls-labels {
90         uses labels;
91    }
92   }