Integrating FAAS renderer with the faas fabric mapping services. Also,
[groupbasedpolicy.git] / renderers / faas / src / main / yang / faas.yang
1 /*
2  * Copyright (c) 2014 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 faas {
10     yang-version 1;
11
12     namespace "urn:opendaylight:groupbasedpolicy:faas";
13     prefix "faas";
14
15     import gbp-common { prefix gbp-common; revision-date 2014-04-21; }
16     import faas-common { prefix faas-common; revision-date 2015-10-13; }
17     import endpoint { prefix endpoint; revision-date 2014-04-21; }
18     import resolved-policy { prefix resolved-policy; revision-date 2015-08-28; }
19
20     description
21         "This module defines the group-based policy faas renderer model.";
22
23     revision "2015-10-09" {
24         description
25                 "Initial revision.";
26     }
27
28     typedef scope-type {
29         type enumeration {
30             enum private {
31                 description "private scope within a tenant domain";
32             }
33             enum public {
34                 description "public scope that is exposed outside the tenant domain such as the Internet";
35             }
36         }
37     }
38     typedef service-communication-layer {
39         type enumeration {
40             enum layer-undefined {
41                 description "Undefined layer";
42             }
43             enum layer-2 {
44                 description "layer 2";
45             }
46             enum layer-3 {
47                 description "layer 3";
48             }
49         }
50     }
51     grouping has-contract-key {
52         leaf contract-tenant-id {
53             description "Related tenant id";
54             type gbp-common:tenant-id;
55         }
56
57         leaf contract-id {
58             description "Related contract id";
59             type gbp-common:contract-id;
60         }
61     }
62
63     grouping has-logical-entity {
64         leaf logical-router-id {
65             type faas-common:uuid;
66         }
67         leaf logical-switch-id {
68             type faas-common:uuid;
69         }
70         leaf-list gbp-subnet-id {
71             type gbp-common:subnet-id;
72         }
73     }
74
75     container logical-networks {
76         description "The mapped logical networks based on GBP resolved services";
77
78         config false;
79
80         list logical-network {
81             description "Mapped logical network for an EPG-Contract-EPG service";
82
83             key "consumer-epg-id contract-id provider-epg-id consumer-tenant-id provider-tenant-id";
84
85             uses resolved-policy:has-consumer-epg-key;
86             uses has-contract-key;
87             uses resolved-policy:has-provider-epg-key;
88             leaf communication-layer {
89                 description "logical network communication layer";
90                 type service-communication-layer;
91             }
92             container consumer-network {
93                 uses has-logical-entity;
94                 leaf network-scope-type {
95                     description "if public, it means the router has a public access port";
96                     default private;
97                     type scope-type;
98                 }
99             }
100             container provider-network {
101                 uses has-logical-entity;
102                 leaf network-scope-type {
103                     description "if public, it means the router has a public access port";
104                     default private;
105                     type scope-type;
106                 }
107             }
108         }
109     }
110
111     grouping tenant-pair-id {
112         leaf gbp-tenant-id {
113             type gbp-common:tenant-id;
114         }
115         leaf faas-tenant-id {
116             type faas-common:uuid;
117         }
118     }
119     container mapped-tenants-entities {
120
121         config false;
122
123         list mapped-tenant {
124             key "gbp-tenant-id";
125             uses tenant-pair-id;
126         }
127         list mapped-entity {
128             key "gbp-tenant-id";
129             leaf gbp-tenant-id {
130                 type gbp-common:tenant-id;
131             }
132             list mapped-contract {
133                 key "gbp-contract-id";
134                 leaf gbp-contract-id {
135                     type gbp-common:contract-id;
136                 }
137                 leaf faas-security-rules-id {
138                     type faas-common:uuid;
139                 }
140             }
141             list mapped-subnet {
142                 key "gbp-subnet-id";
143                 leaf gbp-subnet-id {
144                     type gbp-common:subnet-id;
145                 }
146                 leaf faas-subnet-id {
147                     type faas-common:uuid;
148                 }
149             }
150             list mapped-endpoint {
151                 key "l2-context mac-address";
152                 uses endpoint:l2-key;
153                 leaf endpoint-location {
154                     type faas-common:uuid;
155                 }
156             }
157         }
158     }
159 }