Creates or replaces the organization's retention storage record for a model provider. The organization is resolved from the authenticated caller's management context; the caller must be the organization's management account or a delegated administrator. Requires resolved organization-scope trusted access eligibility for a storage-capable program of the provider; otherwise returns ConflictException. Writes replace the whole record; the last write wins.
For customer_managed destinations, Amazon Bedrock validates the caller's and service's access to the bucket and key before saving the configuration. The bucket and key must be in the AWS Region where you register the configuration. Validation failures reject the write.
Parameters:
-
model_provider
(DataRetentionStorageModelProvider)
–
The model provider whose retention storage configuration is addressed by this request.
-
storage_destination
(DataRetentionStorageDestination)
–
Where retained data is delivered for this scope. customer_managed requires storageConfiguration; amazon_managed forbids it.
-
storage_configuration
(Optional[DataRetentionStorageConfiguration], default:
None
)
–
Destination bucket and key. Required when storageDestination is customer_managed; rejected with ValidationException when amazon_managed.
Raises:
Source code in docs_src/capo_bedrock/_services/async_bedrock.py
| async def put_organization_data_retention_storage(
self,
model_provider: "capo_bedrock.types.data_retention_storage_model_provider.DataRetentionStorageModelProvider",
storage_destination: "capo_bedrock.types.data_retention_storage_destination.DataRetentionStorageDestination",
*,
config_overrides: Optional[AsyncBedrockClientConfig] = None,
storage_configuration: Optional[
"capo_bedrock.types.data_retention_storage_configuration.DataRetentionStorageConfiguration"
] = None,
) -> "capo_bedrock.types.put_organization_data_retention_storage_response.PutOrganizationDataRetentionStorageResponse":
"""<p>Creates or replaces the organization's retention storage record for a model provider. The organization is resolved from the authenticated caller's management context; the caller must be the organization's management account or a delegated administrator. Requires resolved organization-scope trusted access eligibility for a storage-capable program of the provider; otherwise returns ConflictException. Writes replace the whole record; the last write wins.</p> <p>For <code>customer_managed</code> destinations, Amazon Bedrock validates the caller's and service's access to the bucket and key before saving the configuration. The bucket and key must be in the AWS Region where you register the configuration. Validation failures reject the write.</p>
Args:
model_provider: <p>The model provider whose retention storage configuration is addressed by this request.</p>
storage_destination: <p>Where retained data is delivered for this scope. customer_managed requires storageConfiguration; amazon_managed forbids it.</p>
storage_configuration: <p>Destination bucket and key. Required when storageDestination is customer_managed; rejected with ValidationException when amazon_managed.</p>
Raises:
capo_bedrock.errors.access_denied_exception.AccessDeniedException: <p>The request is denied because of missing access permissions.</p>
capo_bedrock.errors.conflict_exception.ConflictException: <p>Error occurred because of a conflict while performing an operation.</p>
capo_bedrock.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</p>
capo_bedrock.errors.throttling_exception.ThrottlingException: <p>The number of requests exceeds the limit. Resubmit your request later.</p>
capo_bedrock.errors.validation_exception.ValidationException: <p>Input validation failed. Check your request parameters and retry the request.</p>
capo_bedrock.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_bedrock.types.put_organization_data_retention_storage_request.PutOrganizationDataRetentionStorageRequest]",
) -> AsyncOperationResponse[
"capo_bedrock.types.put_organization_data_retention_storage_response.PutOrganizationDataRetentionStorageResponse"
]:
import capo_bedrock._operations.amazon_bedrock_control_plane_service.put_organization_data_retention_storage
(
output,
http_response,
) = await capo_bedrock._operations.amazon_bedrock_control_plane_service.put_organization_data_retention_storage.async_put_organization_data_retention_storage(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("PutOrganizationDataRetentionStorage")
)
input_: capo_bedrock.types.put_organization_data_retention_storage_request.PutOrganizationDataRetentionStorageRequest = {
"model_provider": model_provider,
"storage_destination": storage_destination,
}
if storage_configuration is not None:
input_["storage_configuration"] = storage_configuration
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|