Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws cloudwatch put-metric-data no longer working with statistic sets #1036

Closed
ajkerr opened this issue Dec 1, 2014 · 1 comment · Fixed by #1039
Closed

aws cloudwatch put-metric-data no longer working with statistic sets #1036

ajkerr opened this issue Dec 1, 2014 · 1 comment · Fixed by #1039
Assignees
Labels
bug This issue is a bug.

Comments

@ajkerr
Copy link

ajkerr commented Dec 1, 2014

One of our automated scripts stopped reporting data a few weeks ago - we've traced this to a newer version of the AWS CLI.

In fact, the documented example for how to publish statistic sets (http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/publishingMetrics.html#publishingDataPoints1) fails with the same error that we are getting.

$ aws cloudwatch put-metric-data --metric-name PageViewCount --namespace "MyService" --statistic-value Sum=11,Minimum=2,Maximum=5,SampleCount=3 --timestamp 2014-02-14T12:00:00.000Z

Parameter validation failed:
Invalid type for parameter MetricData[0].StatisticValues.SampleCount, value: 3, type: <type 'unicode'>, valid types: <type 'float'>, <class 'decimal.Decimal'>, <type 'int'>, <type 'long'>
Invalid type for parameter MetricData[0].StatisticValues.Sum, value: 11, type: <type 'unicode'>, valid types: <type 'float'>, <class 'decimal.Decimal'>, <type 'int'>, <type 'long'>
Invalid type for parameter MetricData[0].StatisticValues.Minimum, value: 2, type: <type 'unicode'>, valid types: <type 'float'>, <class 'decimal.Decimal'>, <type 'int'>, <type 'long'>
Invalid type for parameter MetricData[0].StatisticValues.Maximum, value: 5, type: <type 'unicode'>, valid types: <type 'float'>, <class 'decimal.Decimal'>, <type 'int'>, <type 'long'>
@jamesls jamesls added bug This issue is a bug. confirmed labels Dec 2, 2014
@jamesls jamesls self-assigned this Dec 2, 2014
@jamesls
Copy link
Member

jamesls commented Dec 2, 2014

Working on a fix.

jamesls added a commit to jamesls/aws-cli that referenced this issue Dec 2, 2014
This was failing the improved botocore param validation because
we were previously setting this value to a string.  We now set
this value to a decimal.Decimal to ensure we have a valid type
that will also pass the botocore param validation.

While I was in the code, I also updated the code to use the new
botocore CamelCasing from metric_data to MetricData.  There was
also some general test cleanup to switch the tests to
assert_params_for_cmd2.

Fixes aws#1036.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants