Commit Graph

38 Commits

Author SHA1 Message Date
Bert Blommers
14a69c7524
Techdebt: Enable pylint rules (#4432) 2021-10-18 19:44:29 +00:00
nom3ad
0953c11b92
feat(cloudformation): support logs resource policy (#4427) 2021-10-18 09:17:31 +00:00
Bert Blommers
c642e8b4a7
Feature: Kinesis - list_shards() (#3752) 2021-10-09 20:18:13 +00:00
Matt Ossman
9859d66ff8
add metric filter support to cloudwatch logs (updated) (#4278)
Co-authored-by: Brady <brady.jubic@gsa.gov>
2021-09-13 23:31:03 +01:00
Bert Blommers
34c00e7dbd
#3548 - Logs - Transform assertions into proper exceptions (#3744) 2021-08-28 09:36:43 +01:00
kbalk
6b880003c6
Add Log Service describe_resource_policies, delete_resource_policy (#4150)
Co-authored-by: Karri Balk <kbalk@users.noreply.github.com>
2021-08-07 09:04:15 +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
Bert Blommers
7693d77333
Remove Py2 support (#3915) 2021-07-26 07:40:39 +01:00
Brian Pandola
315c357cd5
Fix error message for missing log stream (#4043) 2021-06-29 06:06:14 +01:00
usmangani1
9836985473
Fix : Logs - Add start_query functionality (#3985)
* Added start_query functionality

* fix tests
2021-06-07 10:37:11 +01:00
Neil Greenwood
45167737e5
Fix separator in filter_log_events nextToken value. (#3914)
The old separator was present in some of the values being concatenated.
2021-05-07 18:49:36 +01:00
Neil Greenwood
94a70e9ad1
nextToken value in logs:describeLogStreams response (#3896)
* `nextToken` value in `logs:describeLogStreams` response

Modified the pagination for FilterLogEvents to more closely follow
the real AWS behaviour.

* Make assertions work in py2 and py3.
2021-05-04 17:45:23 +01:00
Neil Greenwood
bcc7938615
Fix: nextToken value in logs:FilterLogEvents response (#3883)
* Fix: `nextToken` value in `logs:FilterLogEvents` response

Plagiarizing freely from @bpandola and his PR #3398, I have
modified the pagination for FilterLogEvents to more closely follow
the real AWS behaviour.

Fixes #3882

* Black reformatted my code.

* Remove timezone for python2.7 compatibility.

* Hopefully fix python2.7 compatibility for real.

* Additional test for a non-matching log group name in the nextToken.
2021-04-29 12:56:20 +01:00
Bert Blommers
273ca63d59 Linting 2020-11-11 15:55:37 +00:00
Matěj Cepl
5697ff87a8 Back to Black 2020-11-10 14:12:38 +01: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
Brian Pandola
9eb58eea41
Fix: nextToken value in logs:DescribeLogGroups response (#3398)
The pagination for this endpoint has been modified to more closely
model the real AWS behavior:
* Log Groups are now sorted alphabetically by `logGroupName`.
* `nextToken` is now a string containing the last `logGroupName` in the
  current response.
* Specifying an invalid `nextToken` does not generate an error, but does
  return an empty group list.
* `nextToken` is not included in the response if there are no additional
  items to return.

Fixes #3395
2020-10-21 09:47:09 +01:00
Bert Blommers
db1d7123f6 List dependencies for services - add integration test to verify 2020-09-13 16:08:23 +01:00
Anton Grübel
e73a694219
Add CloudWatch logs subscription filters (#2982)
* Add logs.describe_subscription_filters

* Add logs.put_subscription_filter

* Add logs.delete_subscription_filter

* Change to usage of ACCOUNT_ID
2020-05-12 13:34:10 +01:00
Guilherme Martins Crocetti
af08d71310 add support for RetentionInDays for LogGroup 2020-04-01 22:14:41 -03:00
gruebel
cea9c8c9a3 Fix order and nextToken handling in logs.get_log_events 2019-11-26 23:38:43 +01:00
Asher Foa
96e5b1993d Run black on moto & test directories. 2019-10-31 10:36:05 -07:00
Selena
6590226db5 fix test for server_mode (skip test) 2019-10-21 09:32:07 +02:00
Selena
37877c6fb2 add NotImplementedError when filter_pattern is given to filter_log_events
fix #2419
2019-10-18 13:46:27 +02:00
Wayne Metcalfe
9c66839f85 feat: implement logs untag_log_group 2019-09-26 20:20:53 +01:00
Wayne Metcalfe
0561a0050f feat: implement logs tag_log_group 2019-09-26 19:57:34 +01:00
Wayne Metcalfe
3cb7c3e568 feat: implement logs list_tags_log_group 2019-09-26 17:04:09 +01:00
Aleksandr Mangin
b163f23a22 fix tail message problem in get_log_events 2019-09-23 18:35:44 +02:00
Berislav Kovacki
5063ffc837 Implement pagination support for GetLogEvents
* Add nextForwardToken and nextBackwardToken to GetLogEvents response
* Handle end of stream by returning the same token as passed in
2019-08-07 17:37:53 +02:00
Jon Beilke
cb72d1d00e Feature cloudwatch log retention (#2199)
* add proper retentionInDays to describe_log_groups response and add support for delete_retention_policy() and put_retention_policy() to log groups

* fix for inline comment formatting

* include check for retentionInDays to verify no retention by default in  test_log_group_create
2019-05-25 10:14:23 +01:00
William Richard
3afb2862c0
Filter event log ids should be strings
Based on the boto docs, eventId should be returned as a string.
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/logs.html#CloudWatchLogs.Client.filter_log_events
2018-10-01 17:11:36 -04:00
chrisLeeTW
001a7d0278 type of json field - nextSequenceToken that return by cloudwatch logs putLogEvents should be string, not int. 2018-08-17 01:33:50 +08:00
Fujimoto Seiji
ac016a7bb3 Implement describe_log_groups() method for CloudWatchLogs
This patch teaches `LogsResponse` class how to handle the DescribeLogGroups
request, so that we can mock out the `boto.describe_log_groups()` call.

With this change in place, we can write as below:

    @mock_logs
    def test_log_group():
        conn = boto3.client('logs', 'us-west-2')

        some_method_to_init_log_groups()

        resp = conn.describe_log_groups(logGroupNamePrefix='myapp')
        assert ...

This should be fairly useful for a number of programs which handles
CloudWatchLogs.

Signed-off-by: Fujimoto Seiji <fujimoto@clear-code.com>
2018-04-24 18:38:51 +09:00
Josh Prendergast
ca72707409 Fix AttributeError in filter_log_events
An AttributeError would be thrown if the `interleaved` parameter was
passed.
2018-04-04 17:24:41 +01:00
Toshiya Kawasaki
39e9379195 Fix cloudwatch logs' response error (#1426) 2018-03-21 08:55:03 -07:00
Toshiya Kawasaki
663283a8f0 add logs exceptions 2018-01-14 14:35:53 +09:00
Alexander Mohr
9008b85299 lambda + SNS enhancements (#1048)
* updates

- support lambda messages from SNS
- run lambda in docker container

* decode output

* populate timeout

* simplify

* whoops

* skeletons of cloudwatchlogs

* impl filter log streams

* fix logging

* PEP fixes

* PEP fixes

* fix reset

* fix reset

* add new endpoint

* fix region name

* add docker

* try to fix tests

* try to fix travis issue with boto

* fix escaping in urls

* fix environment variables

* fix PEP

* more pep

* switch back to precise

* another fix attempt

* fix typo

* fix lambda invoke

* fix more unittests

* work on getting this to work in new scheme

* fix py2

* fix error

* fix tests when running in server mode

* more lambda fixes

* try running with latest docker

adapted from aiodocker

* switch to docker python client

* pep fixes

* switch to docker volume

* fix unittest

* fix invoke from sns

* fix zip2tar

* add hack impl for get_function with zip

* try fix

* fix for py < 3.6

* add volume refcount

* try to fix travis

* docker test

* fix yaml

* try fix

* update endpoints

* fix

* another attempt

* try again

* fix recursive import

* refactor fix

* revert changes with better fix

* more reverts

* wait for service to come up

* add back detached mode

* sleep and add another exception type

* put this back for logging

* put back with note

* whoops :)

* docker in docker!

* fix invalid url

* hopefully last fix!

* fix lambda regions

* fix protocol

* travis!!!!

* just run lambda test for now

* use one print

* fix escaping

* another attempt

* yet another

* re-enable all tests

* fixes

* fix for py2

* revert change

* fix for py2.7

* fix output ordering

* remove this given there's a new unittest that covers it

* changes based on review

- add skeleton logs test file
- switch to docker image that matches test env
- fix mock_logs import

* add readme entry
2017-09-27 16:04:58 -07:00