81f2f45346113fa70182e528a9eaf227411c3922
[groupbasedpolicy.git] / renderers / vpp / src / main / yang / vpp-renderer.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 vpp-renderer {
10     yang-version 1;
11
12     namespace "urn:opendaylight:groupbasedpolicy:vpp_renderer";
13     prefix "vpp-renderer";
14
15     import base-endpoint { prefix base-ep; revision-date 2016-04-27; }
16     import network-topology { prefix nt; revision-date 2013-10-21; }
17     import opendaylight-l2-types { prefix l2-types; revision-date "2013-08-27"; }
18
19     description
20         "This module is a baseline for the group-based policy vpp renderer model.";
21
22     revision "2016-04-25" {
23         description
24             "Initial revision.";
25     }
26
27     identity network-type-base {
28         description "Base for Network Types.";
29     }
30
31     identity flat-network {
32         description "Flat Provider Network Type";
33         base network-type-base;
34     }
35
36     identity vlan-network {
37         description "VLAN Provider Network Type";
38         base network-type-base;
39     }
40
41     typedef network-type {
42         description "Type of Network.";
43         type identityref {
44             base network-type-base;
45         }
46     }
47
48     container config {
49         list vpp-endpoint {
50             description "Renderer creates/removes interface on VPP node based on given parameters.";
51
52             key "context-type context-id address-type address";
53             uses base-ep:address-endpoint-key;
54
55             leaf vpp-node-path {
56                 description "Path to a node representing mount-point to VPP instance.";
57                 type instance-identifier;
58             }
59             leaf vpp-interface-name {
60                 description "Name of interface for the endpoint on VPP";
61                 type string;
62             }
63             leaf description {
64                 description "Additional description of the vpp-endpoint";
65                 type string;
66             }
67             choice interface-type-choice {
68                 case vhost-user-case {
69                     leaf socket {
70                         description "A unique ID for the neutron port";
71                         type string {
72                             length 1..255;
73                         }
74                     }
75                 }
76             }
77         }
78
79         list bridge-domain {
80             key "id";
81             leaf id {
82                 description "Same as in VBD.";
83                 type string;
84             }
85             leaf description {
86                type string;
87             }
88             leaf type {
89                 mandatory true;
90                 type network-type;
91             }
92             leaf vlan {
93                 when "type = 'vlan-network'";
94                 type l2-types:vlan-id;
95             }
96             list physical-location-ref {
97                 description
98                     "Refers to physical interfaces on vpp nodes through which external
99                      nodes belonging to the same bridge-domain can be reached.";
100                 key "node-id";
101                 leaf node-id {
102                     description "Refers to a VPP node.";
103                     type nt:node-id;
104                 }
105                 leaf-list interface {
106                     description "Physical interface on the VPP node.";
107                     type string;
108                 }
109             }
110         }
111     }
112 }