Skip to content

import_application_usage

import_application_usage(
    source_s3_location: SourceS3Location,
    *,
    config_overrides: Optional[ApplicationCostProfilerClientConfig] = None,
) -> ImportApplicationUsageResult

Ingests application usage data from Amazon Simple Storage Service (Amazon S3).

The data must already exist in the S3 location. As part of the action, AWS Application Cost Profiler copies the object from your S3 bucket to an S3 bucket owned by Amazon for processing asynchronously.

Parameters:

  • source_s3_location (SourceS3Location) –

    Amazon S3 location to import application usage data from.

Raises:

Source code in docs_src/capo_applicationcostprofiler/_services/application_cost_profiler.py
def import_application_usage(
    self,
    source_s3_location: "capo_applicationcostprofiler.types.source_s3_location.SourceS3Location",
    *,
    config_overrides: Optional[ApplicationCostProfilerClientConfig] = None,
) -> "capo_applicationcostprofiler.types.import_application_usage_result.ImportApplicationUsageResult":
    """<p>Ingests application usage data from Amazon Simple Storage Service (Amazon S3).</p> <p>The data must already exist in the S3 location. As part of the action, AWS Application Cost Profiler copies the object from your S3 bucket to an S3 bucket owned by Amazon for processing asynchronously.</p>

    Args:
        source_s3_location: <p>Amazon S3 location to import application usage data from.</p>

    Raises:
        capo_applicationcostprofiler.errors.access_denied_exception.AccessDeniedException: <p>You do not have permission to perform this action.</p>
        capo_applicationcostprofiler.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</p>
        capo_applicationcostprofiler.errors.throttling_exception.ThrottlingException: <p>The calls to AWS Application Cost Profiler API are throttled. The request was denied.</p>
        capo_applicationcostprofiler.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints for the API.</p>
        capo_applicationcostprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_applicationcostprofiler.types.import_application_usage_request.ImportApplicationUsageRequest]",
    ) -> OperationResponse[
        "capo_applicationcostprofiler.types.import_application_usage_result.ImportApplicationUsageResult"
    ]:
        import capo_applicationcostprofiler._operations.aws_application_cost_profiler.import_application_usage

        output, http_response = (
            capo_applicationcostprofiler._operations.aws_application_cost_profiler.import_application_usage.import_application_usage(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ImportApplicationUsage")
    )
    input_: capo_applicationcostprofiler.types.import_application_usage_request.ImportApplicationUsageRequest = {
        "source_s3_location": source_s3_location
    }

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