Merge "Tests for neutron-ovsdb"
[groupbasedpolicy.git] / groupbasedpolicy / src / main / yang / model / statistics-store.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-store {
10     yang-version 1;
11
12     namespace "urn:opendaylight:groupbasedpolicy:statistics:store";
13     prefix "gbp-statistics-store";
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     description
28         "This module defines gbp statistics store.";
29
30     revision "2015-12-15" {
31         description
32             "Initial revision.";
33     }
34
35     typedef record-id {
36         type int64;
37     }
38     grouping source-ep-fields {
39         container src-endpoint {
40             uses endpoint:l2-key;
41             leaf endpoint-group {
42                 type gbp-common:endpoint-group-id;
43             }
44             leaf tenant {
45                 type gbp-common:tenant-id;
46             }
47         }
48     }
49
50     grouping dst-ep-fields {
51         container dst-endpoint {
52             uses endpoint:l2-key;
53             leaf endpoint-group {
54                 type gbp-common:endpoint-group-id;
55             }
56             leaf tenant {
57                 type gbp-common:tenant-id;
58             }
59         }
60     }
61
62     grouping statisitc-fields {
63         leaf contract {
64             type gbp-common:contract-id;
65         }
66         leaf rule {
67             type gbp-common:rule-name;
68         }
69         leaf subject {
70             type gbp-common:subject-name;
71         }
72         leaf-list classifier {
73             type gbp-common:classifier-name;
74         }
75         leaf-list action {
76             type gbp-common:action-name;
77         }
78         leaf byte-count {
79             type int64;
80         }
81         leaf packet-count {
82             type int64;
83         }
84     }
85
86     container statistics-store {
87         list statistic-record {
88             key "record-id";
89             leaf record-id {
90                 type record-id;
91             }
92             leaf timestamp {
93                 type uint64;
94                 description
95                     "Date and time of record creation in milliseconds
96                         counting from 1.1.1970 00:00:00 UTC (= 0)";
97             }
98             uses source-ep-fields;
99             uses dst-ep-fields;
100             list statistic {
101                 key "contract subject rule";
102                 uses statisitc-fields;
103             }
104         }
105     }
106 }