srikanth | 116e6e8 | 2014-08-19 07:22:37 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (c) 2013 Big Switch Networks, Inc. |
| 3 | # |
| 4 | # Licensed under the Eclipse Public License, Version 1.0 (the |
| 5 | # "License"); you may not use this file except in compliance with the |
| 6 | # License. You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.eclipse.org/legal/epl-v10.html |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| 13 | # implied. See the License for the specific language governing |
| 14 | # permissions and limitations under the License. |
| 15 | # |
| 16 | |
| 17 | from django.db import models |
Srikanth Vavilapalli | 669ba8a | 2014-10-16 11:41:19 -0700 | [diff] [blame] | 18 | """ |
srikanth | 116e6e8 | 2014-08-19 07:22:37 -0700 | [diff] [blame] | 19 | class StatdConfig(models.Model): |
| 20 | stat_type = models.CharField( |
| 21 | primary_key=True, |
| 22 | verbose_name='Stat Type', |
| 23 | max_length=64) |
| 24 | |
| 25 | sampling_period = models.PositiveIntegerField( |
| 26 | verbose_name='Sampling Period', |
| 27 | default=15) |
| 28 | |
| 29 | reporting_period = models.PositiveIntegerField( |
| 30 | verbose_name='Reporting Period', |
| 31 | default=60) |
| 32 | |
| 33 | class Rest: |
| 34 | NAME = 'statd-config' |
| 35 | FIELD_INFO = ( |
| 36 | {'name': 'stat_type', 'rest_name': 'stat-type'}, |
| 37 | {'name': 'sampling_period', 'rest_name': 'sampling-period'}, |
| 38 | {'name': 'reporting_period', 'rest_name': 'reporting-period'}, |
| 39 | ) |
Srikanth Vavilapalli | 669ba8a | 2014-10-16 11:41:19 -0700 | [diff] [blame] | 40 | """ |