Update a usage limit in Amazon Redshift Serverless. You can't update the usage type or period of a usage limit.
Parameters:
-
usage_limit_id
(str)
–
The identifier of the usage limit to update.
-
amount
(Optional[int], default:
None
)
–
The new limit amount. If time-based, this amount is in Redshift Processing Units (RPU) consumed per hour. If data-based, this amount is in terabytes (TB) of data transferred between Regions in cross-account sharing. The value must be a positive number.
-
breach_action
(Optional[UsageLimitBreachAction], default:
None
)
–
The new action that Amazon Redshift Serverless takes when the limit is reached.
Raises:
Source code in docs_src/capo_redshift_serverless/_services/async_redshift_serverless.py
| async def update_usage_limit(
self,
usage_limit_id: str,
*,
config_overrides: Optional[AsyncRedshiftServerlessClientConfig] = None,
amount: Optional[int] = None,
breach_action: Optional[
"capo_redshift_serverless.types.usage_limit_breach_action.UsageLimitBreachAction"
] = None,
) -> "capo_redshift_serverless.types.update_usage_limit_response.UpdateUsageLimitResponse":
"""<p>Update a usage limit in Amazon Redshift Serverless. You can't update the usage type or period of a usage limit.</p>
Args:
usage_limit_id: <p>The identifier of the usage limit to update.</p>
amount: <p>The new limit amount. If time-based, this amount is in Redshift Processing Units (RPU) consumed per hour. If data-based, this amount is in terabytes (TB) of data transferred between Regions in cross-account sharing. The value must be a positive number.</p>
breach_action: <p>The new action that Amazon Redshift Serverless takes when the limit is reached.</p>
Raises:
capo_redshift_serverless.errors.conflict_exception.ConflictException: <p>The submitted action has conflicts.</p>
capo_redshift_serverless.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
capo_redshift_serverless.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found.</p>
capo_redshift_serverless.errors.validation_exception.ValidationException: <p>The input failed to satisfy the constraints specified by an Amazon Web Services service.</p>
capo_redshift_serverless.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_redshift_serverless.types.update_usage_limit_request.UpdateUsageLimitRequest]",
) -> AsyncOperationResponse[
"capo_redshift_serverless.types.update_usage_limit_response.UpdateUsageLimitResponse"
]:
import capo_redshift_serverless._operations.redshift_serverless.update_usage_limit
(
output,
http_response,
) = await capo_redshift_serverless._operations.redshift_serverless.update_usage_limit.async_update_usage_limit(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateUsageLimit")
)
input_: capo_redshift_serverless.types.update_usage_limit_request.UpdateUsageLimitRequest = {
"usage_limit_id": usage_limit_id
}
if amount is not None:
input_["amount"] = amount
if breach_action is not None:
input_["breach_action"] = breach_action
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|