aws_codeseeder.services.cloudwatch

Module Contents

Classes

CloudWatchEvent

Typed version of namedtuple.

CloudWatchEvents

Typed version of namedtuple.

Functions

get_log_events(group_name: str, stream_name: str, start_time: Optional[datetime.datetime], session: Optional[Union[Callable[[], boto3.Session], boto3.Session]] = None) → CloudWatchEvents

Get CloudWatch Logs Events

get_stream_name_by_prefix(group_name: str, prefix: str, session: Optional[Union[Callable[[], boto3.Session], boto3.Session]] = None) → Optional[str]

Get the CloudWatch Logs stream name

class aws_codeseeder.services.cloudwatch.CloudWatchEvent

Bases: NamedTuple

Typed version of namedtuple.

Usage in Python versions >= 3.6:

class Employee(NamedTuple):
    name: str
    id: int

This is equivalent to:

Employee = collections.namedtuple('Employee', ['name', 'id'])

The resulting class has an extra __annotations__ attribute, giving a dict that maps field names to types. (The field names are also in the _fields attribute, which is part of the namedtuple API.) Alternative equivalent keyword syntax is also accepted:

Employee = NamedTuple('Employee', name=str, id=int)

In Python versions <= 3.5 use:

Employee = NamedTuple('Employee', [('name', str), ('id', int)])
message :str
timestamp :datetime.datetime
class aws_codeseeder.services.cloudwatch.CloudWatchEvents

Bases: NamedTuple

Typed version of namedtuple.

Usage in Python versions >= 3.6:

class Employee(NamedTuple):
    name: str
    id: int

This is equivalent to:

Employee = collections.namedtuple('Employee', ['name', 'id'])

The resulting class has an extra __annotations__ attribute, giving a dict that maps field names to types. (The field names are also in the _fields attribute, which is part of the namedtuple API.) Alternative equivalent keyword syntax is also accepted:

Employee = NamedTuple('Employee', name=str, id=int)

In Python versions <= 3.5 use:

Employee = NamedTuple('Employee', [('name', str), ('id', int)])
events :List[CloudWatchEvent]
group_name :str
last_timestamp :Optional[datetime.datetime]
start_time :Optional[datetime.datetime]
stream_name_prefix :str
aws_codeseeder.services.cloudwatch.get_log_events(group_name: str, stream_name: str, start_time: Optional[datetime.datetime], session: Optional[Union[Callable[[], boto3.Session], boto3.Session]] = None) CloudWatchEvents

Get CloudWatch Logs Events

Parameters
  • group_name (str) – Name of the CloudWatch Logs group

  • stream_name (str) – Name of teh CloudWatch Logs stream in the group

  • start_time (Optional[datetime]) – Start time of the CloudWatch Logs Events

  • session (Optional[Union[Callable[[], Session], Session]], optional) – Optional Session or function returning a Session to use for all boto3 operations, by default None

Returns

CloudWatch Logs Events since start_time (if found)

Return type

CloudWatchEvents

aws_codeseeder.services.cloudwatch.get_stream_name_by_prefix(group_name: str, prefix: str, session: Optional[Union[Callable[[], boto3.Session], boto3.Session]] = None) Optional[str]

Get the CloudWatch Logs stream name

Parameters
  • group_name (str) – Name of the CloudWatch Logs group

  • prefix (str) – Naming prefix of the CloudWatch Logs Stream

  • session (Optional[Union[Callable[[], Session], Session]], optional) – Optional Session or function returning a Session to use for all boto3 operations, by default None

Returns

Name of the CloudWatch Logs Stream (if found)

Return type

Optional[str]