Skip to content

get_rate_based_rule_managed_keys

get_rate_based_rule_managed_keys(
    rule_id: ResourceId,
    *,
    config_overrides: Optional[WAFClientConfig] = None,
    next_marker: Optional[NextMarker] = None,
) -> GetRateBasedRuleManagedKeysResponse

This is AWS WAF Classic documentation. For more information, see AWS WAF Classic in the developer guide.

For the latest version of AWS WAF, use the AWS WAFV2 API and see the AWS WAF Developer Guide. With the latest version, AWS WAF has a single set of endpoints for regional and global use.

Returns an array of IP addresses currently being blocked by the RateBasedRule that is specified by the RuleId. The maximum number of managed keys that will be blocked is 10,000. If more than 10,000 addresses exceed the rate limit, the 10,000 addresses with the highest rates will be blocked.

Parameters:

Raises:

  • WAFInternalErrorException –

    The operation failed because of a system problem, even though the request was valid. Retry your request.

  • WAFInvalidAccountException –

    The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.

  • WAFInvalidParameterException –

    The operation failed because AWS WAF didn't recognize a parameter in the request. For example:

    • You specified an invalid parameter name.

    • You specified an invalid value.

    • You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL) using an action other than INSERT or DELETE.

    • You tried to create a WebACL with a DefaultAction Type other than ALLOW, BLOCK, or COUNT.

    • You tried to create a RateBasedRule with a RateKey value other than IP.

    • You tried to update a WebACL with a WafAction Type other than ALLOW, BLOCK, or COUNT.

    • You tried to update a ByteMatchSet with a FieldToMatch Type other than HEADER, METHOD, QUERY_STRING, URI, or BODY.

    • You tried to update a ByteMatchSet with a Field of HEADER but no value for Data.

    • Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL cannot be associated.

  • WAFNonexistentItemException –

    The operation failed because the referenced object doesn't exist.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_waf/_services/waf.py
def get_rate_based_rule_managed_keys(
    self,
    rule_id: "capo_waf.types.resource_id.ResourceId",
    *,
    config_overrides: Optional[WAFClientConfig] = None,
    next_marker: Optional["capo_waf.types.next_marker.NextMarker"] = None,
) -> "capo_waf.types.get_rate_based_rule_managed_keys_response.GetRateBasedRuleManagedKeysResponse":
    """<note> <p>This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS WAF Classic</a> in the developer guide.</p> <p> <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints for regional and global use. </p> </note> <p>Returns an array of IP addresses currently being blocked by the <a>RateBasedRule</a> that is specified by the <code>RuleId</code>. The maximum number of managed keys that will be blocked is 10,000. If more than 10,000 addresses exceed the rate limit, the 10,000 addresses with the highest rates will be blocked.</p>

    Args:
        rule_id: <p>The <code>RuleId</code> of the <a>RateBasedRule</a> for which you want to get a list of <code>ManagedKeys</code>. <code>RuleId</code> is returned by <a>CreateRateBasedRule</a> and by <a>ListRateBasedRules</a>.</p>
        next_marker: <p>A null value and not currently used. Do not include this in your request.</p>

    Raises:
        capo_waf.errors.waf_internal_error_exception.WAFInternalErrorException: <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
        capo_waf.errors.waf_invalid_account_exception.WAFInvalidAccountException: <p>The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.</p>
        capo_waf.errors.waf_invalid_parameter_exception.WAFInvalidParameterException: <p>The operation failed because AWS WAF didn't recognize a parameter in the request. For example:</p> <ul> <li> <p>You specified an invalid parameter name.</p> </li> <li> <p>You specified an invalid value.</p> </li> <li> <p>You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>, or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.</p> </li> <li> <p>You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code> other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.</p> </li> <li> <p>You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value other than <code>IP</code>.</p> </li> <li> <p>You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code> other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.</p> </li> <li> <p>You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code> other than HEADER, METHOD, QUERY_STRING, URI, or BODY.</p> </li> <li> <p>You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code> but no value for <code>Data</code>.</p> </li> <li> <p>Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL cannot be associated.</p> </li> </ul>
        capo_waf.errors.waf_nonexistent_item_exception.WAFNonexistentItemException: <p>The operation failed because the referenced object doesn't exist.</p>
        capo_waf.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_waf.types.get_rate_based_rule_managed_keys_request.GetRateBasedRuleManagedKeysRequest]",
    ) -> OperationResponse[
        "capo_waf.types.get_rate_based_rule_managed_keys_response.GetRateBasedRuleManagedKeysResponse"
    ]:
        import capo_waf._operations.awswaf_20150824.get_rate_based_rule_managed_keys

        output, http_response = (
            capo_waf._operations.awswaf_20150824.get_rate_based_rule_managed_keys.get_rate_based_rule_managed_keys(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetRateBasedRuleManagedKeys")
    )
    input_: capo_waf.types.get_rate_based_rule_managed_keys_request.GetRateBasedRuleManagedKeysRequest = {
        "rule_id": rule_id
    }
    if next_marker is not None:
        input_["next_marker"] = next_marker

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