Creates and updates the retention configuration with details about retention period (number of days) that Config stores your historical information. The API creates the RetentionConfiguration object and names the object as default. When you have a RetentionConfiguration object named default, calling the API modifies the default object.
Currently, Config supports only one retention configuration per region in your account.
Parameters:
-
retention_period_in_days
(RetentionPeriodInDays)
–
Number of days Config stores your historical information.
Currently, only applicable to the configuration item history.
Raises:
Source code in docs_src/capo_config_service/_services/async_config_service.py
| async def put_retention_configuration(
self,
retention_period_in_days: "capo_config_service.types.retention_period_in_days.RetentionPeriodInDays",
*,
config_overrides: Optional[AsyncConfigServiceClientConfig] = None,
) -> "capo_config_service.types.put_retention_configuration_response.PutRetentionConfigurationResponse":
"""<p>Creates and updates the retention configuration with details about retention period (number of days) that Config stores your historical information. The API creates the <code>RetentionConfiguration</code> object and names the object as <b>default</b>. When you have a <code>RetentionConfiguration</code> object named <b>default</b>, calling the API modifies the default object. </p> <note> <p>Currently, Config supports only one retention configuration per region in your account.</p> </note>
Args:
retention_period_in_days: <p>Number of days Config stores your historical information.</p> <note> <p>Currently, only applicable to the configuration item history.</p> </note>
Raises:
capo_config_service.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One or more of the specified parameters are not valid. Verify that your parameters are valid and try again.</p>
capo_config_service.errors.max_number_of_retention_configurations_exceeded_exception.MaxNumberOfRetentionConfigurationsExceededException: <p>Failed to add the retention configuration because a retention configuration with that name already exists.</p>
capo_config_service.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_config_service.types.put_retention_configuration_request.PutRetentionConfigurationRequest]",
) -> AsyncOperationResponse[
"capo_config_service.types.put_retention_configuration_response.PutRetentionConfigurationResponse"
]:
import capo_config_service._operations.starling_dove_service.put_retention_configuration
(
output,
http_response,
) = await capo_config_service._operations.starling_dove_service.put_retention_configuration.async_put_retention_configuration(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("PutRetentionConfiguration")
)
input_: capo_config_service.types.put_retention_configuration_request.PutRetentionConfigurationRequest = {
"retention_period_in_days": retention_period_in_days
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|