Skip to content

describe_cache_subnet_groups

describe_cache_subnet_groups(
    *,
    config_overrides: Optional[ElastiCacheClientConfig] = None,
    cache_subnet_group_name: Optional[String] = None,
    max_records: Optional[IntegerOptional] = None,
    marker: Optional[String] = None,
) -> CacheSubnetGroupMessage

Returns a list of cache subnet group descriptions. If a subnet group name is specified, the list contains only the description of that group. This is applicable only when you have ElastiCache in VPC setup. All ElastiCache clusters now launch in VPC by default.

Parameters:

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

    The name of the cache subnet group to return details for.

  • 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.

Raises:

Examples:

DescribeCacheSubnetGroups Describes up to 25 cache subnet groups.

>>> client.describe_cache_subnet_groups(max_records=25)
Source code in docs_src/capo_elasticache/_services/elasti_cache.py
def describe_cache_subnet_groups(
    self,
    *,
    config_overrides: Optional[ElastiCacheClientConfig] = None,
    cache_subnet_group_name: 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,
) -> "capo_elasticache.types.cache_subnet_group_message.CacheSubnetGroupMessage":
    """<p>Returns a list of cache subnet group descriptions. If a subnet group name is specified, the list contains only the description of that group. This is applicable only when you have ElastiCache in VPC setup. All ElastiCache clusters now launch in VPC by default. </p>

    Args:
        cache_subnet_group_name: <p>The name of the cache subnet group to return details for.</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>

    Raises:
        capo_elasticache.errors.cache_subnet_group_not_found_fault.CacheSubnetGroupNotFoundFault: <p>The requested cache subnet group name does not refer to an existing cache subnet group.</p>
        capo_elasticache.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        DescribeCacheSubnetGroups
        Describes up to 25 cache subnet groups.

        >>> client.describe_cache_subnet_groups(max_records=25)
    """

    def _handler(
        req: "OperationRequest[capo_elasticache.types.describe_cache_subnet_groups_message.DescribeCacheSubnetGroupsMessage]",
    ) -> OperationResponse[
        "capo_elasticache.types.cache_subnet_group_message.CacheSubnetGroupMessage"
    ]:
        import capo_elasticache._operations.amazon_elasti_cache_v9.describe_cache_subnet_groups

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeCacheSubnetGroups")
    )
    input_: capo_elasticache.types.describe_cache_subnet_groups_message.DescribeCacheSubnetGroupsMessage = {}
    if cache_subnet_group_name is not None:
        input_["cache_subnet_group_name"] = cache_subnet_group_name
    if max_records is not None:
        input_["max_records"] = max_records
    if marker is not None:
        input_["marker"] = marker

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