Skip to content

describe_cache_clusters

describe_cache_clusters(
    *,
    config_overrides: Optional[ElastiCacheClientConfig] = None,
    cache_cluster_id: Optional[String] = None,
    max_records: Optional[IntegerOptional] = None,
    marker: Optional[String] = None,
    show_cache_node_info: Optional[BooleanOptional] = None,
    show_cache_clusters_not_in_replication_groups: Optional[BooleanOptional] = None,
) -> CacheClusterMessage

Returns information about all provisioned clusters if no cluster identifier is specified, or about a specific cache cluster if a cluster identifier is supplied.

By default, abbreviated information about the clusters is returned. You can use the optional ShowCacheNodeInfo flag to retrieve detailed information about the cache nodes associated with the clusters. These details include the DNS address and port for the cache node endpoint.

If the cluster is in the creating state, only cluster-level information is displayed until all of the nodes are successfully provisioned.

If the cluster is in the deleting state, only cluster-level information is displayed.

If cache nodes are currently being added to the cluster, node endpoint information and creation time for the additional nodes are not displayed until they are completely provisioned. When the cluster state is available, the cluster is ready for use.

If cache nodes are currently being removed from the cluster, no endpoint information for the removed nodes is displayed.

Parameters:

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

    The user-supplied cluster identifier. If this parameter is specified, only information about that specific cluster is returned. This parameter isn't case sensitive.

  • max_records (Optional[IntegerOptional], default: None ) –

    The maximum number of records to include in the response. If more records exist than the specified MaxRecords value, a marker is included in the response so that the remaining results can be retrieved.

    Default: 100

    Constraints: minimum 20; maximum 100.

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

    An optional marker returned from a prior request. Use this marker for pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords.

  • show_cache_node_info (Optional[BooleanOptional], default: None ) –

    An optional flag that can be included in the DescribeCacheCluster request to retrieve information about the individual cache nodes.

  • show_cache_clusters_not_in_replication_groups (Optional[BooleanOptional], default: None ) –

    An optional flag that can be included in the DescribeCacheCluster request to show only nodes (API/CLI: clusters) that are not members of a replication group. In practice, this means Memcached and single node Valkey or Redis OSS clusters.

Raises:

Examples:

DescribeCacheClusters Lists the details for the cache cluster my-mem-cluster.

>>> client.describe_cache_clusters(cache_cluster_id='my-mem-cluster', show_cache_node_info=True)
DescribeCacheClusters
Lists the details for up to 50 cache clusters.
>>> client.describe_cache_clusters(cache_cluster_id='my-mem-cluster')
Source code in docs_src/capo_elasticache/_services/elasti_cache.py
def describe_cache_clusters(
    self,
    *,
    config_overrides: Optional[ElastiCacheClientConfig] = None,
    cache_cluster_id: Optional["capo_elasticache.types.string.String"] = None,
    max_records: Optional[
        "capo_elasticache.types.integer_optional.IntegerOptional"
    ] = None,
    marker: Optional["capo_elasticache.types.string.String"] = None,
    show_cache_node_info: Optional[
        "capo_elasticache.types.boolean_optional.BooleanOptional"
    ] = None,
    show_cache_clusters_not_in_replication_groups: Optional[
        "capo_elasticache.types.boolean_optional.BooleanOptional"
    ] = None,
) -> "capo_elasticache.types.cache_cluster_message.CacheClusterMessage":
    """<p>Returns information about all provisioned clusters if no cluster identifier is specified, or about a specific cache cluster if a cluster identifier is supplied.</p> <p>By default, abbreviated information about the clusters is returned. You can use the optional <i>ShowCacheNodeInfo</i> flag to retrieve detailed information about the cache nodes associated with the clusters. These details include the DNS address and port for the cache node endpoint.</p> <p>If the cluster is in the <i>creating</i> state, only cluster-level information is displayed until all of the nodes are successfully provisioned.</p> <p>If the cluster is in the <i>deleting</i> state, only cluster-level information is displayed.</p> <p>If cache nodes are currently being added to the cluster, node endpoint information and creation time for the additional nodes are not displayed until they are completely provisioned. When the cluster state is <i>available</i>, the cluster is ready for use.</p> <p>If cache nodes are currently being removed from the cluster, no endpoint information for the removed nodes is displayed.</p>

    Args:
        cache_cluster_id: <p>The user-supplied cluster identifier. If this parameter is specified, only information about that specific cluster is returned. This parameter isn't case sensitive.</p>
        max_records: <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a marker is included in the response so that the remaining results can be retrieved.</p> <p>Default: 100</p> <p>Constraints: minimum 20; maximum 100.</p>
        marker: <p>An optional marker returned from a prior request. Use this marker for pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
        show_cache_node_info: <p>An optional flag that can be included in the <code>DescribeCacheCluster</code> request to retrieve information about the individual cache nodes.</p>
        show_cache_clusters_not_in_replication_groups: <p>An optional flag that can be included in the <code>DescribeCacheCluster</code> request to show only nodes (API/CLI: clusters) that are not members of a replication group. In practice, this means Memcached and single node Valkey or Redis OSS clusters.</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_parameter_combination_exception.InvalidParameterCombinationException: <p>Two or more incompatible parameters were specified.</p>
        capo_elasticache.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value for a parameter is invalid.</p>
        capo_elasticache.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        DescribeCacheClusters
        Lists the details for the cache cluster my-mem-cluster.

        >>> client.describe_cache_clusters(cache_cluster_id='my-mem-cluster', show_cache_node_info=True)
        DescribeCacheClusters
        Lists the details for up to 50 cache clusters.

        >>> client.describe_cache_clusters(cache_cluster_id='my-mem-cluster')
    """

    def _handler(
        req: "OperationRequest[capo_elasticache.types.describe_cache_clusters_message.DescribeCacheClustersMessage]",
    ) -> OperationResponse[
        "capo_elasticache.types.cache_cluster_message.CacheClusterMessage"
    ]:
        import capo_elasticache._operations.amazon_elasti_cache_v9.describe_cache_clusters

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeCacheClusters")
    )
    input_: capo_elasticache.types.describe_cache_clusters_message.DescribeCacheClustersMessage = {}
    if cache_cluster_id is not None:
        input_["cache_cluster_id"] = cache_cluster_id
    if max_records is not None:
        input_["max_records"] = max_records
    if marker is not None:
        input_["marker"] = marker
    if show_cache_node_info is not None:
        input_["show_cache_node_info"] = show_cache_node_info
    if show_cache_clusters_not_in_replication_groups is not None:
        input_["show_cache_clusters_not_in_replication_groups"] = (
            show_cache_clusters_not_in_replication_groups
        )

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