Skip to content

describe_usage_limits

describe_usage_limits(
    *,
    config_overrides: Optional[RedshiftClientConfig] = None,
    usage_limit_id: Optional[String] = None,
    cluster_identifier: Optional[String] = None,
    feature_type: Optional[UsageLimitFeatureType] = None,
    max_records: Optional[IntegerOptional] = None,
    marker: Optional[String] = None,
    tag_keys: Optional[TagKeyList] = None,
    tag_values: Optional[TagValueList] = None,
) -> UsageLimitList

Shows usage limits on a cluster. Results are filtered based on the combination of input usage limit identifier, cluster identifier, and feature type parameters:

  • If usage limit identifier, cluster identifier, and feature type are not provided, then all usage limit objects for the current account in the current region are returned.

  • If usage limit identifier is provided, then the corresponding usage limit object is returned.

  • If cluster identifier is provided, then all usage limit objects for the specified cluster are returned.

  • If cluster identifier and feature type are provided, then all usage limit objects for the combination of cluster and feature are returned.

Parameters:

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

    The identifier of the usage limit to describe.

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

    The identifier of the cluster for which you want to describe usage limits.

  • feature_type (Optional[UsageLimitFeatureType], default: None ) –

    The feature type for which you want to describe usage limits.

  • 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 DescribeUsageLimits 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 usage limit objects that are associated with the specified key or keys. For example, suppose that you have parameter 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 usage limit objects 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 usage limit objects that are associated with the specified tag value or values. For example, suppose that you have parameter 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 usage limit objects 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_usage_limits(
    self,
    *,
    config_overrides: Optional[RedshiftClientConfig] = None,
    usage_limit_id: Optional["capo_redshift.types.string.String"] = None,
    cluster_identifier: Optional["capo_redshift.types.string.String"] = None,
    feature_type: Optional[
        "capo_redshift.types.usage_limit_feature_type.UsageLimitFeatureType"
    ] = 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.usage_limit_list.UsageLimitList":
    """<p>Shows usage limits on a cluster. Results are filtered based on the combination of input usage limit identifier, cluster identifier, and feature type parameters:</p> <ul> <li> <p>If usage limit identifier, cluster identifier, and feature type are not provided, then all usage limit objects for the current account in the current region are returned.</p> </li> <li> <p>If usage limit identifier is provided, then the corresponding usage limit object is returned.</p> </li> <li> <p>If cluster identifier is provided, then all usage limit objects for the specified cluster are returned.</p> </li> <li> <p>If cluster identifier and feature type are provided, then all usage limit objects for the combination of cluster and feature are returned.</p> </li> </ul>

    Args:
        usage_limit_id: <p>The identifier of the usage limit to describe.</p>
        cluster_identifier: <p>The identifier of the cluster for which you want to describe usage limits.</p>
        feature_type: <p>The feature type for which you want to describe usage limits.</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>DescribeUsageLimits</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 usage limit objects that are associated with the specified key or keys. For example, suppose that you have parameter 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 usage limit objects 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 usage limit objects that are associated with the specified tag value or values. For example, suppose that you have parameter 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 usage limit objects that have either or both of these tag values associated with them.</p>

    Raises:
        capo_redshift.errors.cluster_not_found_fault.ClusterNotFoundFault: <p>The <code>ClusterIdentifier</code> parameter does not refer to an existing cluster. </p>
        capo_redshift.errors.unsupported_operation_fault.UnsupportedOperationFault: <p>The requested operation isn't supported.</p>
        capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_redshift.types.describe_usage_limits_message.DescribeUsageLimitsMessage]",
    ) -> OperationResponse["capo_redshift.types.usage_limit_list.UsageLimitList"]:
        import capo_redshift._operations.redshift_service_version20121201.describe_usage_limits

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeUsageLimits")
    )
    input_: capo_redshift.types.describe_usage_limits_message.DescribeUsageLimitsMessage = {}
    if usage_limit_id is not None:
        input_["usage_limit_id"] = usage_limit_id
    if cluster_identifier is not None:
        input_["cluster_identifier"] = cluster_identifier
    if feature_type is not None:
        input_["feature_type"] = feature_type
    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