Commit Graph

29 Commits

Author SHA1 Message Date
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
0ab21f62a8 Linting 2020-09-13 19:42:38 +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