Added support for VPN Intent
[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     grouping vpn-intent {
28         leaf vpn-name {
29             type string;
30             description "VPN name";
31             mandatory true;
32         }
33         list endpoint {
34             key "site-name";
35             uses endpoint-fields;
36             description "List to keep track site name and endpoint.";
37           }
38     }
39
40     grouping endpoint-fields {
41         leaf site-name{
42             type string;
43             description "VPN member site name.";
44         }
45
46         leaf ip-prefix {
47             type inet:ip-prefix;
48             description "VPN member IP prefix.";
49         }
50
51         leaf switch-port-id {
52             type string;
53             description "Switch and port ID that VPN member is connected to.";
54         }
55     }
56
57     grouping labels {
58         list label {
59             key "label-id";
60             leaf "label-id"{
61                 type uint64;
62                 description "MPLS or other label ID.";
63                 mandatory true;
64             }
65             uses endpoint-fields;
66             description "Keep track of MPLS/other label endpoint relation.";
67         }
68      }
69   }