Update help message for alarm-gnocchi-resources-threshold-create
Help message for '--aggregation-method' in alarm-gnocchi-resources-threshold-create command is not precise. The problem is that 'avg' is not a valid aggregation method in gnocchi. This fix updates the help message. Change-Id: I513b6fb9db9f96bfdd10391b6acd5c95e278f601 Closes-Bug: #1506549
This commit is contained in:
@@ -25,6 +25,7 @@ import json
|
|||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
from oslo_utils import strutils
|
from oslo_utils import strutils
|
||||||
import six
|
import six
|
||||||
|
from six import moves
|
||||||
|
|
||||||
from ceilometerclient.common import utils
|
from ceilometerclient.common import utils
|
||||||
from ceilometerclient import exc
|
from ceilometerclient import exc
|
||||||
@@ -36,6 +37,11 @@ ALARM_SEVERITY = ['low', 'moderate', 'critical']
|
|||||||
ALARM_OPERATORS = ['lt', 'le', 'eq', 'ne', 'ge', 'gt']
|
ALARM_OPERATORS = ['lt', 'le', 'eq', 'ne', 'ge', 'gt']
|
||||||
ALARM_COMBINATION_OPERATORS = ['and', 'or']
|
ALARM_COMBINATION_OPERATORS = ['and', 'or']
|
||||||
STATISTICS = ['max', 'min', 'avg', 'sum', 'count']
|
STATISTICS = ['max', 'min', 'avg', 'sum', 'count']
|
||||||
|
GNOCCHI_AGGREGATION = ['last', 'min', 'median', 'sum',
|
||||||
|
'std', 'first', 'mean', 'count',
|
||||||
|
'moving-average', 'max']
|
||||||
|
GNOCCHI_AGGREGATION.extend(['%spct' % num for num in moves.xrange(1, 100)])
|
||||||
|
|
||||||
AGGREGATES = {'avg': 'Avg',
|
AGGREGATES = {'avg': 'Avg',
|
||||||
'count': 'Count',
|
'count': 'Count',
|
||||||
'max': 'Max',
|
'max': 'Max',
|
||||||
@@ -509,7 +515,7 @@ def common_alarm_gnocchi_arguments(rule_namespace, create=False):
|
|||||||
@utils.arg('--aggregation-method', metavar='<AGGREATION>',
|
@utils.arg('--aggregation-method', metavar='<AGGREATION>',
|
||||||
dest=rule_namespace + '/aggregation_method',
|
dest=rule_namespace + '/aggregation_method',
|
||||||
help=('Aggregation method to use, one of: ' +
|
help=('Aggregation method to use, one of: ' +
|
||||||
str(STATISTICS) + '.'))
|
str(GNOCCHI_AGGREGATION) + '.'))
|
||||||
@utils.arg('--comparison-operator', metavar='<OPERATOR>',
|
@utils.arg('--comparison-operator', metavar='<OPERATOR>',
|
||||||
dest=rule_namespace + '/comparison_operator',
|
dest=rule_namespace + '/comparison_operator',
|
||||||
help=('Operator to compare with, one of: ' +
|
help=('Operator to compare with, one of: ' +
|
||||||
|
|||||||
Reference in New Issue
Block a user