:py:mod:`aws_codeseeder.services.cloudwatch` ============================================ .. py:module:: aws_codeseeder.services.cloudwatch Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: aws_codeseeder.services.cloudwatch.CloudWatchEvent aws_codeseeder.services.cloudwatch.CloudWatchEvents Functions ~~~~~~~~~ .. autoapisummary:: aws_codeseeder.services.cloudwatch.get_log_events aws_codeseeder.services.cloudwatch.get_stream_name_by_prefix .. py:class:: CloudWatchEvent Bases: :py:obj:`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)]) .. py:attribute:: message :type: str .. py:attribute:: timestamp :type: datetime.datetime .. py:class:: CloudWatchEvents Bases: :py:obj:`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)]) .. py:attribute:: events :type: List[CloudWatchEvent] .. py:attribute:: group_name :type: str .. py:attribute:: last_timestamp :type: Optional[datetime.datetime] .. py:attribute:: start_time :type: Optional[datetime.datetime] .. py:attribute:: stream_name_prefix :type: str .. py:function:: 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 :param group_name: Name of the CloudWatch Logs group :type group_name: str :param stream_name: Name of teh CloudWatch Logs stream in the group :type stream_name: str :param start_time: Start time of the CloudWatch Logs Events :type start_time: Optional[datetime] :param session: Optional Session or function returning a Session to use for all boto3 operations, by default None :type session: Optional[Union[Callable[[], Session], Session]], optional :returns: CloudWatch Logs Events since ``start_time`` (if found) :rtype: CloudWatchEvents .. py:function:: 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 :param group_name: Name of the CloudWatch Logs group :type group_name: str :param prefix: Naming prefix of the CloudWatch Logs Stream :type prefix: str :param session: Optional Session or function returning a Session to use for all boto3 operations, by default None :type session: Optional[Union[Callable[[], Session], Session]], optional :returns: Name of the CloudWatch Logs Stream (if found) :rtype: Optional[str]