BUG-6650: ep-ip/sgt, update/rename models and yangs for sxp-ise-adapter
[groupbasedpolicy.git] / sxp-mapper / src / main / yang / sxp-mapper-model.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 sxp-mapper-model {
10     yang-version 1;
11     namespace "urn:opendaylight:params:xml:ns:yang:controller:config:groupbasedpolicy:sxp-mapper:model";
12     prefix "sxpm-model";
13
14     import sxp-database { prefix sxp-database; revision-date 2016-03-08; }
15     import gbp-common { prefix gbp-common; revision-date 2014-04-21; }
16     import ietf-inet-types { prefix inet; revision-date 2013-07-15; }
17     import forwarding { prefix forwarding; revision-date 2016-04-27; }
18     import base-endpoint { prefix base-edpoint; revision-date 2016-04-27; }
19     import yang-ext { prefix ext; revision-date 2013-07-09; }
20     import renderer { prefix renderer; revision-date 2015-11-03; }
21
22     description
23         "This module contains the YANG definitions for
24           sxf-mapper implementation.";
25
26     revision "2016-03-02" {
27         description
28             "Initial revision.";
29     }
30
31     container sxp-mapper {
32         description "root point for endpoint templates";
33
34         list endpoint-policy-template-by-sgt {
35             key sgt;
36             leaf sgt {
37                 type sxp-database:sgt;
38                 description
39                     "SGT for which this endpoint template is used";
40             }
41             leaf tenant {
42                type gbp-common:tenant-id;
43                mandatory true;
44                description
45                     "The tenant of this endpoint";
46             }
47             leaf-list endpoint-groups {
48                type gbp-common:endpoint-group-id;
49                min-elements 1;
50                description
51                     "The groups associated with this endpoint";
52             }
53             leaf-list conditions {
54                type gbp-common:condition-name;
55                description
56                     "The conditions associated with this endpoint";
57             }
58         }
59
60         list endpoint-forwarding-template-by-subnet {
61             description "If the IP from IP/SGT binding is inside of ip-prefix then
62                 the endpoint will be in the l3-context.";
63             key ip-prefix;
64             leaf ip-prefix {
65                 type inet:ip-prefix;
66                 description
67                     "The IP prefix where an endpoint can be connected.";
68             }
69             leaf l3-context {
70                type gbp-common:context-id;
71                mandatory true;
72                description
73                     "The context for the endpoint's layer 3 address";
74             }
75             container network-containment {
76                 description
77                             "The network domain associated with this endpoint's fowarding
78                             context.";
79                 uses forwarding:network-domain-key;
80             }
81         }
82     }
83
84     grouping sxp-sgt {
85         description "SGT leaf dedicated for endpoint-rpc, endpoint container and renderer configuration
86             (attach by augmentation)";
87         leaf sgt {
88             type sxp-database:sgt;
89         }
90     }
91
92     augment "renderer:renderers/renderer:renderer/renderer:renderer-policy/renderer:configuration/renderer:endpoints/renderer:address-endpoint-with-location" {
93         ext:augment-identifier "address-endpoint-with-location-aug";
94         uses sxp-sgt;
95     }
96 }