Skip to content

reboot_cache_cluster

reboot_cache_cluster(
    *,
    config_overrides: Optional[ElastiCacheClientConfig] = None,
    cache_cluster_id: Optional[String] = None,
    cache_node_ids_to_reboot: Optional[CacheNodeIdsList] = None,
) -> RebootCacheClusterResult

Reboots some, or all, of the cache nodes within a provisioned cluster. This operation applies any modified cache parameter groups to the cluster. The reboot operation takes place as soon as possible, and results in a momentary outage to the cluster. During the reboot, the cluster status is set to REBOOTING.

The reboot causes the contents of the cache (for each cache node being rebooted) to be lost.

When the reboot is complete, a cluster event is created.

Rebooting a cluster is currently supported on Memcached, Valkey and Redis OSS (cluster mode disabled) clusters. Rebooting is not supported on Valkey or Redis OSS (cluster mode enabled) clusters.

If you make changes to parameters that require a Valkey or Redis OSS (cluster mode enabled) cluster reboot for the changes to be applied, see Rebooting a Cluster for an alternate process.

Parameters:

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

    The cluster identifier. This parameter is stored as a lowercase string.

  • cache_node_ids_to_reboot (Optional[CacheNodeIdsList], default: None ) –

    A list of cache node IDs to reboot. A node ID is a numeric identifier (0001, 0002, etc.). To reboot an entire cluster, specify all of the cache node IDs.

Raises:

Examples:

RebootCacheCluster Reboots the specified nodes in the names cluster.

>>> client.reboot_cache_cluster(cache_cluster_id='custom-mem1-4  ', cache_node_ids_to_reboot=['0001', '0002'])
Source code in docs_src/capo_elasticache/_services/elasti_cache.py
def reboot_cache_cluster(
    self,
    *,
    config_overrides: Optional[ElastiCacheClientConfig] = None,
    cache_cluster_id: Optional["capo_elasticache.types.string.String"] = None,
    cache_node_ids_to_reboot: Optional[
        "capo_elasticache.types.cache_node_ids_list.CacheNodeIdsList"
    ] = None,
) -> "capo_elasticache.types.reboot_cache_cluster_result.RebootCacheClusterResult":
    """<p>Reboots some, or all, of the cache nodes within a provisioned cluster. This operation applies any modified cache parameter groups to the cluster. The reboot operation takes place as soon as possible, and results in a momentary outage to the cluster. During the reboot, the cluster status is set to REBOOTING.</p> <p>The reboot causes the contents of the cache (for each cache node being rebooted) to be lost.</p> <p>When the reboot is complete, a cluster event is created.</p> <p>Rebooting a cluster is currently supported on Memcached, Valkey and Redis OSS (cluster mode disabled) clusters. Rebooting is not supported on Valkey or Redis OSS (cluster mode enabled) clusters.</p> <p>If you make changes to parameters that require a Valkey or Redis OSS (cluster mode enabled) cluster reboot for the changes to be applied, see <a href="http://docs.aws.amazon.com/AmazonElastiCache/latest/dg/nodes.rebooting.html">Rebooting a Cluster</a> for an alternate process.</p>

    Args:
        cache_cluster_id: <p>The cluster identifier. This parameter is stored as a lowercase string.</p>
        cache_node_ids_to_reboot: <p>A list of cache node IDs to reboot. A node ID is a numeric identifier (0001, 0002, etc.). To reboot an entire cluster, specify all of the cache node IDs.</p>

    Raises:
        capo_elasticache.errors.cache_cluster_not_found_fault.CacheClusterNotFoundFault: <p>The requested cluster ID does not refer to an existing cluster.</p>
        capo_elasticache.errors.invalid_cache_cluster_state_fault.InvalidCacheClusterStateFault: <p>The requested cluster is not in the <code>available</code> state.</p>
        capo_elasticache.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        RebootCacheCluster
        Reboots the specified nodes in the names cluster.

        >>> client.reboot_cache_cluster(cache_cluster_id='custom-mem1-4  ', cache_node_ids_to_reboot=['0001', '0002'])
    """

    def _handler(
        req: "OperationRequest[capo_elasticache.types.reboot_cache_cluster_message.RebootCacheClusterMessage]",
    ) -> OperationResponse[
        "capo_elasticache.types.reboot_cache_cluster_result.RebootCacheClusterResult"
    ]:
        import capo_elasticache._operations.amazon_elasti_cache_v9.reboot_cache_cluster

        output, http_response = (
            capo_elasticache._operations.amazon_elasti_cache_v9.reboot_cache_cluster.reboot_cache_cluster(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RebootCacheCluster")
    )
    input_: capo_elasticache.types.reboot_cache_cluster_message.RebootCacheClusterMessage = {}
    if cache_cluster_id is not None:
        input_["cache_cluster_id"] = cache_cluster_id
    if cache_node_ids_to_reboot is not None:
        input_["cache_node_ids_to_reboot"] = cache_node_ids_to_reboot

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output