Merge "Enumerate the meter type in the API Meter class"

This commit is contained in:
Jenkins 2013-05-02 13:26:20 +00:00 committed by Gerrit Code Review
commit cb7362ed04
2 changed files with 5 additions and 4 deletions

View File

@ -40,9 +40,9 @@ from wsme import types as wtypes
from ceilometer.openstack.common import log
from ceilometer.openstack.common import timeutils
from ceilometer import counter
from ceilometer import storage
LOG = log.getLogger(__name__)
@ -421,8 +421,9 @@ class Meter(_Base):
name = wtypes.text
"The unique name for the meter"
# FIXME(dhellmann): Make this an enum?
type = wtypes.text
type = wtypes.Enum(str, counter.TYPE_GAUGE,
counter.TYPE_CUMULATIVE,
counter.TYPE_DELTA)
"The meter type (see :ref:`measurements`)"
unit = wtypes.text

View File

@ -97,7 +97,7 @@ class TestPipeline(base.TestCase):
self.test_counter = counter.Counter(
name='a',
type='test_type',
type=counter.TYPE_GAUGE,
volume=1,
unit='B',
user_id="test_user",