Commit Graph

48 Commits

Author SHA1 Message Date
Bert Blommers
10bd677cf2
Admin - enable more Pylint rules (#5037) 2022-04-18 20:44:56 +00:00
Bert Blommers
29d01c35bc
Update Black + formatting (#4926) 2022-03-10 13:39:59 -01:00
Ranjithkumar Krishnan
4c309e7dd7
Fix exception type in cloudwatch get_metric_statistics (#4775) 2022-01-25 09:22:29 -01:00
Bert Blommers
aa70ee254d
Remove deprecated decorators + boto dependency (#4378) 2022-01-18 14:18:57 -01:00
Ranjithkumar Krishnan
3f79f7f6c7
Fix cloudwatch list metrics localstack #5000 (#4732) 2021-12-31 14:55:48 -01:00
Bert Blommers
52aeac1cee
Cloudwatch - Return build-in S3 metrics - take 2 (#3839) 2021-11-15 19:40:11 -01:00
Bert Blommers
14a69c7524
Techdebt: Enable pylint rules (#4432) 2021-10-18 19:44:29 +00:00
Bert Blommers
5f6ca27bb8
CloudWatch - Enable list_metrics() with Dimensions without value (#4400) 2021-10-12 22:04:06 +00:00
Bert Blommers
198f2696b9
Cloudwatch - Do not allow NaN values (#4399) 2021-10-12 19:32:34 +00:00
Bert Blommers
f7ce1c73fe
CloudWatch - duplicate deprecated tests (#3853) 2021-09-21 20:58:46 +00:00
Anton Grübel
4df099c724
Add cloudwatch tags (#4179)
* Update cloudwatch.put_metric_alarm to accept TreatMissingData and Tags parameter
* Add parameter ExtendedStatistic and EvaluateLowSampleCountPercentile to cloudwatch.put_metric_alarm
* Add parameter ThresholdMetricId to cloudwatch.put_metric_alarm
2021-08-16 08:52:19 +01:00
Waldemar Hummer
f4f8527955
Merge LocalStack changes into upstream moto (#4082)
* fix OPTIONS requests on non-existing API GW integrations

* add cloudformation models for API Gateway deployments

* bump version

* add backdoor to return CloudWatch metrics

* Updating implementation coverage

* Updating implementation coverage

* add cloudformation models for API Gateway deployments

* Updating implementation coverage

* Updating implementation coverage

* Implemented get-caller-identity returning real data depending on the access key used.

* bump version

* minor fixes

* fix Number data_type for SQS message attribute

* fix handling of encoding errors

* bump version

* make CF stack queryable before starting to initialize its resources

* bump version

* fix integration_method for API GW method integrations

* fix undefined status in CF FakeStack

* Fix apigateway issues with terraform v0.12.21
* resource_methods -> add handle for "DELETE" method
* integrations -> fix issue that "httpMethod" wasn't included in body request (this value was set as the value from refer method resource)

* bump version

* Fix setting http method for API gateway integrations (#6)

* bump version

* remove duplicate methods

* add storage class to S3 Key when completing multipart upload (#7)

* fix SQS performance issues; bump version

* add pagination to SecretsManager list-secrets (#9)

* fix default parameter groups in RDS

* fix adding S3 metadata headers with names containing dots (#13)

* Updating implementation coverage

* Updating implementation coverage

* add cloudformation models for API Gateway deployments

* Updating implementation coverage

* Updating implementation coverage

* Implemented get-caller-identity returning real data depending on the access key used.

* make CF stack queryable before starting to initialize its resources

* bump version

* remove duplicate methods

* fix adding S3 metadata headers with names containing dots (#13)

* Update amis.json to support EKS AMI mocks (#15)

* fix PascalCase for boolean value in ListMultipartUploads response (#17); fix _get_multi_param to parse nested list/dict query params

* determine non-zero container exit code in Batch API

* support filtering by dimensions in CW get_metric_statistics

* fix storing attributes for ELBv2 Route entities; API GW refactorings for TF tests

* add missing fields for API GW resources

* fix error messages for Route53 (TF-compat)

* various fixes for IAM resources (tf-compat)

* minor fixes for API GW models (tf-compat)

* minor fixes for API GW responses (tf-compat)

* add s3 exception for bucket notification filter rule validation

* change the way RESTErrors generate the response body and content-type header

* fix lint errors and disable "black" syntax enforcement

* remove return type hint in RESTError.get_body

* add RESTError XML template for IAM exceptions

* add support for API GW minimumCompressionSize

* fix casing getting PrivateDnsEnabled API GW attribute

* minor fixes for error responses

* fix escaping special chars for IAM role descriptions (tf-compat)

* minor fixes and tagging support for API GW and ELB v2 (tf-compat)

* Merge branch 'master' into localstack

* add "AlarmRule" attribute to enable support for composite CloudWatch metrics

* fix recursive parsing of complex/nested query params

* bump version

* add API to delete S3 website configurations (#18)

* use dict copy to allow parallelism and avoid concurrent modification exceptions in S3

* fix precondition check for etags in S3 (#19)

* minor fix for user filtering in Cognito

* fix API Gateway error response; avoid returning empty response templates (tf-compat)

* support tags and tracingEnabled attribute for API GW stages

* fix boolean value in S3 encryption response (#20)

* fix connection arn structure

* fix api destination arn structure

* black format

* release 2.0.3.37

* fix s3 exception tests

see botocore/parsers.py:1002 where RequestId is removed from parsed

* remove python 2 from build action

* add test failure annotations in build action

* fix events test arn comparisons

* fix s3 encryption response test

* return default value "0" if EC2 availableIpAddressCount is empty

* fix extracting SecurityGroupIds for EC2 VPC endpoints

* support deleting/updating API Gateway DomainNames

* fix(events): Return empty string instead of null when no pattern is specified in EventPattern (tf-compat) (#22)

* fix logic and revert CF changes to get tests running again (#21)

* add support for EC2 customer gateway API (#25)

* add support for EC2 Transit Gateway APIs (#24)

* feat(logs): add `kmsKeyId` into `LogGroup` entity (#23)

* minor change in ELBv2 logic to fix tests

* feat(events): add APIs to describe and delete CloudWatch Events connections (#26)

* add support for EC2 transit gateway route tables (#27)

* pass transit gateway route table ID in Describe API, minor refactoring (#29)

* add support for EC2 Transit Gateway Routes (#28)

* fix region on ACM certificate import (#31)

* add support for EC2 transit gateway attachments (#30)

* add support for EC2 Transit Gateway VPN attachments (#32)

* fix account ID for logs API

* add support for DeleteOrganization API

* feat(events): store raw filter representation for CloudWatch events patterns (tf-compat) (#36)

* feat(events): add support to describe/update/delete CloudWatch API destinations (#35)

* add Cognito UpdateIdentityPool, CW Logs PutResourcePolicy

* feat(events): add support for tags in EventBus API (#38)

* fix parameter validation for Batch compute environments (tf-compat)

* revert merge conflicts in IMPLEMENTATION_COVERAGE.md

* format code using black

* restore original README; re-enable and fix CloudFormation tests

* restore tests and old logic for CF stack parameters from SSM

* parameterize RequestId/RequestID in response messages and revert related test changes

* undo LocalStack-specific adaptations

* minor fix

* Update CodeCov config to reflect removal of Py2

* undo change related to CW metric filtering; add additional test for CW metric statistics with dimensions

* Terraform - Extend whitelist of running tests

Co-authored-by: acsbendi <acsbendi28@gmail.com>
Co-authored-by: Phan Duong <duongpv@outlook.com>
Co-authored-by: Thomas Rausch <thomas@thrau.at>
Co-authored-by: Macwan Nevil <macnev2013@gmail.com>
Co-authored-by: Dominik Schubert <dominik.schubert91@gmail.com>
Co-authored-by: Gonzalo Saad <saad.gonzalo.ale@gmail.com>
Co-authored-by: Mohit Alonja <monty16597@users.noreply.github.com>
Co-authored-by: Miguel Gagliardo <migag9@gmail.com>
Co-authored-by: Bert Blommers <info@bertblommers.nl>
2021-07-26 15:21:17 +01:00
usmangani1
03b2009a1c
Add unit support to cloudwatch get_metric_statistics (#3932)
* Add unit support to cloudwatch get_metric_statistics

* fix linting
2021-05-15 08:05:41 +01:00
Bert Blommers
737636f9df
Tech debt (#3653) 2021-02-02 16:31:26 +00:00
Rahul Ranjan
78a5661093
Cloudwatch get metric data return by period (#3626)
* Cloudwatch get metric data return by period

- addresses https://github.com/localstack/localstack/issues/3493

* fix lint issues

* remove unused import

* added test cases for min max and average
2021-02-02 09:08:53 +00:00
usmangani1
54e296eb53
Fix:CloudWatch List metrics with dimensions (#3461)
* Fix:CloudWatch List metrics with dimensions

* Fix:CloudWatch List metrics with dimensions

* Fixed new cases and added more tests

Co-authored-by: usmankb <usman@krazybee.com>
2020-11-20 12:38:48 +00:00
Matěj Cepl
ea489bce6c Finish porting from nose to pytest. 2020-11-10 08:25:05 +01:00
Matěj Cepl
77dc60ea97 Port test suite from nose to pytest.
This just eliminates all errors on the tests collection. Elimination of
failures is left to the next commit.
2020-11-10 08:23:44 +01:00
usmangani1
9970be2309
Fix: Adding alarm arn to describe alarms response (#3409)
* Fix: adding alarm arn to describe alarms response

* Fix:Delete subscriptions on delete topic

* modified tests

Co-authored-by: usmankb <usman@krazybee.com>
2020-11-02 08:56:18 +00:00
Eoin Shanaghy
a3880c4c35
Metric data query alarms (#3419)
* Add support for metric data query alarms (Metrics=[..])

* Fix trailing whitespace

* Allow for unordered metrics in Python 2.7

* Add describe_alarm assertions and support DatapointsToAlarm
2020-10-31 15:56:24 +00:00
usmangani1
09b764148c
Fix : Added implementation for CloudWatch Describe Metric for Alarm (#3148)
* Fix : added implementation for CloudWatch Describe Metric for Alarm

* Linting

Co-authored-by: Bert Blommers <info@bertblommers.nl>
2020-07-18 10:47:53 +01:00
usmangani1
7a6d78afde
Fix: Cloudwatch delete Alarm status code handling on invalid alarm name (#3028)
* CloudWwatch delete Alarm status code handling on invalid alarm Name

* Handled cases where a mix of existent and non existent alarms are tried to delete

* Linting

Co-authored-by: usmankb <usman@krazybee.com>
Co-authored-by: Bert Blommers <info@bertblommers.nl>
2020-05-28 15:52:56 +01:00
Mike Grima
dd22e7855a Fixed a regression with CloudWatch 2020-04-27 12:56:17 -07:00
Steve Pulec
b4a11cd19f
Merge pull request #2848 from bblommers/feature/2239
CloudWatch - Initial get-metric-data implementation
2020-04-25 18:39:21 -05:00
Bert Blommers
fb0de99e81 #2239 - Initial implementation of CW.get_metric_data 2020-03-28 13:41:17 +00:00
Bert Blommers
c3865532f9 #2711 - Register default S3 metrics in CloudWatch 2020-03-23 15:53:39 +00:00
Tim Gatzemeier
6e490a9190 make linter happy 2020-03-16 21:58:50 +01:00
Tim Gatzemeier
50974aa9b2 add test cases to ensure actions enabled is correctly returned 2020-03-16 21:45:29 +01:00
Tim Gatzemeier
9d3ee116d3 add test case for actions_enabled field 2020-03-16 20:14:41 +01:00
Bert Blommers
0e43369155 Linting 2020-03-11 12:47:40 +00:00
Huang syunwei
ab68d14649 Fix bug of put metric data with timestamp, timestamp should be a date time object instead of a string 2020-03-11 12:47:09 +00:00
Stephan Huber
0527e88d46 Merge remote-tracking branch 'upstream/master' 2019-12-23 08:38:53 +01:00
Bert Blommers
36a5d80443 #2010 - Implement Cloudwwatch list_metrics pagination 2019-11-25 16:59:39 +00:00
Asher Foa
96e5b1993d Run black on moto & test directories. 2019-10-31 10:36:05 -07:00
Stephan
e51d1bfade merge 2018-12-21 12:28:56 +01:00
Steve Pulec
69587c151c
Merge branch 'master' into bugfix/1615-cloudwatch-statistics 2018-05-29 22:19:25 -04:00
bclodius
1a0a951b06 Fixes #1608 2018-05-05 15:22:29 -04:00
Barry O'Neill
9e7b86faef Issue 1615 - missing Value should not kill put_metric_data 2018-05-03 19:47:36 -04:00
Pieter Jordaan
a8cd5fb7fd Change name of 'state' attribute of 'FakeAlarm' CloudWatch model to 'state_value'. This ensures that the 'StateValue' returned by 'describe_alarms' is correct.
The 'DESCRIBE_ALARMS_TEMPLATE' response template references a 'state_value' attribute on the 'FakeAlarm' model which does not exist; it is named 'state'.
This commit updates the attribute to be called 'state_value', in-line with the naming convention used elsewhere.
2018-01-08 13:18:50 +01:00
Alexander Mohr
81f3cbb548 fix cloudwatch bug (#1374)
* bugfix + add tests
2017-12-05 09:25:08 +00:00
Terry Cain
6adfb97753
Added SetAlarmState and added state filter to describe 2017-10-27 18:58:11 +01:00
Terry Cain
c965fdd47f Added dashboard methods + tests 2017-09-22 16:38:20 +01:00
Steve Pulec
f37bad0e00 Lints. 2017-02-23 21:37:43 -05:00
Steve Pulec
fde721bed7 Testing new version of decorator. 2017-02-15 22:35:45 -05:00
Ilya Sukhanov
a37838b638 Preserve Namespace and MetricName when creating cloudwatch alarm. 2016-08-01 17:31:08 -04:00
Ilya Sukhanov
9bf5c2e706 CloudWatch DescribeAlarm filters.
Adds support for filtering by:
action_prefix
alarm_name_prefix
alarm_names

And throw NotImplementedError when filtering by:
state_value
2015-07-22 21:08:39 -04:00
Philippe Gauthier
d5d9c13975 Add put_metric_data and list_metrics 2015-05-29 17:34:36 -04:00
Steve Pulec
93f56322d8 Fix merge conflicts for cloudwatch. 2014-10-30 23:51:09 -04:00