Skip to content

update_snapshot_copy_configuration async

update_snapshot_copy_configuration(
    snapshot_copy_configuration_id: str,
    *,
    config_overrides: Optional[AsyncRedshiftServerlessClientConfig] = None,
    snapshot_retention_period: Optional[int] = None,
) -> UpdateSnapshotCopyConfigurationResponse

Updates a snapshot copy configuration.

Parameters:

  • snapshot_copy_configuration_id (str) –

    The ID of the snapshot copy configuration to update.

  • snapshot_retention_period (Optional[int], default: None ) –

    The new retention period of how long to keep a snapshot in the destination Amazon Web Services Region.

Raises:

Source code in docs_src/capo_redshift_serverless/_services/async_redshift_serverless.py
async def update_snapshot_copy_configuration(
    self,
    snapshot_copy_configuration_id: str,
    *,
    config_overrides: Optional[AsyncRedshiftServerlessClientConfig] = None,
    snapshot_retention_period: Optional[int] = None,
) -> "capo_redshift_serverless.types.update_snapshot_copy_configuration_response.UpdateSnapshotCopyConfigurationResponse":
    """<p>Updates a snapshot copy configuration.</p>

    Args:
        snapshot_copy_configuration_id: <p>The ID of the snapshot copy configuration to update.</p>
        snapshot_retention_period: <p>The new retention period of how long to keep a snapshot in the destination Amazon Web Services Region.</p>

    Raises:
        capo_redshift_serverless.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        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_snapshot_copy_configuration_request.UpdateSnapshotCopyConfigurationRequest]",
    ) -> AsyncOperationResponse[
        "capo_redshift_serverless.types.update_snapshot_copy_configuration_response.UpdateSnapshotCopyConfigurationResponse"
    ]:
        import capo_redshift_serverless._operations.redshift_serverless.update_snapshot_copy_configuration

        (
            output,
            http_response,
        ) = await capo_redshift_serverless._operations.redshift_serverless.update_snapshot_copy_configuration.async_update_snapshot_copy_configuration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateSnapshotCopyConfiguration")
    )
    input_: capo_redshift_serverless.types.update_snapshot_copy_configuration_request.UpdateSnapshotCopyConfigurationRequest = {
        "snapshot_copy_configuration_id": snapshot_copy_configuration_id
    }
    if snapshot_retention_period is not None:
        input_["snapshot_retention_period"] = snapshot_retention_period

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