Skip to content

put_storage_lens_configuration async

put_storage_lens_configuration(
    config_id: ConfigId,
    account_id: AccountId,
    storage_lens_configuration: StorageLensConfiguration,
    *,
    config_overrides: Optional[AsyncS3ControlClientConfig] = None,
    tags: Optional[StorageLensTags] = None,
) -> None

This operation is not supported by directory buckets.

Puts an Amazon S3 Storage Lens configuration. For more information about S3 Storage Lens, see Working with Amazon S3 Storage Lens in the Amazon S3 User Guide. For a complete list of S3 Storage Lens metrics, see S3 Storage Lens metrics glossary in the Amazon S3 User Guide.

To use this action, you must have permission to perform the s3:PutStorageLensConfiguration action. For more information, see Setting permissions to use Amazon S3 Storage Lens in the Amazon S3 User Guide.

Parameters:

  • config_id (ConfigId) –

    The ID of the S3 Storage Lens configuration.

  • account_id (AccountId) –

    The account ID of the requester.

  • storage_lens_configuration (StorageLensConfiguration) –

    The S3 Storage Lens configuration.

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

    The tag set of the S3 Storage Lens configuration.

    You can set up to a maximum of 50 tags.

Raises:

Source code in docs_src/capo_s3_control/_services/async_s3_control.py
async def put_storage_lens_configuration(
    self,
    config_id: "capo_s3_control.types.config_id.ConfigId",
    account_id: "capo_s3_control.types.account_id.AccountId",
    storage_lens_configuration: "capo_s3_control.types.storage_lens_configuration.StorageLensConfiguration",
    *,
    config_overrides: Optional[AsyncS3ControlClientConfig] = None,
    tags: Optional[
        "capo_s3_control.types.storage_lens_tags.StorageLensTags"
    ] = None,
) -> None:
    """<note> <p>This operation is not supported by directory buckets.</p> </note> <p>Puts an Amazon S3 Storage Lens configuration. For more information about S3 Storage Lens, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens.html">Working with Amazon S3 Storage Lens</a> in the <i>Amazon S3 User Guide</i>. For a complete list of S3 Storage Lens metrics, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens_metrics_glossary.html">S3 Storage Lens metrics glossary</a> in the <i>Amazon S3 User Guide</i>.</p> <note> <p>To use this action, you must have permission to perform the <code>s3:PutStorageLensConfiguration</code> action. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens_iam_permissions.html">Setting permissions to use Amazon S3 Storage Lens</a> in the <i>Amazon S3 User Guide</i>.</p> </note>

    Args:
        config_id: <p>The ID of the S3 Storage Lens configuration.</p>
        account_id: <p>The account ID of the requester.</p>
        storage_lens_configuration: <p>The S3 Storage Lens configuration.</p>
        tags: <p>The tag set of the S3 Storage Lens configuration.</p> <note> <p>You can set up to a maximum of 50 tags.</p> </note>

    Raises:
        capo_s3_control.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_s3_control.types.put_storage_lens_configuration_request.PutStorageLensConfigurationRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_s3_control._operations.awss3_control_service_v20180820.put_storage_lens_configuration

        (
            output,
            http_response,
        ) = await capo_s3_control._operations.awss3_control_service_v20180820.put_storage_lens_configuration.async_put_storage_lens_configuration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutStorageLensConfiguration")
    )
    input_: capo_s3_control.types.put_storage_lens_configuration_request.PutStorageLensConfigurationRequest = {
        "config_id": config_id,
        "account_id": account_id,
        "storage_lens_configuration": storage_lens_configuration,
    }
    if tags is not None:
        input_["tags"] = tags

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