Merge "VLAN support for external networks"
[groupbasedpolicy.git] / groupbasedpolicy / src / main / yang / model / statistics.yang
1 /*
2  * Copyright (c) 2015 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 statistics {
10     yang-version 1;
11
12     namespace "urn:opendaylight:groupbasedpolicy:statistics";
13     prefix "gbp-statistics";
14
15     import endpoint {
16         prefix endpoint;
17         revision-date 2014-04-21;
18     }
19     import gbp-common {
20         prefix gbp-common;
21         revision-date 2014-04-21;
22         }
23     import ietf-inet-types {
24         prefix inet;
25         revision-date 2010-09-24;
26     }
27     import ietf-yang-types {
28         prefix yang;
29         revision-date 2010-09-24;
30     }
31
32     description
33         "This module defines gbp statistics model.";
34
35     revision "2015-12-15" {
36         description
37             "Initial revision.";
38     }
39
40     grouping statistic-records {
41         container stat-records {
42             //////////////////////
43             //  EP combination  //
44             //specific statistic//
45             //////////////////////
46             list ep-to-ep-statistic {
47                 key "src-mac-address src-l2c dst-mac-address dst-l2c";
48                 /////////////
49                 //Source EP//
50                 /////////////
51                 leaf src-mac-address {
52                     type yang:mac-address;
53                 }
54                 leaf src-l2c {
55                     type gbp-common:l2-bridge-domain-id;
56                 }
57                 leaf src-tenant {
58                     type gbp-common:tenant-id;
59                 }
60                 leaf timestamp {
61                     type int64;
62                     description
63                         "Date and time of record creation in milliseconds
64                         counting from 1.1.1970 00:00:00 UTC (= 0)";
65                 }
66                 //////////////////
67                 //Destination EP//
68                 //////////////////
69                 leaf dst-mac-address {
70                     type yang:mac-address;
71                 }
72                 leaf dst-l2c {
73                     type gbp-common:l2-bridge-domain-id;
74                 }
75                 leaf dst-tenant {
76                     type gbp-common:tenant-id;
77                 }
78                 //////////////////////
79                 //  EPG combination //
80                 //specific statistic//
81                 //////////////////////
82                 list ep-epg-to-ep-epg-statistic {
83                     key "src-epg dst-epg";
84                     leaf src-epg {
85                         type gbp-common:endpoint-group-id;
86                     }
87                     leaf dst-epg {
88                         type gbp-common:endpoint-group-id;
89                     }
90                     list matched-rule-statistic {
91                         key "contract subject matched-rule";
92                         leaf contract {
93                             type gbp-common:contract-id;
94                         }
95                         leaf subject {
96                             type gbp-common:subject-name;
97                         }
98                         leaf matched-rule {
99                             type gbp-common:rule-name;
100                         }
101                         leaf-list classifier {
102                             type gbp-common:classifier-name;
103                         }
104                         leaf-list action {
105                             type gbp-common:action-name;
106                         }
107                         leaf byte-count {
108                             type int64;
109                         }
110                         leaf packet-count {
111                             type int64;
112                         }
113                     }
114                 }
115             }
116         }
117     }
118 }