Skip to content

put_storage_tier_policy async

put_storage_tier_policy(
    storage_tier: StorageTier,
    *,
    config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
) -> PutStorageTierPolicyResponse

Sets the storage tier policy for the account. When you set the storage tier to INTELLIGENT_TIERING, the service automatically moves log data to the most cost-effective storage tier based on access frequency.

Parameters:

  • storage_tier (StorageTier) –

    The storage tier to set for the account. Use INTELLIGENT_TIERING to automatically optimize storage costs by moving log data to the appropriate tier based on access frequency.

Raises:

Source code in docs_src/capo_cloudwatch_logs/_services/async_cloud_watch_logs.py
async def put_storage_tier_policy(
    self,
    storage_tier: "capo_cloudwatch_logs.types.storage_tier.StorageTier",
    *,
    config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
) -> "capo_cloudwatch_logs.types.put_storage_tier_policy_response.PutStorageTierPolicyResponse":
    """<p>Sets the storage tier policy for the account. When you set the storage tier to <code>INTELLIGENT_TIERING</code>, the service automatically moves log data to the most cost-effective storage tier based on access frequency.</p>

    Args:
        storage_tier: <p>The storage tier to set for the account. Use <code>INTELLIGENT_TIERING</code> to automatically optimize storage costs by moving log data to the appropriate tier based on access frequency.</p>

    Raises:
        capo_cloudwatch_logs.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permissions to perform this action.</p>
        capo_cloudwatch_logs.errors.invalid_parameter_exception.InvalidParameterException: <p>A parameter is specified incorrectly.</p>
        capo_cloudwatch_logs.errors.operation_aborted_exception.OperationAbortedException: <p>Multiple concurrent requests to update the same resource were in conflict.</p>
        capo_cloudwatch_logs.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_cloudwatch_logs.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service cannot complete the request.</p>
        capo_cloudwatch_logs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatch_logs.types.put_storage_tier_policy_request.PutStorageTierPolicyRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudwatch_logs.types.put_storage_tier_policy_response.PutStorageTierPolicyResponse"
    ]:
        import capo_cloudwatch_logs._operations.logs_20140328.put_storage_tier_policy

        (
            output,
            http_response,
        ) = await capo_cloudwatch_logs._operations.logs_20140328.put_storage_tier_policy.async_put_storage_tier_policy(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutStorageTierPolicy")
    )
    input_: capo_cloudwatch_logs.types.put_storage_tier_policy_request.PutStorageTierPolicyRequest = {
        "storage_tier": storage_tier
    }

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