Skip to content

generate_access_logs

generate_access_logs(
    domain_name: DomainName,
    app_id: AppId,
    *,
    config_overrides: Optional[AmplifyClientConfig] = None,
    start_time: Optional[StartTime] = None,
    end_time: Optional[EndTime] = None,
) -> GenerateAccessLogsResult

Returns the website access logs for a specific time range using a presigned URL.

Parameters:

  • start_time (Optional[StartTime], default: None ) –

    The time at which the logs should start. The time range specified is inclusive of the start time.

  • end_time (Optional[EndTime], default: None ) –

    The time at which the logs should end. The time range specified is inclusive of the end time.

  • domain_name (DomainName) –

    The name of the domain.

  • app_id (AppId) –

    The unique ID for an Amplify app.

Raises:

Source code in docs_src/capo_amplify/_services/amplify.py
def generate_access_logs(
    self,
    domain_name: "capo_amplify.types.domain_name.DomainName",
    app_id: "capo_amplify.types.app_id.AppId",
    *,
    config_overrides: Optional[AmplifyClientConfig] = None,
    start_time: Optional["capo_amplify.types.start_time.StartTime"] = None,
    end_time: Optional["capo_amplify.types.end_time.EndTime"] = None,
) -> "capo_amplify.types.generate_access_logs_result.GenerateAccessLogsResult":
    """<p>Returns the website access logs for a specific time range using a presigned URL. </p>

    Args:
        start_time: <p>The time at which the logs should start. The time range specified is inclusive of the start time. </p>
        end_time: <p>The time at which the logs should end. The time range specified is inclusive of the end time. </p>
        domain_name: <p>The name of the domain. </p>
        app_id: <p>The unique ID for an Amplify app. </p>

    Raises:
        capo_amplify.errors.bad_request_exception.BadRequestException: <p>A request contains unexpected data. </p>
        capo_amplify.errors.internal_failure_exception.InternalFailureException: <p>The service failed to perform an operation due to an internal issue. </p>
        capo_amplify.errors.not_found_exception.NotFoundException: <p>An entity was not found during an operation. </p>
        capo_amplify.errors.unauthorized_exception.UnauthorizedException: <p>An operation failed due to a lack of access. </p>
        capo_amplify.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_amplify.types.generate_access_logs_request.GenerateAccessLogsRequest]",
    ) -> OperationResponse[
        "capo_amplify.types.generate_access_logs_result.GenerateAccessLogsResult"
    ]:
        import capo_amplify._operations.amplify.generate_access_logs

        output, http_response = (
            capo_amplify._operations.amplify.generate_access_logs.generate_access_logs(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GenerateAccessLogs")
    )
    input_: capo_amplify.types.generate_access_logs_request.GenerateAccessLogsRequest = {
        "domain_name": domain_name,
        "app_id": app_id,
    }
    if start_time is not None:
        input_["start_time"] = start_time
    if end_time is not None:
        input_["end_time"] = end_time

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