Skip to content

describe_cluster_subnet_groups

describe_cluster_subnet_groups(
    *,
    config_overrides: Optional[RedshiftClientConfig] = None,
    cluster_subnet_group_name: Optional[String] = None,
    max_records: Optional[IntegerOptional] = None,
    marker: Optional[String] = None,
    tag_keys: Optional[TagKeyList] = None,
    tag_values: Optional[TagValueList] = None,
) -> ClusterSubnetGroupMessage

Returns one or more cluster subnet group objects, which contain metadata about your cluster subnet groups. By default, this operation returns information about all cluster subnet groups that are defined in your Amazon Web Services account.

If you specify both tag keys and tag values in the same request, Amazon Redshift returns all subnet groups that match any combination of the specified keys and values. For example, if you have owner and environment for tag keys, and admin and test for tag values, all subnet groups that have any combination of those values are returned.

If both tag keys and values are omitted from the request, subnet groups are returned regardless of whether they have tag keys or values associated with them.

Parameters:

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

    The name of the cluster subnet group for which information is requested.

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

    The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified MaxRecords value, a value is returned in a marker field of the response. You can retrieve the next set of records by retrying the command with the returned marker value.

    Default: 100

    Constraints: minimum 20, maximum 100.

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

    An optional parameter that specifies the starting point to return a set of response records. When the results of a DescribeClusterSubnetGroups request exceed the value specified in MaxRecords, Amazon Web Services returns a value in the Marker field of the response. You can retrieve the next set of response records by providing the returned marker value in the Marker parameter and retrying the request.

  • tag_keys (Optional[TagKeyList], default: None ) –

    A tag key or keys for which you want to return all matching cluster subnet groups that are associated with the specified key or keys. For example, suppose that you have subnet groups that are tagged with keys called owner and environment. If you specify both of these tag keys in the request, Amazon Redshift returns a response with the subnet groups that have either or both of these tag keys associated with them.

  • tag_values (Optional[TagValueList], default: None ) –

    A tag value or values for which you want to return all matching cluster subnet groups that are associated with the specified tag value or values. For example, suppose that you have subnet groups that are tagged with values called admin and test. If you specify both of these tag values in the request, Amazon Redshift returns a response with the subnet groups that have either or both of these tag values associated with them.

Raises:

Source code in docs_src/capo_redshift/_services/redshift.py
def describe_cluster_subnet_groups(
    self,
    *,
    config_overrides: Optional[RedshiftClientConfig] = None,
    cluster_subnet_group_name: Optional["capo_redshift.types.string.String"] = None,
    max_records: Optional[
        "capo_redshift.types.integer_optional.IntegerOptional"
    ] = None,
    marker: Optional["capo_redshift.types.string.String"] = None,
    tag_keys: Optional["capo_redshift.types.tag_key_list.TagKeyList"] = None,
    tag_values: Optional["capo_redshift.types.tag_value_list.TagValueList"] = None,
) -> "capo_redshift.types.cluster_subnet_group_message.ClusterSubnetGroupMessage":
    """<p>Returns one or more cluster subnet group objects, which contain metadata about your cluster subnet groups. By default, this operation returns information about all cluster subnet groups that are defined in your Amazon Web Services account.</p> <p>If you specify both tag keys and tag values in the same request, Amazon Redshift returns all subnet groups that match any combination of the specified keys and values. For example, if you have <code>owner</code> and <code>environment</code> for tag keys, and <code>admin</code> and <code>test</code> for tag values, all subnet groups that have any combination of those values are returned.</p> <p>If both tag keys and values are omitted from the request, subnet groups are returned regardless of whether they have tag keys or values associated with them.</p>

    Args:
        cluster_subnet_group_name: <p>The name of the cluster subnet group for which information is requested.</p>
        max_records: <p>The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified <code>MaxRecords</code> value, a value is returned in a <code>marker</code> field of the response. You can retrieve the next set of records by retrying the command with the returned marker value. </p> <p>Default: <code>100</code> </p> <p>Constraints: minimum 20, maximum 100.</p>
        marker: <p>An optional parameter that specifies the starting point to return a set of response records. When the results of a <a>DescribeClusterSubnetGroups</a> request exceed the value specified in <code>MaxRecords</code>, Amazon Web Services returns a value in the <code>Marker</code> field of the response. You can retrieve the next set of response records by providing the returned marker value in the <code>Marker</code> parameter and retrying the request. </p>
        tag_keys: <p>A tag key or keys for which you want to return all matching cluster subnet groups that are associated with the specified key or keys. For example, suppose that you have subnet groups that are tagged with keys called <code>owner</code> and <code>environment</code>. If you specify both of these tag keys in the request, Amazon Redshift returns a response with the subnet groups that have either or both of these tag keys associated with them.</p>
        tag_values: <p>A tag value or values for which you want to return all matching cluster subnet groups that are associated with the specified tag value or values. For example, suppose that you have subnet groups that are tagged with values called <code>admin</code> and <code>test</code>. If you specify both of these tag values in the request, Amazon Redshift returns a response with the subnet groups that have either or both of these tag values associated with them.</p>

    Raises:
        capo_redshift.errors.cluster_subnet_group_not_found_fault.ClusterSubnetGroupNotFoundFault: <p>The cluster subnet group name does not refer to an existing cluster subnet group.</p>
        capo_redshift.errors.invalid_tag_fault.InvalidTagFault: <p>The tag is invalid.</p>
        capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_redshift.types.describe_cluster_subnet_groups_message.DescribeClusterSubnetGroupsMessage]",
    ) -> OperationResponse[
        "capo_redshift.types.cluster_subnet_group_message.ClusterSubnetGroupMessage"
    ]:
        import capo_redshift._operations.redshift_service_version20121201.describe_cluster_subnet_groups

        output, http_response = (
            capo_redshift._operations.redshift_service_version20121201.describe_cluster_subnet_groups.describe_cluster_subnet_groups(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeClusterSubnetGroups")
    )
    input_: capo_redshift.types.describe_cluster_subnet_groups_message.DescribeClusterSubnetGroupsMessage = {}
    if cluster_subnet_group_name is not None:
        input_["cluster_subnet_group_name"] = cluster_subnet_group_name
    if max_records is not None:
        input_["max_records"] = max_records
    if marker is not None:
        input_["marker"] = marker
    if tag_keys is not None:
        input_["tag_keys"] = tag_keys
    if tag_values is not None:
        input_["tag_values"] = tag_values

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