Skip to content

create_explainability_export async

create_explainability_export(
    explainability_export_name: Name,
    explainability_arn: Arn,
    destination: DataDestination,
    *,
    config_overrides: Optional[AsyncforecastClientConfig] = None,
    tags: Optional[Tags] = None,
    format: Optional[Format] = None,
) -> CreateExplainabilityExportResponse

Exports an Explainability resource created by the CreateExplainability operation. Exported files are exported to an Amazon Simple Storage Service (Amazon S3) bucket.

You must specify a DataDestination object that includes an Amazon S3 bucket and an Identity and Access Management (IAM) role that Amazon Forecast can assume to access the Amazon S3 bucket. For more information, see aws-forecast-iam-roles.

The Status of the export job must be ACTIVE before you can access the export in your Amazon S3 bucket. To get the status, use the DescribeExplainabilityExport operation.

Parameters:

  • explainability_export_name (Name) –

    A unique name for the Explainability export.

  • explainability_arn (Arn) –

    The Amazon Resource Name (ARN) of the Explainability to export.

  • tags (Optional[Tags], default: None ) –

    Optional metadata to help you categorize and organize your resources. Each tag consists of a key and an optional value, both of which you define. Tag keys and values are case sensitive.

    The following restrictions apply to tags:

    • For each resource, each tag key must be unique and each tag key must have one value.

    • Maximum number of tags per resource: 50.

    • Maximum key length: 128 Unicode characters in UTF-8.

    • Maximum value length: 256 Unicode characters in UTF-8.

    • Accepted characters: all letters and numbers, spaces representable in UTF-8, and + - = . _ : / @. If your tagging schema is used across other services and resources, the character restrictions of those services also apply.

    • Key prefixes cannot include any upper or lowercase combination of aws: or AWS:. Values can have this prefix. If a tag value has aws as its prefix but the key does not, Forecast considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix of aws do not count against your tags per resource limit. You cannot edit or delete tag keys with this prefix.

  • format (Optional[Format], default: None ) –

    The format of the exported data, CSV or PARQUET.

Raises:

Source code in docs_src/capo_forecast/_services/async_forecast.py
async def create_explainability_export(
    self,
    explainability_export_name: "capo_forecast.types.name.Name",
    explainability_arn: "capo_forecast.types.arn.Arn",
    destination: "capo_forecast.types.data_destination.DataDestination",
    *,
    config_overrides: Optional[AsyncforecastClientConfig] = None,
    tags: Optional["capo_forecast.types.tags.Tags"] = None,
    format: Optional["capo_forecast.types.format.Format"] = None,
) -> "capo_forecast.types.create_explainability_export_response.CreateExplainabilityExportResponse":
    """<p>Exports an Explainability resource created by the <a>CreateExplainability</a> operation. Exported files are exported to an Amazon Simple Storage Service (Amazon S3) bucket.</p> <p>You must specify a <a>DataDestination</a> object that includes an Amazon S3 bucket and an Identity and Access Management (IAM) role that Amazon Forecast can assume to access the Amazon S3 bucket. For more information, see <a>aws-forecast-iam-roles</a>.</p> <note> <p>The <code>Status</code> of the export job must be <code>ACTIVE</code> before you can access the export in your Amazon S3 bucket. To get the status, use the <a>DescribeExplainabilityExport</a> operation.</p> </note>

    Args:
        explainability_export_name: <p>A unique name for the Explainability export.</p>
        explainability_arn: <p>The Amazon Resource Name (ARN) of the Explainability to export.</p>
        tags: <p>Optional metadata to help you categorize and organize your resources. Each tag consists of a key and an optional value, both of which you define. Tag keys and values are case sensitive.</p> <p>The following restrictions apply to tags:</p> <ul> <li> <p>For each resource, each tag key must be unique and each tag key must have one value.</p> </li> <li> <p>Maximum number of tags per resource: 50.</p> </li> <li> <p>Maximum key length: 128 Unicode characters in UTF-8.</p> </li> <li> <p>Maximum value length: 256 Unicode characters in UTF-8.</p> </li> <li> <p>Accepted characters: all letters and numbers, spaces representable in UTF-8, and + - = . _ : / @. If your tagging schema is used across other services and resources, the character restrictions of those services also apply. </p> </li> <li> <p>Key prefixes cannot include any upper or lowercase combination of <code>aws:</code> or <code>AWS:</code>. Values can have this prefix. If a tag value has <code>aws</code> as its prefix but the key does not, Forecast considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix of <code>aws</code> do not count against your tags per resource limit. You cannot edit or delete tag keys with this prefix.</p> </li> </ul>
        format: <p>The format of the exported data, CSV or PARQUET.</p>

    Raises:
        capo_forecast.errors.invalid_input_exception.InvalidInputException: <p>We can't process the request because it includes an invalid value or a value that exceeds the valid range.</p>
        capo_forecast.errors.limit_exceeded_exception.LimitExceededException: <p>The limit on the number of resources per account has been exceeded.</p>
        capo_forecast.errors.resource_already_exists_exception.ResourceAlreadyExistsException: <p>There is already a resource with this name. Try again with a different name.</p>
        capo_forecast.errors.resource_in_use_exception.ResourceInUseException: <p>The specified resource is in use.</p>
        capo_forecast.errors.resource_not_found_exception.ResourceNotFoundException: <p>We can't find a resource with that Amazon Resource Name (ARN). Check the ARN and try again.</p>
        capo_forecast.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_forecast.types.create_explainability_export_request.CreateExplainabilityExportRequest]",
    ) -> AsyncOperationResponse[
        "capo_forecast.types.create_explainability_export_response.CreateExplainabilityExportResponse"
    ]:
        import capo_forecast._operations.amazon_forecast.create_explainability_export

        (
            output,
            http_response,
        ) = await capo_forecast._operations.amazon_forecast.create_explainability_export.async_create_explainability_export(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_forecast.types.create_explainability_export_request.CreateExplainabilityExportRequest",
    ) -> dict[str, Any]:
        import capo_forecast.types.create_explainability_export_request

        return capo_forecast.types.create_explainability_export_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateExplainabilityExport", redact_input=_redact_input),
    )
    input_: capo_forecast.types.create_explainability_export_request.CreateExplainabilityExportRequest = {
        "explainability_export_name": explainability_export_name,
        "explainability_arn": explainability_arn,
        "destination": destination,
    }
    if tags is not None:
        input_["tags"] = tags
    if format is not None:
        input_["format"] = format

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output