BUG-6650: ep-ip/sgt, prepare removal of deprecated sxp-mapper
[groupbasedpolicy.git] / sxp-integration / sxp-ep-provider / src / main / yang / sxp-ep-provider-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-ep-provider-model {
10     yang-version 1;
11     namespace "urn:opendaylight:params:xml:ns:yang:controller:config:groupbasedpolicy:sxp-integration:sxp-ep-provider:model";
12     prefix "sxp-ep-prvd-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           sxp-ep-provider implementation.";
25
26     revision "2016-03-02" {
27         description
28             "Initial revision.";
29     }
30
31     identity template-origin {
32         description "identifies the way of creation of given template";
33     }
34
35     identity template-generated {
36         description "template was generated";
37         base template-origin;
38     }
39
40
41     container sxp-ep-mapper {
42         description "root point for endpoint templates";
43
44         list endpoint-policy-template-by-sgt {
45             key sgt;
46             leaf sgt {
47                 type sxp-database:sgt;
48                 description
49                     "SGT for which this endpoint template is used";
50             }
51             leaf tenant {
52                type gbp-common:tenant-id;
53                mandatory true;
54                description
55                     "The tenant of this endpoint";
56             }
57             leaf-list endpoint-groups {
58                type gbp-common:endpoint-group-id;
59                min-elements 1;
60                description
61                     "The groups associated with this endpoint";
62             }
63             leaf-list conditions {
64                type gbp-common:condition-name;
65                description
66                     "The conditions associated with this endpoint";
67             }
68             leaf origin {
69                 description "template origin flag";
70                 type identityref {
71                     base template-origin;
72                 }
73             }
74         }
75
76         list endpoint-forwarding-template-by-subnet {
77             description "If the IP from IP/SGT binding is inside of ip-prefix then
78                 the endpoint will be in the l3-context.";
79             key ip-prefix;
80             leaf ip-prefix {
81                 type inet:ip-prefix;
82                 description
83                     "The IP prefix where an endpoint can be connected.";
84             }
85             leaf l3-context {
86                type gbp-common:context-id;
87                mandatory true;
88                description
89                     "The context for the endpoint's layer 3 address";
90             }
91             container network-containment {
92                 description
93                             "The network domain associated with this endpoint's fowarding
94                             context.";
95                 uses forwarding:network-domain-key;
96             }
97         }
98     }
99
100     grouping sxp-sgt {
101         description "SGT leaf dedicated for endpoint-rpc, endpoint container and renderer configuration
102             (attach by augmentation)";
103         leaf sgt {
104             type sxp-database:sgt;
105         }
106     }
107
108     augment "renderer:renderers/renderer:renderer/renderer:renderer-policy/renderer:configuration/renderer:endpoints/renderer:address-endpoint-with-location" {
109         ext:augment-identifier "address-endpoint-with-location-aug";
110         uses sxp-sgt;
111     }
112 }