Introduced DomainSpecificRegistry service
[groupbasedpolicy.git] / groupbasedpolicy / src / main / yang / model / l2-l3-forwarding.yang
1 /*
2  * Copyright (c) 2016 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 l2-l3-forwarding {
10     yang-version 1;
11
12     namespace "urn:opendaylight:groupbasedpolicy:forwarding:l2_l3";
13     prefix "l2-l3-forwarding";
14
15     import forwarding { prefix forwarding; revision-date 2016-04-27; }
16     import renderer { prefix renderer; revision-date 2015-11-03; }
17     import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
18     import yang-ext {prefix ext; revision-date 2013-07-09;}
19
20     revision "2016-04-27" {
21         description
22                 "Initial revision.";
23     }
24
25     identity l3-context {
26         base forwarding:context-type;
27     }
28
29     identity l2-bridge-domain {
30         base forwarding:context-type;
31     }
32
33     identity l2-flood-domain {
34         base forwarding:context-type;
35     }
36
37     identity subnet {
38         base forwarding:network-domain;
39     }
40
41     identity mac-address-type {
42         description "Values by MAC address type MUST be compatible with type ietf-yang-types:mac-address.
43             This address type can be used only if forwarding:context-type is l2-bridge-domain.";
44         base forwarding:address-type;
45     }
46
47     identity ip-prefix-type {
48         description "Values by IP prefix type MUST be compatible with type ietf-inet-types:ip-prefix.
49             This address type can be used only if forwarding:context-type is l3-context.";
50         base forwarding:address-type;
51     }
52
53     grouping has-subnet {
54         container subnet {
55             when "../forwarding:network-domain-type = 'l2-l3-forwarding:subnet'";
56             leaf ip-prefix {
57                 description "The IP prefix that defines the subnet";
58                 type inet:ip-prefix;
59             }
60             leaf virtual-router-ip {
61                 description
62                     "IP address to use for a virtual gateway router
63                      for the subnet, if desired.";
64                 type inet:ip-address;
65             }
66             list gateways {
67                 description
68                     "External gateways for subnets we serve,
69                     includes prefixes for static routing";
70                 key "gateway";
71                 leaf gateway {
72                     type inet:ip-address;
73                 }
74                 list prefixes {
75                     key "prefix";
76                     leaf prefix {
77                         type inet:ip-prefix;
78                     }
79                 }
80             }
81         }
82     }
83
84     augment "/forwarding:forwarding/forwarding:forwarding-by-tenant/forwarding:network-domain" {
85         ext:augment-identifier "subnet-augment-forwarding";
86         uses has-subnet;
87     }
88
89     augment "/renderer:renderers/renderer:renderer/renderer:renderer-policy/renderer:configuration/renderer:renderer-forwarding/renderer:renderer-forwarding-by-tenant/renderer:renderer-network-domain" {
90         ext:augment-identifier "subnet-augment-renderer";
91         uses has-subnet;
92     }
93
94 }