Merge "Use ${project.version} for internal dependencies"
[ovsdb.git] / netvirt / api / src / main / yang / netvirt-devices.yang
1 module netvirt-devices {
2     yang-version 1;
3     namespace "urn:opendaylight:netvirt:devices";
4     prefix "devices";
5
6     revision "2015-12-27" {
7         description "Initial revision of netvirt devices definition";
8     }
9
10     import ietf-yang-types { prefix yang; }
11     import ietf-inet-types { prefix inet; }
12     import netvirt-common { prefix "common"; }
13     import opendaylight-l2-types { prefix l2types; }
14
15
16
17     grouping flat-attributes {
18     }
19
20     grouping vlan-attributes {
21     }
22
23     grouping gre-attributes {
24         leaf ip-addr {
25             type inet:ip-address;
26         }
27         leaf port {
28             type inet:port-number;
29         }
30     }
31
32     grouping vxlan-attributes {
33         leaf ip-addr {
34             type inet:ip-address;
35         }
36         leaf port {
37             type inet:port-number;
38         }
39     }
40
41     grouping vxlan-gpe-attributes {
42         leaf ip-addr {
43             type inet:ip-address;
44         }
45         leaf port {
46             type inet:port-number;
47         }
48     }
49
50     grouping device-locator {
51         uses common:base-attributes;
52
53         leaf locator-type {
54             type common:network-type;
55         }
56
57         choice locator-attr {
58             case flat {
59                 uses flat-attributes;
60             }
61             case vlan {
62                 uses vlan-attributes;
63             }
64             case gre {
65                 uses gre-attributes;
66             }
67             case vxlan {
68                 uses vxlan-attributes;
69             }
70             case vxlan-gpe {
71                 uses vxlan-gpe-attributes;
72             }
73         }
74     }
75
76     grouping device {
77         uses common:base-attributes;
78
79         leaf device-type {
80             type enumeration {
81                  enum ovs;
82                  enum hwgw;
83              }
84         }
85
86         // TODO: Need to look at info needed per bridge.
87         list bridges {
88             leaf name {
89                 type string;
90             }
91         }
92
93         list device-locators {
94             key uuid;
95             uses device-locator;
96         }
97     }
98
99     container devices {
100         list device {
101             key uuid;
102             uses device;
103         }
104     }
105 }