Skip to content

list_event_logs

list_event_logs(
    space_name: NameString,
    start_time: Timestamp,
    end_time: Timestamp,
    *,
    config_overrides: Optional[CodeCatalystClientConfig] = None,
    event_name: Optional[str] = None,
    next_token: Optional[str] = None,
    max_results: Optional[int] = None,
) -> ListEventLogsResponse

Retrieves a list of events that occurred during a specific time in a space. You can use these events to audit user and system activity in a space. For more information, see Monitoring in the Amazon CodeCatalyst User Guide.

ListEventLogs guarantees events for the last 30 days in a given space. You can also view and retrieve a list of management events over the last 90 days for Amazon CodeCatalyst in the CloudTrail console by viewing Event history, or by creating a trail to create and maintain a record of events that extends past 90 days. For more information, see Working with CloudTrail Event History and Working with CloudTrail trails.

Parameters:

  • space_name (NameString) –

    The name of the space.

  • start_time (Timestamp) –

    The date and time when you want to start retrieving events, in coordinated universal time (UTC) timestamp format as specified in RFC 3339.

  • end_time (Timestamp) –

    The time after which you do not want any events retrieved, in coordinated universal time (UTC) timestamp format as specified in RFC 3339.

  • event_name (Optional[str], default: None ) –

    The name of the event.

  • next_token (Optional[str], default: None ) –

    A token returned from a call to this API to indicate the next batch of results to return, if any.

  • max_results (Optional[int], default: None ) –

    The maximum number of results to show in a single call to this API. If the number of results is larger than the number you specified, the response will include a NextToken element, which you can use to obtain additional results.

Raises:

  • AccessDeniedException –

    The request was denied because you don't have sufficient access to perform this action. Verify that you are a member of a role that allows this action.

  • ConflictException –

    The request was denied because the requested operation would cause a conflict with the current state of a service resource associated with the request. Another user might have updated the resource. Reload, make sure you have the latest data, and then try again.

  • ResourceNotFoundException –

    The request was denied because the specified resource was not found. Verify that the spelling is correct and that you have access to the resource.

  • ServiceQuotaExceededException –

    The request was denied because one or more resources has reached its limits for the tier the space belongs to. Either reduce the number of resources, or change the tier if applicable.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The request was denied because an input failed to satisfy the constraints specified by the service. Check the spelling and input requirements, and then try again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_codecatalyst/_services/code_catalyst.py
def list_event_logs(
    self,
    space_name: "capo_codecatalyst.types.name_string.NameString",
    start_time: "capo_codecatalyst.types.timestamp.Timestamp",
    end_time: "capo_codecatalyst.types.timestamp.Timestamp",
    *,
    config_overrides: Optional[CodeCatalystClientConfig] = None,
    event_name: Optional[str] = None,
    next_token: Optional[str] = None,
    max_results: Optional[int] = None,
) -> "capo_codecatalyst.types.list_event_logs_response.ListEventLogsResponse":
    """<p>Retrieves a list of events that occurred during a specific time in a space. You can use these events to audit user and system activity in a space. For more information, see <a href="https://docs.aws.amazon.com/codecatalyst/latest/userguide/ipa-monitoring.html">Monitoring</a> in the <i>Amazon CodeCatalyst User Guide</i>.</p> <note> <p>ListEventLogs guarantees events for the last 30 days in a given space. You can also view and retrieve a list of management events over the last 90 days for Amazon CodeCatalyst in the CloudTrail console by viewing Event history, or by creating a trail to create and maintain a record of events that extends past 90 days. For more information, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html">Working with CloudTrail Event History</a> and <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-getting-started.html">Working with CloudTrail trails</a>.</p> </note>

    Args:
        space_name: <p>The name of the space.</p>
        start_time: <p>The date and time when you want to start retrieving events, in coordinated universal time (UTC) timestamp format as specified in <a href="https://www.rfc-editor.org/rfc/rfc3339#section-5.6">RFC 3339</a>.</p>
        end_time: <p>The time after which you do not want any events retrieved, in coordinated universal time (UTC) timestamp format as specified in <a href="https://www.rfc-editor.org/rfc/rfc3339#section-5.6">RFC 3339</a>.</p>
        event_name: <p>The name of the event.</p>
        next_token: <p>A token returned from a call to this API to indicate the next batch of results to return, if any.</p>
        max_results: <p>The maximum number of results to show in a single call to this API. If the number of results is larger than the number you specified, the response will include a <code>NextToken</code> element, which you can use to obtain additional results.</p>

    Raises:
        capo_codecatalyst.errors.access_denied_exception.AccessDeniedException: <p>The request was denied because you don't have sufficient access to perform this action. Verify that you are a member of a role that allows this action.</p>
        capo_codecatalyst.errors.conflict_exception.ConflictException: <p>The request was denied because the requested operation would cause a conflict with the current state of a service resource associated with the request. Another user might have updated the resource. Reload, make sure you have the latest data, and then try again.</p>
        capo_codecatalyst.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was denied because the specified resource was not found. Verify that the spelling is correct and that you have access to the resource.</p>
        capo_codecatalyst.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request was denied because one or more resources has reached its limits for the tier the space belongs to. Either reduce the number of resources, or change the tier if applicable.</p>
        capo_codecatalyst.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_codecatalyst.errors.validation_exception.ValidationException: <p>The request was denied because an input failed to satisfy the constraints specified by the service. Check the spelling and input requirements, and then try again.</p>
        capo_codecatalyst.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_codecatalyst.types.list_event_logs_request.ListEventLogsRequest]",
    ) -> OperationResponse[
        "capo_codecatalyst.types.list_event_logs_response.ListEventLogsResponse"
    ]:
        import capo_codecatalyst._operations.code_catalyst.list_event_logs

        output, http_response = (
            capo_codecatalyst._operations.code_catalyst.list_event_logs.list_event_logs(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListEventLogs")
    )
    input_: capo_codecatalyst.types.list_event_logs_request.ListEventLogsRequest = {
        "space_name": space_name,
        "start_time": start_time,
        "end_time": end_time,
    }
    if event_name is not None:
        input_["event_name"] = event_name
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output