Skip to content

export_lens async

export_lens(
    lens_alias: LensAlias,
    *,
    config_overrides: Optional[AsyncWellArchitectedClientConfig] = None,
    lens_version: Optional[LensVersion] = None,
) -> ExportLensOutput

Export an existing lens.

Only the owner of a lens can export it. Lenses provided by Amazon Web Services (Amazon Web Services Official Content) cannot be exported.

Lenses are defined in JSON. For more information, see JSON format specification in the Well-Architected Tool User Guide.

Disclaimer

Do not include or gather personal identifiable information (PII) of end users or other identifiable individuals in or via your custom lenses. If your custom lens or those shared with you and used in your account do include or collect PII you are responsible for: ensuring that the included PII is processed in accordance with applicable law, providing adequate privacy notices, and obtaining necessary consents for processing such data.

Parameters:

Raises:

Source code in docs_src/capo_wellarchitected/_services/async_well_architected.py
async def export_lens(
    self,
    lens_alias: "capo_wellarchitected.types.lens_alias.LensAlias",
    *,
    config_overrides: Optional[AsyncWellArchitectedClientConfig] = None,
    lens_version: Optional[
        "capo_wellarchitected.types.lens_version.LensVersion"
    ] = None,
) -> "capo_wellarchitected.types.export_lens_output.ExportLensOutput":
    """<p>Export an existing lens.</p> <p>Only the owner of a lens can export it. Lenses provided by Amazon Web Services (Amazon Web Services Official Content) cannot be exported.</p> <p>Lenses are defined in JSON. For more information, see <a href="https://docs.aws.amazon.com/wellarchitected/latest/userguide/lenses-format-specification.html">JSON format specification</a> in the <i>Well-Architected Tool User Guide</i>.</p> <note> <p> <b>Disclaimer</b> </p> <p>Do not include or gather personal identifiable information (PII) of end users or other identifiable individuals in or via your custom lenses. If your custom lens or those shared with you and used in your account do include or collect PII you are responsible for: ensuring that the included PII is processed in accordance with applicable law, providing adequate privacy notices, and obtaining necessary consents for processing such data.</p> </note>

    Args:
        lens_version: <p>The lens version to be exported.</p>

    Raises:
        capo_wellarchitected.errors.access_denied_exception.AccessDeniedException: <p>User does not have sufficient access to perform this action.</p>
        capo_wellarchitected.errors.internal_server_exception.InternalServerException: <p>There is a problem with the Well-Architected Tool API service.</p>
        capo_wellarchitected.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
        capo_wellarchitected.errors.throttling_exception.ThrottlingException: <p>Request was denied due to request throttling.</p>
        capo_wellarchitected.errors.validation_exception.ValidationException: <p>The user input is not valid.</p>
        capo_wellarchitected.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_wellarchitected.types.export_lens_input.ExportLensInput]",
    ) -> AsyncOperationResponse[
        "capo_wellarchitected.types.export_lens_output.ExportLensOutput"
    ]:
        import capo_wellarchitected._operations.well_architected_api_service_lambda.export_lens

        (
            output,
            http_response,
        ) = await capo_wellarchitected._operations.well_architected_api_service_lambda.export_lens.async_export_lens(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ExportLens")
    )
    input_: capo_wellarchitected.types.export_lens_input.ExportLensInput = {
        "lens_alias": lens_alias
    }
    if lens_version is not None:
        input_["lens_version"] = lens_version

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