import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import type { UpdateRuleRequest, UpdateRuleResponse } from "../models/models_0"; /** * @public */ export type { __MetadataBearer }; /** * @public * * The input for {@link UpdateRuleCommand}. */ export interface UpdateRuleCommandInput extends UpdateRuleRequest { } /** * @public * * The output of {@link UpdateRuleCommand}. */ export interface UpdateRuleCommandOutput extends UpdateRuleResponse, __MetadataBearer { } declare const UpdateRuleCommand_base: { new (input: UpdateRuleCommandInput): import("@smithy/core/client").CommandImpl; new (input: UpdateRuleCommandInput): import("@smithy/core/client").CommandImpl; getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions; }; /** * *

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.

*
*

Inserts or deletes Predicate objects in a Rule. Each * Predicate object identifies a predicate, such as a ByteMatchSet or an IPSet, that specifies the web requests * that you want to allow, block, or count. If you add more than one predicate to a * Rule, a request must match all of the specifications to be allowed, * blocked, or counted. For example, suppose * that * you add the following to a Rule:

* *

You then add the Rule to a WebACL and specify that you want to block requests that satisfy the Rule. * For a request to be blocked, the User-Agent header in the request must contain the value BadBot * and the request must originate from the IP address 192.0.2.44.

*

To create and configure a Rule, perform the following steps:

*
    *
  1. *

    Create and update the predicates that you want to include in the Rule.

    *
  2. *
  3. *

    Create the Rule. See CreateRule.

    *
  4. *
  5. *

    Use GetChangeToken to get the change token that you provide in the ChangeToken parameter of an * UpdateRule request.

    *
  6. *
  7. *

    Submit an UpdateRule request to add predicates to the Rule.

    *
  8. *
  9. *

    Create and update a WebACL that contains the Rule. See CreateWebACL.

    *
  10. *
*

If you want to replace one ByteMatchSet or IPSet with another, you delete the existing one and * add the new one.

*

For more information about how to use the AWS WAF API to allow or block HTTP requests, see the * AWS WAF Developer Guide.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { WAFRegionalClient, UpdateRuleCommand } from "@aws-sdk/client-waf-regional"; // ES Modules import * // const { WAFRegionalClient, UpdateRuleCommand } = require("@aws-sdk/client-waf-regional"); // CommonJS import * // import type { WAFRegionalClientConfig } from "@aws-sdk/client-waf-regional"; * const config = {}; // type is WAFRegionalClientConfig * const client = new WAFRegionalClient(config); * const input = { // UpdateRuleRequest * RuleId: "STRING_VALUE", // required * ChangeToken: "STRING_VALUE", // required * Updates: [ // RuleUpdates // required * { // RuleUpdate * Action: "INSERT" || "DELETE", // required * Predicate: { // Predicate * Negated: true || false, // required * Type: "IPMatch" || "ByteMatch" || "SqlInjectionMatch" || "GeoMatch" || "SizeConstraint" || "XssMatch" || "RegexMatch", // required * DataId: "STRING_VALUE", // required * }, * }, * ], * }; * const command = new UpdateRuleCommand(input); * const response = await client.send(command); * // { // UpdateRuleResponse * // ChangeToken: "STRING_VALUE", * // }; * * ``` * * @param UpdateRuleCommandInput - {@link UpdateRuleCommandInput} * @returns {@link UpdateRuleCommandOutput} * @see {@link UpdateRuleCommandInput} for command's `input` shape. * @see {@link UpdateRuleCommandOutput} for command's `response` shape. * @see {@link WAFRegionalClientResolvedConfig | config} for WAFRegionalClient's `config` shape. * * @throws {@link WAFInternalErrorException} (server fault) *

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

* * @throws {@link WAFInvalidAccountException} (client fault) *

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

* * @throws {@link WAFInvalidOperationException} (client fault) *

The operation failed because there was nothing to do. For example:

* * * @throws {@link WAFInvalidParameterException} (client fault) *

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

* * * @throws {@link WAFLimitsExceededException} (client fault) *

The operation exceeds a resource limit, for example, the maximum number of WebACL objects that you can create * for an AWS account. For more information, see * Limits in the AWS WAF Developer Guide.

* * @throws {@link WAFNonexistentContainerException} (client fault) *

The operation failed because you tried to add an object to or delete an object from another object that doesn't exist. For example:

* * * @throws {@link WAFNonexistentItemException} (client fault) *

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

* * @throws {@link WAFReferencedItemException} (client fault) *

The operation failed because you tried to delete an object that is still in use. For example:

* * * @throws {@link WAFStaleDataException} (client fault) *

The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.

* * @throws {@link WAFRegionalServiceException} *

Base exception class for all service exceptions from WAFRegional service.

* * * @example To update a rule * ```javascript * // The following example deletes a Predicate object in a rule with the ID example1ds3t-46da-4fdb-b8d5-abc321j569j5. * const input = { * ChangeToken: "abcd12f2-46da-4fdb-b8d5-fbd4c466928f", * RuleId: "example1ds3t-46da-4fdb-b8d5-abc321j569j5", * Updates: [ * { * Action: "DELETE", * Predicate: { * DataId: "MyByteMatchSetID", * Negated: false, * Type: "ByteMatch" * } * } * ] * }; * const command = new UpdateRuleCommand(input); * const response = await client.send(command); * /* response is * { * ChangeToken: "abcd12f2-46da-4fdb-b8d5-fbd4c466928f" * } * *\/ * ``` * * @public */ export declare class UpdateRuleCommand extends UpdateRuleCommand_base { /** @internal type navigation helper, not in runtime. */ protected static __types: { api: { input: UpdateRuleRequest; output: UpdateRuleResponse; }; sdk: { input: UpdateRuleCommandInput; output: UpdateRuleCommandOutput; }; }; }