Upgrade ietf-{inet,yang}-types to 2013-07-15
[groupbasedpolicy.git] / renderers / iovisor / src / main / yang / iovisor.yang
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. 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
7  */
8
9 module iovisor {
10     yang-version 1;
11
12     namespace "urn:opendaylight:groupbasedpolicy:iovisor";
13     prefix "iovisor";
14
15     import yang-ext {prefix ext; revision-date "2013-07-09";}
16     import ietf-inet-types { prefix inet; revision-date 2013-07-15; }
17     import endpoint { prefix endpoint; }
18     import gbp-common { prefix gbp-common; }
19
20     description
21         "This module defines the group-based policy iovisor renderer model.";
22
23     revision "2015-10-30" {
24         description
25                 "Initial revision.";
26     }
27
28     typedef iovisor-module-id {
29         /*
30         * TODO Either convert this to URI or allow String but expect name:port where name will
31         * resolved into ip:port (see iovisor-module grouping)
32         */
33         description "Uniquely identifies the IOVisor module";
34         type string;
35     }
36
37     grouping iovisor-module {
38         /*
39         * TODO Convert this to leafs of IP(v4|v6) and port - easier to validate
40         * For now assuming format "ip:port"
41         */
42         leaf uri {
43             type inet:uri;
44             description "IOVisor module uniform resource identifier.";
45         }
46     }
47
48     container iovisor-module-instances {
49         description "IOVisor module inventory.";
50         leaf base-url {
51             type string;
52             default "/policies";
53         }
54
55         list iovisor-module-instance {
56             key "id";
57             config true;
58             description "This is a list of IOVisor modules.";
59
60             leaf id {
61                 type iovisor-module-id;
62             }
63
64             uses iovisor-module;
65         }
66     }
67
68     container iovisor-resolved-endpoints {
69         description "IOvisor validated Endpoints";
70         config false;
71         list iovisor-resolved-endpoint {
72             key "l3-context ip-address";
73             uses endpoint:l3-key;
74         }
75     }
76
77     container iovisor-modules-by-tenant-by-endpointgroup-id {
78         config false;
79         list iovisor-module-by-tenant-by-endpointgroup-id {
80             key "tenant-id endpointgroup-id";
81             leaf tenant-id {
82                 type gbp-common:tenant-id;
83             }
84             leaf endpointgroup-id {
85                 type gbp-common:endpoint-group-id;
86             }
87             list iovisor-module-instance-id {
88                 key "id";
89                 leaf id {
90                     type iovisor-module-id;
91                 }
92             }
93         }
94     }
95
96     container iovisor-resolved-endpoints-by-tenant-by-endpointgroup-id {
97         config false;
98         list iovisor-resolved-endpoint-by-tenant-by-endpointgroup-id {
99             key "tenant-id endpointgroup-id";
100             leaf tenant-id {
101                 type gbp-common:tenant-id;
102             }
103             leaf endpointgroup-id {
104                 type gbp-common:endpoint-group-id;
105             }
106             list iovisor-endpoint {
107                 key "l3-context ip-address";
108                 uses endpoint:l3-key;
109             }
110         }
111     }
112
113     augment "/endpoint:endpoints/endpoint:endpoint-l3" {
114         description "Augmentation adding the IOVisor module location";
115         ext:augment-identifier "iovisor-module-augmentation";
116         uses iovisor-module;
117     }
118
119     augment "/endpoint:register-endpoint/endpoint:input" {
120         description "Augmentation adding the IOVisor module location";
121         ext:augment-identifier "iovisor-module-augmentation-input";
122         uses iovisor-module;
123     }
124 }