Skip to content

export_serverless_cache_snapshot async

export_serverless_cache_snapshot(
    *,
    config_overrides: Optional[AsyncElastiCacheClientConfig] = None,
    serverless_cache_snapshot_name: Optional[String] = None,
    s3_bucket_name: Optional[String] = None,
) -> ExportServerlessCacheSnapshotResponse

Provides the functionality to export the serverless cache snapshot data to Amazon S3. Available for Valkey and Redis OSS only.

Parameters:

  • serverless_cache_snapshot_name (Optional[String], default: None ) –

    The identifier of the serverless cache snapshot to be exported to S3. Available for Valkey and Redis OSS only.

  • s3_bucket_name (Optional[String], default: None ) –

    Name of the Amazon S3 bucket to export the snapshot to. The Amazon S3 bucket must also be in same region as the snapshot. Available for Valkey and Redis OSS only.

Raises:

Source code in docs_src/capo_elasticache/_services/async_elasti_cache.py
async def export_serverless_cache_snapshot(
    self,
    *,
    config_overrides: Optional[AsyncElastiCacheClientConfig] = None,
    serverless_cache_snapshot_name: Optional[
        "capo_elasticache.types.string.String"
    ] = None,
    s3_bucket_name: Optional["capo_elasticache.types.string.String"] = None,
) -> "capo_elasticache.types.export_serverless_cache_snapshot_response.ExportServerlessCacheSnapshotResponse":
    """<p>Provides the functionality to export the serverless cache snapshot data to Amazon S3. Available for Valkey and Redis OSS only.</p>

    Args:
        serverless_cache_snapshot_name: <p>The identifier of the serverless cache snapshot to be exported to S3. Available for Valkey and Redis OSS only.</p>
        s3_bucket_name: <p>Name of the Amazon S3 bucket to export the snapshot to. The Amazon S3 bucket must also be in same region as the snapshot. Available for Valkey and Redis OSS only.</p>

    Raises:
        capo_elasticache.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value for a parameter is invalid.</p>
        capo_elasticache.errors.invalid_serverless_cache_snapshot_state_fault.InvalidServerlessCacheSnapshotStateFault: <p>The state of the serverless cache snapshot was not received. Available for Valkey, Redis OSS and Serverless Memcached only.</p>
        capo_elasticache.errors.serverless_cache_snapshot_not_found_fault.ServerlessCacheSnapshotNotFoundFault: <p>This serverless cache snapshot could not be found or does not exist. Available for Valkey, Redis OSS and Serverless Memcached only.</p>
        capo_elasticache.errors.service_linked_role_not_found_fault.ServiceLinkedRoleNotFoundFault: <p>The specified service linked role (SLR) was not found.</p>
        capo_elasticache.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_elasticache.types.export_serverless_cache_snapshot_request.ExportServerlessCacheSnapshotRequest]",
    ) -> AsyncOperationResponse[
        "capo_elasticache.types.export_serverless_cache_snapshot_response.ExportServerlessCacheSnapshotResponse"
    ]:
        import capo_elasticache._operations.amazon_elasti_cache_v9.export_serverless_cache_snapshot

        (
            output,
            http_response,
        ) = await capo_elasticache._operations.amazon_elasti_cache_v9.export_serverless_cache_snapshot.async_export_serverless_cache_snapshot(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ExportServerlessCacheSnapshot")
    )
    input_: capo_elasticache.types.export_serverless_cache_snapshot_request.ExportServerlessCacheSnapshotRequest = {}
    if serverless_cache_snapshot_name is not None:
        input_["serverless_cache_snapshot_name"] = serverless_cache_snapshot_name
    if s3_bucket_name is not None:
        input_["s3_bucket_name"] = s3_bucket_name

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