tapaas: tapaas support
[neutron.git] / model / src / main / yang / neutron-tapaas.yang
1 /*
2  * Copyright (c) 2017 Intel Corporation.  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 neutron-tapaas {
10     yang-version 1;
11     namespace "urn:opendaylight:neutron-tapaas";
12     prefix neutron-tapaas;
13
14     import ietf-yang-types { prefix "yang"; }
15     import neutron-attrs    { prefix "attrs"; }
16
17     organization "OpenDaylight Neutron Northbound Project";
18
19     contact "Neutron Northbound <neutron-dev@lists.opendaylight.org>";
20
21     description " This YANG module defines Openstack Neutron Tap-as-a-Service(Taas) Model.
22                   The model is based on the REST APIs exposed by the trunk service of Neutron version 2.
23                   description of the REST API is located in inside the specification for tap-as-a-service
24                   (https://github.com/openstack/tap-as-a-service/blob/master/specs/mitaka/tap-as-a-service.rst)";
25
26     revision "2017-10-24" {
27         description
28             "OpenStack Neutron Tap as a service - Version 1.";
29     }
30
31     identity direction-base {
32         description "Base for defining direction of traffic";
33     }
34
35     identity direction-in {
36         description "Traffic arriving at Source Port";
37         base direction-base;
38     }
39
40     identity direction-out {
41         description "Traffic leaving Source Port";
42         base direction-base;
43     }
44
45     identity direction-both {
46         description "Both Directions are mirrored";
47         base direction-base;
48     }
49
50     grouping tap-flow-attributes {
51         description "Grouping for Tap Flow";
52         leaf tap-service-id {
53             type yang:uuid;
54             description "UUID of the Tap Service Instance";
55         }
56         leaf source-port {
57             type yang:uuid;
58             description "Source port of traffic ";
59         }
60         leaf direction {
61             type identityref {
62                 base "direction-base";
63             }
64             description "Direction of traffic";
65         }
66     }
67
68     grouping tap-service-attributes {
69         description "Grouping for Tap Service";
70         leaf port-id {
71             type yang:uuid;
72             description "Destination port for traffic";
73         }
74         container tap-flows {
75             list tap-flow {
76                 key uuid;
77                 uses attrs:base-attributes;
78                 uses tap-flow-attributes;
79                 description "Tap Flow container";
80             }
81         }
82     }
83
84     grouping tap-services-attributes {
85         container tap-services {
86             list tap-service {
87                 key uuid;
88                 uses attrs:base-attributes;
89                 uses tap-service-attributes;
90                 description "Tap Services Container which includes Tap Flow";
91             }
92         }
93         container tap-services-status {
94             config false;
95             list tap-service-status {
96                 key "tap-service";
97                 leaf tap-service {
98                     type yang:uuid;
99                     description "UUID of the Tap Service Instance";
100                 }
101                 leaf status {
102                     type string;
103                     description "Operational parameter to track status";
104                 }
105             }
106         }
107     }
108 }