Merge "Fix for failed to parse versions like 2.3.1-git3282e51"
[ovsdb.git] / southbound / southbound-api / src / main / yang / ovsdb.yang
1 module ovsdb {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:ovsdb";
4     prefix "southbound";
5
6     import network-topology {prefix "topo"; revision-date "2013-10-21"; }
7     import yang-ext { prefix "ext"; }
8     import ietf-inet-types { prefix inet; }
9     import overlay { prefix overlay; }
10     import ietf-yang-types { prefix yang; revision-date "2013-07-15";}
11
12     revision "2015-01-05" {
13         description "Initial revision of southbound model";
14     }
15     
16     typedef ovsdb-bridge-ref {
17         description "A reference to an ovsdb bridge";
18         type instance-identifier;
19     }
20     
21     typedef ovsdb-node-ref {
22         description "A reference to an ovsdb node";
23         type instance-identifier;
24     }
25     
26     grouping ovsdb-bridge-attributes {
27         leaf bridge-uuid {
28             description "The unique identifier of the bridge";
29             type yang:uuid;
30         }
31
32         leaf bridge-name {
33             description "The name of the bridge";
34             type string;
35         }
36
37         leaf managed-by {
38             description "The OVSDB which this bridge belongs to";
39             type ovsdb-node-ref;
40         }
41     }
42
43     grouping ovsdb-node-attributes {
44         uses overlay:ip-port-locator;
45
46         list managed-node-entry {
47             key "bridge-ref";
48             leaf bridge-ref {
49                 type ovsdb-bridge-ref;
50             }
51         }
52     }
53
54
55     identity interface-type-base {
56         description "Base identity for all OVSDB interface types";
57     }
58
59     identity interface-type-system {
60         description "Interface type for system interfaces";
61         base interface-type-base;
62     }
63
64     identity interface-type-internal {
65         description "Interface type for internal interfaces";
66         base interface-type-base;
67     }
68
69     identity interface-type-vxlan {
70         description "Interface type for vxlan interfaces";
71         base interface-type-base;
72     }
73
74     identity interface-type-patch {
75         description "Interface type for patch interfaces";
76         base interface-type-base;
77     }
78
79     grouping ovsdb-port-interface-attributes {
80         leaf port-uuid {
81             description "The unique identifier of the OVSDB port";
82             type yang:uuid;
83         }
84
85         leaf interface-uuid {
86             description "The unique identifier of the OVSDB interface";
87             type yang:uuid;
88         }
89
90         leaf name {
91             description "The name of the OVSDB port/interface";
92             type string;
93         }
94
95         leaf interface-type {
96             description "The type of the OVSDB interface";
97             type identityref {
98                 base interface-type-base;
99             }
100         }
101     }
102
103     augment "/topo:network-topology/topo:topology/topo:node" {
104         description "Augmentation for bridge nodes managed by ovsdb";
105         ext:augment-identifier "ovsdb-managed-node-augmentation";
106         uses ovsdb-bridge-attributes;
107     }
108
109     augment "/topo:network-topology/topo:topology/topo:node" {
110         description "Augment topology node for an ovsdb node";
111         ext:augment-identifier "ovsdb-node-augmentation";
112         uses ovsdb-node-attributes;
113     }
114
115     augment "/topo:network-topology/topo:topology/topo:node/topo:termination-point" {
116         description "Augment topology node termination-point for an ovsdb port/interface";
117         ext:augment-identifier "ovsdb-termination-point-augmentation";
118         uses ovsdb-port-interface-attributes;
119     }
120 }