# Rules ## Create an account or zone ruleset rule `client.Rulesets.Rules.New(ctx, rulesetID, params) (*RuleNewResponse, error)` **post** `/{accounts_or_zones}/{account_or_zone_id}/rulesets/{ruleset_id}/rules` Adds a new rule to an account or zone ruleset. The rule will be added to the end of the existing list of rules in the ruleset by default. ### Parameters - `rulesetID string` The unique ID of the ruleset. - `params RuleNewParams` - `AccountID param.Field[string]` Path param: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. - `ZoneID param.Field[string]` Path param: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. - `ID param.Field[string]` Body param: The unique ID of the rule. - `Action param.Field[RuleNewParamsBlockRuleAction]` Body param: The action to perform when the rule matches. - `const RuleNewParamsBlockRuleActionBlock RuleNewParamsBlockRuleAction = "block"` - `ActionParameters param.Field[RuleNewParamsBlockRuleActionParameters]` Body param: The parameters configuring the rule's action. - `Response RuleNewParamsBlockRuleActionParametersResponse` The response to show when the block is applied. - `Content string` The content to return. - `ContentType string` The type of the content to return. - `StatusCode int64` The status code to return. - `Description param.Field[string]` Body param: An informative description of the rule. - `Enabled param.Field[bool]` Body param: Whether the rule should be executed. - `ExposedCredentialCheck param.Field[RuleNewParamsBlockRuleExposedCredentialCheck]` Body param: Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression param.Field[string]` Body param: The expression defining which traffic will match the rule. - `Logging param.Field[Logging]` Body param: An object configuring the rule's logging behavior. - `Position param.Field[RuleNewParamsBlockRulePosition]` Body param: An object configuring where the rule will be placed. - `RuleNewParamsBlockRulePositionBeforePosition` - `Before string` The ID of another rule to place the rule before. An empty value causes the rule to be placed at the top. - `RuleNewParamsBlockRulePositionAfterPosition` - `After string` The ID of another rule to place the rule after. An empty value causes the rule to be placed at the bottom. - `RuleNewParamsBlockRulePositionIndexPosition` - `Index int64` An index at which to place the rule, where index 1 is the first rule. - `Ratelimit param.Field[RuleNewParamsBlockRuleRatelimit]` Body param: An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref param.Field[string]` Body param: The reference of the rule (the rule's ID by default). ### Returns - `type RuleNewResponse struct{…}` A ruleset object. - `ID string` The unique ID of the ruleset. - `Kind Kind` The kind of the ruleset. - `const KindManaged Kind = "managed"` - `const KindCustom Kind = "custom"` - `const KindRoot Kind = "root"` - `const KindZone Kind = "zone"` - `LastUpdated Time` The timestamp of when the ruleset was last modified. - `Name string` The human-readable name of the ruleset. - `Phase Phase` The phase of the ruleset. - `const PhaseDDoSL4 Phase = "ddos_l4"` - `const PhaseDDoSL7 Phase = "ddos_l7"` - `const PhaseHTTPConfigSettings Phase = "http_config_settings"` - `const PhaseHTTPCustomErrors Phase = "http_custom_errors"` - `const PhaseHTTPLogCustomFields Phase = "http_log_custom_fields"` - `const PhaseHTTPRatelimit Phase = "http_ratelimit"` - `const PhaseHTTPRequestCacheSettings Phase = "http_request_cache_settings"` - `const PhaseHTTPRequestDynamicRedirect Phase = "http_request_dynamic_redirect"` - `const PhaseHTTPRequestFirewallCustom Phase = "http_request_firewall_custom"` - `const PhaseHTTPRequestFirewallManaged Phase = "http_request_firewall_managed"` - `const PhaseHTTPRequestLateTransform Phase = "http_request_late_transform"` - `const PhaseHTTPRequestOrigin Phase = "http_request_origin"` - `const PhaseHTTPRequestRedirect Phase = "http_request_redirect"` - `const PhaseHTTPRequestSanitize Phase = "http_request_sanitize"` - `const PhaseHTTPRequestSBFM Phase = "http_request_sbfm"` - `const PhaseHTTPRequestTransform Phase = "http_request_transform"` - `const PhaseHTTPResponseCacheSettings Phase = "http_response_cache_settings"` - `const PhaseHTTPResponseCompression Phase = "http_response_compression"` - `const PhaseHTTPResponseFirewallManaged Phase = "http_response_firewall_managed"` - `const PhaseHTTPResponseHeadersTransform Phase = "http_response_headers_transform"` - `const PhaseMagicTransit Phase = "magic_transit"` - `const PhaseMagicTransitIDsManaged Phase = "magic_transit_ids_managed"` - `const PhaseMagicTransitManaged Phase = "magic_transit_managed"` - `const PhaseMagicTransitRatelimit Phase = "magic_transit_ratelimit"` - `Rules []RuleNewResponseRule` The list of rules in the ruleset. - `type BlockRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action BlockRuleAction` The action to perform when the rule matches. - `const BlockRuleActionBlock BlockRuleAction = "block"` - `ActionParameters BlockRuleActionParameters` The parameters configuring the rule's action. - `Response BlockRuleActionParametersResponse` The response to show when the block is applied. - `Content string` The content to return. - `ContentType string` The type of the content to return. - `StatusCode int64` The status code to return. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck BlockRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Enabled bool` Whether to generate a log when the rule matches. - `Ratelimit BlockRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type RuleNewResponseRulesRulesetsChallengeRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RuleNewResponseRulesRulesetsChallengeRuleAction` The action to perform when the rule matches. - `const RuleNewResponseRulesRulesetsChallengeRuleActionChallenge RuleNewResponseRulesRulesetsChallengeRuleAction = "challenge"` - `ActionParameters unknown` The parameters configuring the rule's action. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RuleNewResponseRulesRulesetsChallengeRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit RuleNewResponseRulesRulesetsChallengeRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type CompressResponseRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action CompressResponseRuleAction` The action to perform when the rule matches. - `const CompressResponseRuleActionCompressResponse CompressResponseRuleAction = "compress_response"` - `ActionParameters CompressResponseRuleActionParameters` The parameters configuring the rule's action. - `Algorithms []CompressResponseRuleActionParametersAlgorithm` Custom order for compression algorithms. - `Name CompressResponseRuleActionParametersAlgorithmsName` Name of the compression algorithm to enable. - `const CompressResponseRuleActionParametersAlgorithmsNameNone CompressResponseRuleActionParametersAlgorithmsName = "none"` - `const CompressResponseRuleActionParametersAlgorithmsNameAuto CompressResponseRuleActionParametersAlgorithmsName = "auto"` - `const CompressResponseRuleActionParametersAlgorithmsNameDefault CompressResponseRuleActionParametersAlgorithmsName = "default"` - `const CompressResponseRuleActionParametersAlgorithmsNameGzip CompressResponseRuleActionParametersAlgorithmsName = "gzip"` - `const CompressResponseRuleActionParametersAlgorithmsNameBrotli CompressResponseRuleActionParametersAlgorithmsName = "brotli"` - `const CompressResponseRuleActionParametersAlgorithmsNameZstd CompressResponseRuleActionParametersAlgorithmsName = "zstd"` - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck CompressResponseRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit CompressResponseRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type DDoSDynamicRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action DDoSDynamicRuleAction` The action to perform when the rule matches. - `const DDoSDynamicRuleActionDDoSDynamic DDoSDynamicRuleAction = "ddos_dynamic"` - `ActionParameters unknown` The parameters configuring the rule's action. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck DDoSDynamicRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit DDoSDynamicRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type ExecuteRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action ExecuteRuleAction` The action to perform when the rule matches. - `const ExecuteRuleActionExecute ExecuteRuleAction = "execute"` - `ActionParameters ExecuteRuleActionParameters` The parameters configuring the rule's action. - `ID string` The ID of the ruleset to execute. - `MatchedData ExecuteRuleActionParametersMatchedData` The configuration to use for matched data logging. - `PublicKey string` The public key to encrypt matched data logs with. - `Overrides ExecuteRuleActionParametersOverrides` A set of overrides to apply to the target ruleset. - `Action string` An action to override all rules with. This option has lower precedence than rule and category overrides. - `Categories []ExecuteRuleActionParametersOverridesCategory` A list of category-level overrides. This option has the second-highest precedence after rule-level overrides. - `Category string` The name of the category to override. - `Action string` The action to override rules in the category with. - `Enabled bool` Whether to enable execution of rules in the category. - `SensitivityLevel ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel` The sensitivity level to use for rules in the category. This option is only applicable for DDoS phases. - `const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"` - `const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"` - `const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"` - `const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"` - `Enabled bool` Whether to enable execution of all rules. This option has lower precedence than rule and category overrides. - `Rules []ExecuteRuleActionParametersOverridesRule` A list of rule-level overrides. This option has the highest precedence. - `ID string` The ID of the rule to override. - `Action string` The action to override the rule with. - `Enabled bool` Whether to enable execution of the rule. - `ScoreThreshold int64` The score threshold to use for the rule. - `SensitivityLevel ExecuteRuleActionParametersOverridesRulesSensitivityLevel` The sensitivity level to use for the rule. This option is only applicable for DDoS phases. - `const ExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"` - `const ExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"` - `const ExecuteRuleActionParametersOverridesRulesSensitivityLevelLow ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"` - `const ExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"` - `SensitivityLevel ExecuteRuleActionParametersOverridesSensitivityLevel` A sensitivity level to set for all rules. This option has lower precedence than rule and category overrides and is only applicable for DDoS phases. - `const ExecuteRuleActionParametersOverridesSensitivityLevelDefault ExecuteRuleActionParametersOverridesSensitivityLevel = "default"` - `const ExecuteRuleActionParametersOverridesSensitivityLevelMedium ExecuteRuleActionParametersOverridesSensitivityLevel = "medium"` - `const ExecuteRuleActionParametersOverridesSensitivityLevelLow ExecuteRuleActionParametersOverridesSensitivityLevel = "low"` - `const ExecuteRuleActionParametersOverridesSensitivityLevelEoff ExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"` - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck ExecuteRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit ExecuteRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type ForceConnectionCloseRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action ForceConnectionCloseRuleAction` The action to perform when the rule matches. - `const ForceConnectionCloseRuleActionForceConnectionClose ForceConnectionCloseRuleAction = "force_connection_close"` - `ActionParameters unknown` The parameters configuring the rule's action. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck ForceConnectionCloseRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit ForceConnectionCloseRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type RuleNewResponseRulesRulesetsJSChallengeRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RuleNewResponseRulesRulesetsJSChallengeRuleAction` The action to perform when the rule matches. - `const RuleNewResponseRulesRulesetsJSChallengeRuleActionJSChallenge RuleNewResponseRulesRulesetsJSChallengeRuleAction = "js_challenge"` - `ActionParameters unknown` The parameters configuring the rule's action. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RuleNewResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit RuleNewResponseRulesRulesetsJSChallengeRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type LogRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action LogRuleAction` The action to perform when the rule matches. - `const LogRuleActionLog LogRuleAction = "log"` - `ActionParameters unknown` The parameters configuring the rule's action. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck LogRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit LogRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type LogCustomFieldRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action LogCustomFieldRuleAction` The action to perform when the rule matches. - `const LogCustomFieldRuleActionLogCustomField LogCustomFieldRuleAction = "log_custom_field"` - `ActionParameters LogCustomFieldRuleActionParameters` The parameters configuring the rule's action. - `CookieFields []LogCustomFieldRuleActionParametersCookieField` The cookie fields to log. - `Name string` The name of the cookie. - `RawResponseFields []LogCustomFieldRuleActionParametersRawResponseField` The raw response fields to log. - `Name string` The name of the response header. - `PreserveDuplicates bool` Whether to log duplicate values of the same header. - `RequestFields []LogCustomFieldRuleActionParametersRequestField` The raw request fields to log. - `Name string` The name of the header. - `ResponseFields []LogCustomFieldRuleActionParametersResponseField` The transformed response fields to log. - `Name string` The name of the response header. - `PreserveDuplicates bool` Whether to log duplicate values of the same header. - `TransformedRequestFields []LogCustomFieldRuleActionParametersTransformedRequestField` The transformed request fields to log. - `Name string` The name of the header. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck LogCustomFieldRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit LogCustomFieldRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type ManagedChallengeRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action ManagedChallengeRuleAction` The action to perform when the rule matches. - `const ManagedChallengeRuleActionManagedChallenge ManagedChallengeRuleAction = "managed_challenge"` - `ActionParameters unknown` The parameters configuring the rule's action. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck ManagedChallengeRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit ManagedChallengeRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type RedirectRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RedirectRuleAction` The action to perform when the rule matches. - `const RedirectRuleActionRedirect RedirectRuleAction = "redirect"` - `ActionParameters RedirectRuleActionParameters` The parameters configuring the rule's action. - `FromList RedirectRuleActionParametersFromList` A redirect based on a bulk list lookup. - `Key string` An expression that evaluates to the list lookup key. - `Name string` The name of the list to match against. - `FromValue RedirectRuleActionParametersFromValue` A redirect based on the request properties. - `TargetURL RedirectRuleActionParametersFromValueTargetURL` A URL to redirect the request to. - `Expression string` An expression that evaluates to a URL to redirect the request to. - `Value string` A URL to redirect the request to. - `PreserveQueryString bool` Whether to keep the query string of the original request. - `StatusCode RedirectRuleActionParametersFromValueStatusCode` The status code to use for the redirect. - `const RedirectRuleActionParametersFromValueStatusCode301 RedirectRuleActionParametersFromValueStatusCode = 301` - `const RedirectRuleActionParametersFromValueStatusCode302 RedirectRuleActionParametersFromValueStatusCode = 302` - `const RedirectRuleActionParametersFromValueStatusCode303 RedirectRuleActionParametersFromValueStatusCode = 303` - `const RedirectRuleActionParametersFromValueStatusCode307 RedirectRuleActionParametersFromValueStatusCode = 307` - `const RedirectRuleActionParametersFromValueStatusCode308 RedirectRuleActionParametersFromValueStatusCode = 308` - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RedirectRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit RedirectRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type RewriteRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RewriteRuleAction` The action to perform when the rule matches. - `const RewriteRuleActionRewrite RewriteRuleAction = "rewrite"` - `ActionParameters RewriteRuleActionParameters` The parameters configuring the rule's action. - `Headers map[string, RewriteRuleActionParametersHeader]` A map of headers to rewrite. - `type RewriteRuleActionParametersHeadersAddStaticHeader struct{…}` A header with a static value to add. - `Operation RewriteRuleActionParametersHeadersAddStaticHeaderOperation` The operation to perform on the header. - `const RewriteRuleActionParametersHeadersAddStaticHeaderOperationAdd RewriteRuleActionParametersHeadersAddStaticHeaderOperation = "add"` - `Value string` A static value for the header. - `type RewriteRuleActionParametersHeadersAddDynamicHeader struct{…}` A header with a dynamic value to add. - `Expression string` An expression that evaluates to a value for the header. - `Operation RewriteRuleActionParametersHeadersAddDynamicHeaderOperation` The operation to perform on the header. - `const RewriteRuleActionParametersHeadersAddDynamicHeaderOperationAdd RewriteRuleActionParametersHeadersAddDynamicHeaderOperation = "add"` - `type RewriteRuleActionParametersHeadersSetStaticHeader struct{…}` A header with a static value to set. - `Operation RewriteRuleActionParametersHeadersSetStaticHeaderOperation` The operation to perform on the header. - `const RewriteRuleActionParametersHeadersSetStaticHeaderOperationSet RewriteRuleActionParametersHeadersSetStaticHeaderOperation = "set"` - `Value string` A static value for the header. - `type RewriteRuleActionParametersHeadersSetDynamicHeader struct{…}` A header with a dynamic value to set. - `Expression string` An expression that evaluates to a value for the header. - `Operation RewriteRuleActionParametersHeadersSetDynamicHeaderOperation` The operation to perform on the header. - `const RewriteRuleActionParametersHeadersSetDynamicHeaderOperationSet RewriteRuleActionParametersHeadersSetDynamicHeaderOperation = "set"` - `type RewriteRuleActionParametersHeadersRemoveHeader struct{…}` A header to remove. - `Operation RewriteRuleActionParametersHeadersRemoveHeaderOperation` The operation to perform on the header. - `const RewriteRuleActionParametersHeadersRemoveHeaderOperationRemove RewriteRuleActionParametersHeadersRemoveHeaderOperation = "remove"` - `URI RewriteRuleActionParametersURI` A URI path rewrite. - `type RewriteRuleActionParametersURIURIPath struct{…}` A URI path rewrite. - `Path RewriteRuleActionParametersURIURIPathPath` A URI path rewrite. - `Expression string` An expression that evaluates to a value to rewrite the URI path to. - `Value string` A value to rewrite the URI path to. - `Origin bool` Whether to propagate the rewritten URI to origin. - `type RewriteRuleActionParametersURIURIQuery struct{…}` A URI query rewrite. - `Query RewriteRuleActionParametersURIURIQueryQuery` A URI query rewrite. - `Expression string` An expression that evaluates to a value to rewrite the URI query to. - `Value string` A value to rewrite the URI query to. - `Origin bool` Whether to propagate the rewritten URI to origin. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RewriteRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit RewriteRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type RouteRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RouteRuleAction` The action to perform when the rule matches. - `const RouteRuleActionRoute RouteRuleAction = "route"` - `ActionParameters RouteRuleActionParameters` The parameters configuring the rule's action. - `HostHeader string` A value to rewrite the HTTP host header to. - `Origin RouteRuleActionParametersOrigin` An origin to route to. - `Host string` A resolved host to route to. - `Port int64` A destination port to route to. - `SNI RouteRuleActionParametersSNI` A Server Name Indication (SNI) override. - `Value string` A value to override the SNI to. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RouteRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit RouteRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type ScoreRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action ScoreRuleAction` The action to perform when the rule matches. - `const ScoreRuleActionScore ScoreRuleAction = "score"` - `ActionParameters ScoreRuleActionParameters` The parameters configuring the rule's action. - `Increment int64` A delta to change the score by, which can be either positive or negative. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck ScoreRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit ScoreRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type ServeErrorRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action ServeErrorRuleAction` The action to perform when the rule matches. - `const ServeErrorRuleActionServeError ServeErrorRuleAction = "serve_error"` - `ActionParameters ServeErrorRuleActionParameters` The parameters configuring the rule's action. - `type ServeErrorRuleActionParametersActionParametersContent struct{…}` - `Content string` The response content. - `ContentType ServeErrorRuleActionParametersActionParametersContentContentType` The content type header to set with the error response. - `const ServeErrorRuleActionParametersActionParametersContentContentTypeApplicationJson ServeErrorRuleActionParametersActionParametersContentContentType = "application/json"` - `const ServeErrorRuleActionParametersActionParametersContentContentTypeTextHTML ServeErrorRuleActionParametersActionParametersContentContentType = "text/html"` - `const ServeErrorRuleActionParametersActionParametersContentContentTypeTextPlain ServeErrorRuleActionParametersActionParametersContentContentType = "text/plain"` - `const ServeErrorRuleActionParametersActionParametersContentContentTypeTextXml ServeErrorRuleActionParametersActionParametersContentContentType = "text/xml"` - `StatusCode int64` The status code to use for the error. - `type ServeErrorRuleActionParametersActionParametersAsset struct{…}` - `AssetName string` The name of a custom asset to serve as the error response. - `ContentType ServeErrorRuleActionParametersActionParametersAssetContentType` The content type header to set with the error response. - `const ServeErrorRuleActionParametersActionParametersAssetContentTypeApplicationJson ServeErrorRuleActionParametersActionParametersAssetContentType = "application/json"` - `const ServeErrorRuleActionParametersActionParametersAssetContentTypeTextHTML ServeErrorRuleActionParametersActionParametersAssetContentType = "text/html"` - `const ServeErrorRuleActionParametersActionParametersAssetContentTypeTextPlain ServeErrorRuleActionParametersActionParametersAssetContentType = "text/plain"` - `const ServeErrorRuleActionParametersActionParametersAssetContentTypeTextXml ServeErrorRuleActionParametersActionParametersAssetContentType = "text/xml"` - `StatusCode int64` The status code to use for the error. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck ServeErrorRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit ServeErrorRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type RuleNewResponseRulesRulesetsSetCacheControlRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RuleNewResponseRulesRulesetsSetCacheControlRuleAction` The action to perform when the rule matches. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionSetCacheControl RuleNewResponseRulesRulesetsSetCacheControlRuleAction = "set_cache_control"` - `ActionParameters RuleNewResponseRulesRulesetsSetCacheControlRuleActionParameters` The parameters configuring the rule's action. - `Immutable RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersImmutable` A cache-control directive configuration. - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirective struct{…}` Set the directive. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective struct{…}` Remove the directive. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `MaxAge RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAge` A cache-control directive configuration that accepts a duration value in seconds. - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective struct{…}` Set the directive with a duration value in seconds. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation = "remove"` - `Value int64` The duration value in seconds for the directive. - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective struct{…}` Remove the directive. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `MustRevalidate RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidate` A cache-control directive configuration. - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective struct{…}` Set the directive. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective struct{…}` Remove the directive. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `MustUnderstand RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstand` A cache-control directive configuration. - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective struct{…}` Set the directive. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective struct{…}` Remove the directive. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `NoCache RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoCache` A cache-control directive configuration that accepts optional qualifiers (header names). - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective struct{…}` Set the directive with optional qualifiers. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `Qualifiers []string` Optional list of header names to qualify the directive (e.g., for "private" or "no-cache" directives). - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective struct{…}` Remove the directive. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `NoStore RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoStore` A cache-control directive configuration. - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective struct{…}` Set the directive. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective struct{…}` Remove the directive. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `NoTransform RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransform` A cache-control directive configuration. - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective struct{…}` Set the directive. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective struct{…}` Remove the directive. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `Private RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPrivate` A cache-control directive configuration that accepts optional qualifiers (header names). - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirective struct{…}` Set the directive with optional qualifiers. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `Qualifiers []string` Optional list of header names to qualify the directive (e.g., for "private" or "no-cache" directives). - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective struct{…}` Remove the directive. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `ProxyRevalidate RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidate` A cache-control directive configuration. - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective struct{…}` Set the directive. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective struct{…}` Remove the directive. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `Public RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPublic` A cache-control directive configuration. - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirective struct{…}` Set the directive. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective struct{…}` Remove the directive. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `SMaxage RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxage` A cache-control directive configuration that accepts a duration value in seconds. - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective struct{…}` Set the directive with a duration value in seconds. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation = "remove"` - `Value int64` The duration value in seconds for the directive. - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective struct{…}` Remove the directive. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `StaleIfError RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfError` A cache-control directive configuration that accepts a duration value in seconds. - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective struct{…}` Set the directive with a duration value in seconds. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation = "remove"` - `Value int64` The duration value in seconds for the directive. - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective struct{…}` Remove the directive. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `StaleWhileRevalidate RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate` A cache-control directive configuration that accepts a duration value in seconds. - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective struct{…}` Set the directive with a duration value in seconds. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation = "remove"` - `Value int64` The duration value in seconds for the directive. - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective struct{…}` Remove the directive. - `Operation RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperationSet RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation = "set"` - `const RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperationRemove RuleNewResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RuleNewResponseRulesRulesetsSetCacheControlRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit RuleNewResponseRulesRulesetsSetCacheControlRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type SetCacheSettingsRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action SetCacheSettingsRuleAction` The action to perform when the rule matches. - `const SetCacheSettingsRuleActionSetCacheSettings SetCacheSettingsRuleAction = "set_cache_settings"` - `ActionParameters SetCacheSettingsRuleActionParameters` The parameters configuring the rule's action. - `AdditionalCacheablePorts []int64` A list of additional ports that caching should be enabled on. - `BrowserTTL SetCacheSettingsRuleActionParametersBrowserTTL` How long client browsers should cache the response. Cloudflare cache purge will not purge content cached on client browsers, so high browser TTLs may lead to stale content. - `Mode SetCacheSettingsRuleActionParametersBrowserTTLMode` The browser TTL mode. - `const SetCacheSettingsRuleActionParametersBrowserTTLModeRespectOrigin SetCacheSettingsRuleActionParametersBrowserTTLMode = "respect_origin"` - `const SetCacheSettingsRuleActionParametersBrowserTTLModeBypassByDefault SetCacheSettingsRuleActionParametersBrowserTTLMode = "bypass_by_default"` - `const SetCacheSettingsRuleActionParametersBrowserTTLModeOverrideOrigin SetCacheSettingsRuleActionParametersBrowserTTLMode = "override_origin"` - `const SetCacheSettingsRuleActionParametersBrowserTTLModeBypass SetCacheSettingsRuleActionParametersBrowserTTLMode = "bypass"` - `Default int64` The browser TTL (in seconds) if you choose the "override_origin" mode. - `Cache bool` Whether the request's response from the origin is eligible for caching. Caching itself will still depend on the cache control header and your other caching configurations. - `CacheKey SetCacheSettingsRuleActionParametersCacheKey` Which components of the request are included in or excluded from the cache key Cloudflare uses to store the response in cache. - `CacheByDeviceType bool` Whether to separate cached content based on the visitor's device type. - `CacheDeceptionArmor bool` Whether to protect from web cache deception attacks, while allowing static assets to be cached. - `CustomKey SetCacheSettingsRuleActionParametersCacheKeyCustomKey` Which components of the request are included or excluded from the cache key. - `Cookie SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookie` Which cookies to include in the cache key. - `CheckPresence []string` A list of cookies to check for the presence of. The presence of these cookies is included in the cache key. - `Include []string` A list of cookies to include in the cache key. - `Header SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader` Which headers to include in the cache key. - `CheckPresence []string` A list of headers to check for the presence of. The presence of these headers is included in the cache key. - `Contains map[string, []string]` A mapping of header names to a list of values. If a header is present in the request and contains any of the values provided, its value is included in the cache key. - `ExcludeOrigin bool` Whether to exclude the origin header in the cache key. - `Include []string` A list of headers to include in the cache key. - `Host SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost` How to use the host in the cache key. - `Resolved bool` Whether to use the resolved host in the cache key. - `QueryString SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString` Which query string parameters to include in or exclude from the cache key. - `Exclude SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude` Which query string parameters to exclude from the cache key. - `All SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeAll` Whether to exclude all query string parameters from the cache key. - `const SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeAllTrue SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeAll = true` - `List []string` A list of query string parameters to exclude from the cache key. - `Include SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude` Which query string parameters to include in the cache key. - `All SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeAll` Whether to include all query string parameters in the cache key. - `const SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeAllTrue SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeAll = true` - `List []string` A list of query string parameters to include in the cache key. - `User SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser` How to use characteristics of the request user agent in the cache key. - `DeviceType bool` Whether to use the user agent's device type in the cache key. - `Geo bool` Whether to use the user agents's country in the cache key. - `Lang bool` Whether to use the user agent's language in the cache key. - `IgnoreQueryStringsOrder bool` Whether to treat requests with the same query parameters the same, regardless of the order those query parameters are in. - `CacheReserve SetCacheSettingsRuleActionParametersCacheReserve` Settings to determine whether the request's response from origin is eligible for Cache Reserve (requires a Cache Reserve add-on plan). - `Eligible bool` Whether Cache Reserve is enabled. If this is true and a request meets eligibility criteria, Cloudflare will write the resource to Cache Reserve. - `MinimumFileSize int64` The minimum file size eligible for storage in Cache Reserve. - `EdgeTTL SetCacheSettingsRuleActionParametersEdgeTTL` How long the Cloudflare edge network should cache the response. - `Mode SetCacheSettingsRuleActionParametersEdgeTTLMode` The edge TTL mode. - `const SetCacheSettingsRuleActionParametersEdgeTTLModeRespectOrigin SetCacheSettingsRuleActionParametersEdgeTTLMode = "respect_origin"` - `const SetCacheSettingsRuleActionParametersEdgeTTLModeBypassByDefault SetCacheSettingsRuleActionParametersEdgeTTLMode = "bypass_by_default"` - `const SetCacheSettingsRuleActionParametersEdgeTTLModeOverrideOrigin SetCacheSettingsRuleActionParametersEdgeTTLMode = "override_origin"` - `Default int64` The edge TTL (in seconds) if you choose the "override_origin" mode. - `StatusCodeTTL []SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL` A list of TTLs to apply to specific status codes or status code ranges. - `Value int64` The time to cache the response for (in seconds). A value of 0 is equivalent to setting the cache control header with the value "no-cache". A value of -1 is equivalent to setting the cache control header with the value of "no-store". - `StatusCode int64` A single status code to apply the TTL to. - `StatusCodeRange SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRange` A range of status codes to apply the TTL to. - `From int64` The lower bound of the range. - `To int64` The upper bound of the range. - `OriginCacheControl bool` Whether Cloudflare will aim to strictly adhere to RFC 7234. - `OriginErrorPagePassthru bool` Whether to generate Cloudflare error pages for issues from the origin server. - `ReadTimeout int64` A timeout value between two successive read operations to use for your origin server. Historically, the timeout value between two read options from Cloudflare to an origin server is 100 seconds. If you are attempting to reduce HTTP 524 errors because of timeouts from an origin server, try increasing this timeout value. - `RespectStrongEtags bool` Whether Cloudflare should respect strong ETag (entity tag) headers. If false, Cloudflare converts strong ETag headers to weak ETag headers. - `ServeStale SetCacheSettingsRuleActionParametersServeStale` When to serve stale content from cache. - `DisableStaleWhileUpdating bool` Whether Cloudflare should disable serving stale content while getting the latest content from the origin. - `SharedDictionary SetCacheSettingsRuleActionParametersSharedDictionary` Configuration for shared dictionary compression. When set, Cloudflare injects Use-As-Dictionary headers on matching cacheable responses. - `MatchPattern string` URL pattern for the Use-As-Dictionary match field. This pattern specifies which URLs can use this response as a dictionary. - `StripEtags bool` Whether to strip ETag headers from the origin response before caching. - `StripLastModified bool` Whether to strip Last-Modified headers from the origin response before caching. - `StripSetCookie bool` Whether to strip Set-Cookie headers from the origin response before caching. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck SetCacheSettingsRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit SetCacheSettingsRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type RuleNewResponseRulesRulesetsSetCacheTagsRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RuleNewResponseRulesRulesetsSetCacheTagsRuleAction` The action to perform when the rule matches. - `const RuleNewResponseRulesRulesetsSetCacheTagsRuleActionSetCacheTags RuleNewResponseRulesRulesetsSetCacheTagsRuleAction = "set_cache_tags"` - `ActionParameters RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParameters` The parameters configuring the rule's action. - `type RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues struct{…}` Add cache tags using a list of values. - `Operation RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation` The operation to perform on the cache tags. - `const RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationAdd RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "add"` - `const RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationRemove RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "remove"` - `const RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationSet RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "set"` - `Values []string` A list of cache tag values. - `type RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression struct{…}` Add cache tags using an expression. - `Expression string` An expression that evaluates to an array of cache tag values. - `Operation RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation` The operation to perform on the cache tags. - `const RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationAdd RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "add"` - `const RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationRemove RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "remove"` - `const RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationSet RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "set"` - `type RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues struct{…}` Remove cache tags using a list of values. - `Operation RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation` The operation to perform on the cache tags. - `const RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationAdd RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "add"` - `const RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationRemove RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "remove"` - `const RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationSet RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "set"` - `Values []string` A list of cache tag values. - `type RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression struct{…}` Remove cache tags using an expression. - `Expression string` An expression that evaluates to an array of cache tag values. - `Operation RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation` The operation to perform on the cache tags. - `const RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationAdd RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "add"` - `const RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationRemove RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "remove"` - `const RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationSet RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "set"` - `type RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues struct{…}` Set cache tags using a list of values. - `Operation RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation` The operation to perform on the cache tags. - `const RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationAdd RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "add"` - `const RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationRemove RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "remove"` - `const RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationSet RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "set"` - `Values []string` A list of cache tag values. - `type RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression struct{…}` Set cache tags using an expression. - `Expression string` An expression that evaluates to an array of cache tag values. - `Operation RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation` The operation to perform on the cache tags. - `const RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationAdd RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "add"` - `const RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationRemove RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "remove"` - `const RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationSet RuleNewResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "set"` - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RuleNewResponseRulesRulesetsSetCacheTagsRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit RuleNewResponseRulesRulesetsSetCacheTagsRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type SetConfigRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action SetConfigRuleAction` The action to perform when the rule matches. - `const SetConfigRuleActionSetConfig SetConfigRuleAction = "set_config"` - `ActionParameters SetConfigRuleActionParameters` The parameters configuring the rule's action. - `AutomaticHTTPSRewrites bool` Whether to enable Automatic HTTPS Rewrites. - `Autominify SetConfigRuleActionParametersAutominify` Which file extensions to minify automatically. - `CSS bool` Whether to minify CSS files. - `HTML bool` Whether to minify HTML files. - `JS bool` Whether to minify JavaScript files. - `BIC bool` Whether to enable Browser Integrity Check (BIC). - `ContentConverter bool` Whether to enable content conversion (e.g., HTML to Markdown). - `DisableApps SetConfigRuleActionParametersDisableApps` Whether to disable Cloudflare Apps. - `const SetConfigRuleActionParametersDisableAppsTrue SetConfigRuleActionParametersDisableApps = true` - `DisablePayPerCrawl SetConfigRuleActionParametersDisablePayPerCrawl` Whether to disable Pay Per Crawl. - `const SetConfigRuleActionParametersDisablePayPerCrawlTrue SetConfigRuleActionParametersDisablePayPerCrawl = true` - `DisableRUM SetConfigRuleActionParametersDisableRUM` Whether to disable Real User Monitoring (RUM). - `const SetConfigRuleActionParametersDisableRUMTrue SetConfigRuleActionParametersDisableRUM = true` - `DisableZaraz SetConfigRuleActionParametersDisableZaraz` Whether to disable Zaraz. - `const SetConfigRuleActionParametersDisableZarazTrue SetConfigRuleActionParametersDisableZaraz = true` - `EmailObfuscation bool` Whether to enable Email Obfuscation. - `Fonts bool` Whether to enable Cloudflare Fonts. - `HotlinkProtection bool` Whether to enable Hotlink Protection. - `Mirage bool` Whether to enable Mirage. - `OpportunisticEncryption bool` Whether to enable Opportunistic Encryption. - `Polish SetConfigRuleActionParametersPolish` The Polish level to configure. - `const SetConfigRuleActionParametersPolishOff SetConfigRuleActionParametersPolish = "off"` - `const SetConfigRuleActionParametersPolishLossless SetConfigRuleActionParametersPolish = "lossless"` - `const SetConfigRuleActionParametersPolishLossy SetConfigRuleActionParametersPolish = "lossy"` - `const SetConfigRuleActionParametersPolishWebP SetConfigRuleActionParametersPolish = "webp"` - `RedirectsForAITraining bool` Whether to redirect verified AI training crawlers to canonical URLs found in the HTML response. - `RequestBodyBuffering SetConfigRuleActionParametersRequestBodyBuffering` The request body buffering mode. - `const SetConfigRuleActionParametersRequestBodyBufferingNone SetConfigRuleActionParametersRequestBodyBuffering = "none"` - `const SetConfigRuleActionParametersRequestBodyBufferingStandard SetConfigRuleActionParametersRequestBodyBuffering = "standard"` - `const SetConfigRuleActionParametersRequestBodyBufferingFull SetConfigRuleActionParametersRequestBodyBuffering = "full"` - `ResponseBodyBuffering SetConfigRuleActionParametersResponseBodyBuffering` The response body buffering mode. - `const SetConfigRuleActionParametersResponseBodyBufferingNone SetConfigRuleActionParametersResponseBodyBuffering = "none"` - `const SetConfigRuleActionParametersResponseBodyBufferingStandard SetConfigRuleActionParametersResponseBodyBuffering = "standard"` - `RocketLoader bool` Whether to enable Rocket Loader. - `SecurityLevel SetConfigRuleActionParametersSecurityLevel` The Security Level to configure. - `const SetConfigRuleActionParametersSecurityLevelOff SetConfigRuleActionParametersSecurityLevel = "off"` - `const SetConfigRuleActionParametersSecurityLevelEssentiallyOff SetConfigRuleActionParametersSecurityLevel = "essentially_off"` - `const SetConfigRuleActionParametersSecurityLevelLow SetConfigRuleActionParametersSecurityLevel = "low"` - `const SetConfigRuleActionParametersSecurityLevelMedium SetConfigRuleActionParametersSecurityLevel = "medium"` - `const SetConfigRuleActionParametersSecurityLevelHigh SetConfigRuleActionParametersSecurityLevel = "high"` - `const SetConfigRuleActionParametersSecurityLevelUnderAttack SetConfigRuleActionParametersSecurityLevel = "under_attack"` - `ServerSideExcludes bool` Whether to enable Server-Side Excludes. - `SSL SetConfigRuleActionParametersSSL` The SSL level to configure. - `const SetConfigRuleActionParametersSSLOff SetConfigRuleActionParametersSSL = "off"` - `const SetConfigRuleActionParametersSSLFlexible SetConfigRuleActionParametersSSL = "flexible"` - `const SetConfigRuleActionParametersSSLFull SetConfigRuleActionParametersSSL = "full"` - `const SetConfigRuleActionParametersSSLStrict SetConfigRuleActionParametersSSL = "strict"` - `const SetConfigRuleActionParametersSSLOriginPull SetConfigRuleActionParametersSSL = "origin_pull"` - `SXG bool` Whether to enable Signed Exchanges (SXG). - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck SetConfigRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit SetConfigRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type SkipRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action SkipRuleAction` The action to perform when the rule matches. - `const SkipRuleActionSkip SkipRuleAction = "skip"` - `ActionParameters SkipRuleActionParameters` The parameters configuring the rule's action. - `Phase SkipRuleActionParametersPhase` A phase to skip the execution of. This option is only compatible with the products option. - `const SkipRuleActionParametersPhaseCurrent SkipRuleActionParametersPhase = "current"` - `Phases []Phase` A list of phases to skip the execution of. This option is incompatible with the rulesets option. - `const PhaseDDoSL4 Phase = "ddos_l4"` - `const PhaseDDoSL7 Phase = "ddos_l7"` - `const PhaseHTTPConfigSettings Phase = "http_config_settings"` - `const PhaseHTTPCustomErrors Phase = "http_custom_errors"` - `const PhaseHTTPLogCustomFields Phase = "http_log_custom_fields"` - `const PhaseHTTPRatelimit Phase = "http_ratelimit"` - `const PhaseHTTPRequestCacheSettings Phase = "http_request_cache_settings"` - `const PhaseHTTPRequestDynamicRedirect Phase = "http_request_dynamic_redirect"` - `const PhaseHTTPRequestFirewallCustom Phase = "http_request_firewall_custom"` - `const PhaseHTTPRequestFirewallManaged Phase = "http_request_firewall_managed"` - `const PhaseHTTPRequestLateTransform Phase = "http_request_late_transform"` - `const PhaseHTTPRequestOrigin Phase = "http_request_origin"` - `const PhaseHTTPRequestRedirect Phase = "http_request_redirect"` - `const PhaseHTTPRequestSanitize Phase = "http_request_sanitize"` - `const PhaseHTTPRequestSBFM Phase = "http_request_sbfm"` - `const PhaseHTTPRequestTransform Phase = "http_request_transform"` - `const PhaseHTTPResponseCacheSettings Phase = "http_response_cache_settings"` - `const PhaseHTTPResponseCompression Phase = "http_response_compression"` - `const PhaseHTTPResponseFirewallManaged Phase = "http_response_firewall_managed"` - `const PhaseHTTPResponseHeadersTransform Phase = "http_response_headers_transform"` - `const PhaseMagicTransit Phase = "magic_transit"` - `const PhaseMagicTransitIDsManaged Phase = "magic_transit_ids_managed"` - `const PhaseMagicTransitManaged Phase = "magic_transit_managed"` - `const PhaseMagicTransitRatelimit Phase = "magic_transit_ratelimit"` - `Products []SkipRuleActionParametersProduct` A list of legacy security products to skip the execution of. - `const SkipRuleActionParametersProductBIC SkipRuleActionParametersProduct = "bic"` - `const SkipRuleActionParametersProductHot SkipRuleActionParametersProduct = "hot"` - `const SkipRuleActionParametersProductRateLimit SkipRuleActionParametersProduct = "rateLimit"` - `const SkipRuleActionParametersProductSecurityLevel SkipRuleActionParametersProduct = "securityLevel"` - `const SkipRuleActionParametersProductUABlock SkipRuleActionParametersProduct = "uaBlock"` - `const SkipRuleActionParametersProductWAF SkipRuleActionParametersProduct = "waf"` - `const SkipRuleActionParametersProductZoneLockdown SkipRuleActionParametersProduct = "zoneLockdown"` - `Rules map[string, []string]` A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the execution of. This option is incompatible with the ruleset option. - `Ruleset SkipRuleActionParametersRuleset` A ruleset to skip the execution of. This option is incompatible with the rulesets option. - `const SkipRuleActionParametersRulesetCurrent SkipRuleActionParametersRuleset = "current"` - `Rulesets []string` A list of ruleset IDs to skip the execution of. This option is incompatible with the ruleset and phases options. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck SkipRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit SkipRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `Version string` The version of the ruleset. - `Description string` An informative description of the ruleset. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/rulesets" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) rule, err := client.Rulesets.Rules.New( context.TODO(), "2f2feab2026849078ba485f918791bdc", rulesets.RuleNewParams{ Body: rulesets.RuleNewParamsBodyBlockRule(rulesets.RuleNewParamsBodyBlockRule{ BlockRuleParam: rulesets.BlockRuleParam{ }, }), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", rule.ID) } ``` #### Response ```json { "errors": [ { "message": "something bad happened", "code": 10000, "source": { "pointer": "/rules/0/action" } } ], "messages": [ { "message": "something bad happened", "code": 10000, "source": { "pointer": "/rules/0/action" } } ], "result": { "id": "2f2feab2026849078ba485f918791bdc", "kind": "root", "last_updated": "2000-01-01T00:00:00.000000Z", "name": "My ruleset", "phase": "http_request_firewall_custom", "rules": [ { "last_updated": "2000-01-01T00:00:00.000000Z", "version": "1", "id": "3a03d665bac047339bb530ecb439a90d", "action": "block", "action_parameters": { "response": { "content": "{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}", "content_type": "application/json", "status_code": 400 } }, "categories": [ "directory-traversal" ], "description": "Block the request.", "enabled": true, "exposed_credential_check": { "password_expression": "url_decode(http.request.body.form[\\\"password\\\"][0])", "username_expression": "url_decode(http.request.body.form[\\\"username\\\"][0])" }, "expression": "ip.src eq 1.1.1.1", "logging": { "enabled": true }, "ratelimit": { "characteristics": [ "cf.colo.id" ], "period": 60, "counting_expression": "http.request.body.raw eq \"abcd\"", "mitigation_timeout": 600, "requests_per_period": 1000, "requests_to_origin": true, "score_per_period": 400, "score_response_header_name": "my-score" }, "ref": "my_ref" } ], "version": "1", "description": "A description for my ruleset." }, "success": true } ``` ## Update an account or zone ruleset rule `client.Rulesets.Rules.Edit(ctx, rulesetID, ruleID, params) (*RuleEditResponse, error)` **patch** `/{accounts_or_zones}/{account_or_zone_id}/rulesets/{ruleset_id}/rules/{rule_id}` Updates an existing rule in an account or zone ruleset. ### Parameters - `rulesetID string` The unique ID of the ruleset. - `ruleID string` The unique ID of the rule. - `params RuleEditParams` - `AccountID param.Field[string]` Path param: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. - `ZoneID param.Field[string]` Path param: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. - `ID param.Field[string]` Body param: The unique ID of the rule. - `Action param.Field[RuleEditParamsBlockRuleAction]` Body param: The action to perform when the rule matches. - `const RuleEditParamsBlockRuleActionBlock RuleEditParamsBlockRuleAction = "block"` - `ActionParameters param.Field[RuleEditParamsBlockRuleActionParameters]` Body param: The parameters configuring the rule's action. - `Response RuleEditParamsBlockRuleActionParametersResponse` The response to show when the block is applied. - `Content string` The content to return. - `ContentType string` The type of the content to return. - `StatusCode int64` The status code to return. - `Description param.Field[string]` Body param: An informative description of the rule. - `Enabled param.Field[bool]` Body param: Whether the rule should be executed. - `ExposedCredentialCheck param.Field[RuleEditParamsBlockRuleExposedCredentialCheck]` Body param: Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression param.Field[string]` Body param: The expression defining which traffic will match the rule. - `Logging param.Field[Logging]` Body param: An object configuring the rule's logging behavior. - `Position param.Field[RuleEditParamsBlockRulePosition]` Body param: An object configuring where the rule will be placed. - `RuleEditParamsBlockRulePositionBeforePosition` - `Before string` The ID of another rule to place the rule before. An empty value causes the rule to be placed at the top. - `RuleEditParamsBlockRulePositionAfterPosition` - `After string` The ID of another rule to place the rule after. An empty value causes the rule to be placed at the bottom. - `RuleEditParamsBlockRulePositionIndexPosition` - `Index int64` An index at which to place the rule, where index 1 is the first rule. - `Ratelimit param.Field[RuleEditParamsBlockRuleRatelimit]` Body param: An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref param.Field[string]` Body param: The reference of the rule (the rule's ID by default). ### Returns - `type RuleEditResponse struct{…}` A ruleset object. - `ID string` The unique ID of the ruleset. - `Kind Kind` The kind of the ruleset. - `const KindManaged Kind = "managed"` - `const KindCustom Kind = "custom"` - `const KindRoot Kind = "root"` - `const KindZone Kind = "zone"` - `LastUpdated Time` The timestamp of when the ruleset was last modified. - `Name string` The human-readable name of the ruleset. - `Phase Phase` The phase of the ruleset. - `const PhaseDDoSL4 Phase = "ddos_l4"` - `const PhaseDDoSL7 Phase = "ddos_l7"` - `const PhaseHTTPConfigSettings Phase = "http_config_settings"` - `const PhaseHTTPCustomErrors Phase = "http_custom_errors"` - `const PhaseHTTPLogCustomFields Phase = "http_log_custom_fields"` - `const PhaseHTTPRatelimit Phase = "http_ratelimit"` - `const PhaseHTTPRequestCacheSettings Phase = "http_request_cache_settings"` - `const PhaseHTTPRequestDynamicRedirect Phase = "http_request_dynamic_redirect"` - `const PhaseHTTPRequestFirewallCustom Phase = "http_request_firewall_custom"` - `const PhaseHTTPRequestFirewallManaged Phase = "http_request_firewall_managed"` - `const PhaseHTTPRequestLateTransform Phase = "http_request_late_transform"` - `const PhaseHTTPRequestOrigin Phase = "http_request_origin"` - `const PhaseHTTPRequestRedirect Phase = "http_request_redirect"` - `const PhaseHTTPRequestSanitize Phase = "http_request_sanitize"` - `const PhaseHTTPRequestSBFM Phase = "http_request_sbfm"` - `const PhaseHTTPRequestTransform Phase = "http_request_transform"` - `const PhaseHTTPResponseCacheSettings Phase = "http_response_cache_settings"` - `const PhaseHTTPResponseCompression Phase = "http_response_compression"` - `const PhaseHTTPResponseFirewallManaged Phase = "http_response_firewall_managed"` - `const PhaseHTTPResponseHeadersTransform Phase = "http_response_headers_transform"` - `const PhaseMagicTransit Phase = "magic_transit"` - `const PhaseMagicTransitIDsManaged Phase = "magic_transit_ids_managed"` - `const PhaseMagicTransitManaged Phase = "magic_transit_managed"` - `const PhaseMagicTransitRatelimit Phase = "magic_transit_ratelimit"` - `Rules []RuleEditResponseRule` The list of rules in the ruleset. - `type BlockRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action BlockRuleAction` The action to perform when the rule matches. - `const BlockRuleActionBlock BlockRuleAction = "block"` - `ActionParameters BlockRuleActionParameters` The parameters configuring the rule's action. - `Response BlockRuleActionParametersResponse` The response to show when the block is applied. - `Content string` The content to return. - `ContentType string` The type of the content to return. - `StatusCode int64` The status code to return. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck BlockRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Enabled bool` Whether to generate a log when the rule matches. - `Ratelimit BlockRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type RuleEditResponseRulesRulesetsChallengeRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RuleEditResponseRulesRulesetsChallengeRuleAction` The action to perform when the rule matches. - `const RuleEditResponseRulesRulesetsChallengeRuleActionChallenge RuleEditResponseRulesRulesetsChallengeRuleAction = "challenge"` - `ActionParameters unknown` The parameters configuring the rule's action. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RuleEditResponseRulesRulesetsChallengeRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit RuleEditResponseRulesRulesetsChallengeRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type CompressResponseRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action CompressResponseRuleAction` The action to perform when the rule matches. - `const CompressResponseRuleActionCompressResponse CompressResponseRuleAction = "compress_response"` - `ActionParameters CompressResponseRuleActionParameters` The parameters configuring the rule's action. - `Algorithms []CompressResponseRuleActionParametersAlgorithm` Custom order for compression algorithms. - `Name CompressResponseRuleActionParametersAlgorithmsName` Name of the compression algorithm to enable. - `const CompressResponseRuleActionParametersAlgorithmsNameNone CompressResponseRuleActionParametersAlgorithmsName = "none"` - `const CompressResponseRuleActionParametersAlgorithmsNameAuto CompressResponseRuleActionParametersAlgorithmsName = "auto"` - `const CompressResponseRuleActionParametersAlgorithmsNameDefault CompressResponseRuleActionParametersAlgorithmsName = "default"` - `const CompressResponseRuleActionParametersAlgorithmsNameGzip CompressResponseRuleActionParametersAlgorithmsName = "gzip"` - `const CompressResponseRuleActionParametersAlgorithmsNameBrotli CompressResponseRuleActionParametersAlgorithmsName = "brotli"` - `const CompressResponseRuleActionParametersAlgorithmsNameZstd CompressResponseRuleActionParametersAlgorithmsName = "zstd"` - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck CompressResponseRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit CompressResponseRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type DDoSDynamicRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action DDoSDynamicRuleAction` The action to perform when the rule matches. - `const DDoSDynamicRuleActionDDoSDynamic DDoSDynamicRuleAction = "ddos_dynamic"` - `ActionParameters unknown` The parameters configuring the rule's action. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck DDoSDynamicRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit DDoSDynamicRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type ExecuteRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action ExecuteRuleAction` The action to perform when the rule matches. - `const ExecuteRuleActionExecute ExecuteRuleAction = "execute"` - `ActionParameters ExecuteRuleActionParameters` The parameters configuring the rule's action. - `ID string` The ID of the ruleset to execute. - `MatchedData ExecuteRuleActionParametersMatchedData` The configuration to use for matched data logging. - `PublicKey string` The public key to encrypt matched data logs with. - `Overrides ExecuteRuleActionParametersOverrides` A set of overrides to apply to the target ruleset. - `Action string` An action to override all rules with. This option has lower precedence than rule and category overrides. - `Categories []ExecuteRuleActionParametersOverridesCategory` A list of category-level overrides. This option has the second-highest precedence after rule-level overrides. - `Category string` The name of the category to override. - `Action string` The action to override rules in the category with. - `Enabled bool` Whether to enable execution of rules in the category. - `SensitivityLevel ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel` The sensitivity level to use for rules in the category. This option is only applicable for DDoS phases. - `const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"` - `const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"` - `const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"` - `const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"` - `Enabled bool` Whether to enable execution of all rules. This option has lower precedence than rule and category overrides. - `Rules []ExecuteRuleActionParametersOverridesRule` A list of rule-level overrides. This option has the highest precedence. - `ID string` The ID of the rule to override. - `Action string` The action to override the rule with. - `Enabled bool` Whether to enable execution of the rule. - `ScoreThreshold int64` The score threshold to use for the rule. - `SensitivityLevel ExecuteRuleActionParametersOverridesRulesSensitivityLevel` The sensitivity level to use for the rule. This option is only applicable for DDoS phases. - `const ExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"` - `const ExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"` - `const ExecuteRuleActionParametersOverridesRulesSensitivityLevelLow ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"` - `const ExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"` - `SensitivityLevel ExecuteRuleActionParametersOverridesSensitivityLevel` A sensitivity level to set for all rules. This option has lower precedence than rule and category overrides and is only applicable for DDoS phases. - `const ExecuteRuleActionParametersOverridesSensitivityLevelDefault ExecuteRuleActionParametersOverridesSensitivityLevel = "default"` - `const ExecuteRuleActionParametersOverridesSensitivityLevelMedium ExecuteRuleActionParametersOverridesSensitivityLevel = "medium"` - `const ExecuteRuleActionParametersOverridesSensitivityLevelLow ExecuteRuleActionParametersOverridesSensitivityLevel = "low"` - `const ExecuteRuleActionParametersOverridesSensitivityLevelEoff ExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"` - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck ExecuteRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit ExecuteRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type ForceConnectionCloseRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action ForceConnectionCloseRuleAction` The action to perform when the rule matches. - `const ForceConnectionCloseRuleActionForceConnectionClose ForceConnectionCloseRuleAction = "force_connection_close"` - `ActionParameters unknown` The parameters configuring the rule's action. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck ForceConnectionCloseRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit ForceConnectionCloseRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type RuleEditResponseRulesRulesetsJSChallengeRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RuleEditResponseRulesRulesetsJSChallengeRuleAction` The action to perform when the rule matches. - `const RuleEditResponseRulesRulesetsJSChallengeRuleActionJSChallenge RuleEditResponseRulesRulesetsJSChallengeRuleAction = "js_challenge"` - `ActionParameters unknown` The parameters configuring the rule's action. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RuleEditResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit RuleEditResponseRulesRulesetsJSChallengeRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type LogRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action LogRuleAction` The action to perform when the rule matches. - `const LogRuleActionLog LogRuleAction = "log"` - `ActionParameters unknown` The parameters configuring the rule's action. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck LogRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit LogRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type LogCustomFieldRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action LogCustomFieldRuleAction` The action to perform when the rule matches. - `const LogCustomFieldRuleActionLogCustomField LogCustomFieldRuleAction = "log_custom_field"` - `ActionParameters LogCustomFieldRuleActionParameters` The parameters configuring the rule's action. - `CookieFields []LogCustomFieldRuleActionParametersCookieField` The cookie fields to log. - `Name string` The name of the cookie. - `RawResponseFields []LogCustomFieldRuleActionParametersRawResponseField` The raw response fields to log. - `Name string` The name of the response header. - `PreserveDuplicates bool` Whether to log duplicate values of the same header. - `RequestFields []LogCustomFieldRuleActionParametersRequestField` The raw request fields to log. - `Name string` The name of the header. - `ResponseFields []LogCustomFieldRuleActionParametersResponseField` The transformed response fields to log. - `Name string` The name of the response header. - `PreserveDuplicates bool` Whether to log duplicate values of the same header. - `TransformedRequestFields []LogCustomFieldRuleActionParametersTransformedRequestField` The transformed request fields to log. - `Name string` The name of the header. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck LogCustomFieldRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit LogCustomFieldRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type ManagedChallengeRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action ManagedChallengeRuleAction` The action to perform when the rule matches. - `const ManagedChallengeRuleActionManagedChallenge ManagedChallengeRuleAction = "managed_challenge"` - `ActionParameters unknown` The parameters configuring the rule's action. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck ManagedChallengeRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit ManagedChallengeRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type RedirectRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RedirectRuleAction` The action to perform when the rule matches. - `const RedirectRuleActionRedirect RedirectRuleAction = "redirect"` - `ActionParameters RedirectRuleActionParameters` The parameters configuring the rule's action. - `FromList RedirectRuleActionParametersFromList` A redirect based on a bulk list lookup. - `Key string` An expression that evaluates to the list lookup key. - `Name string` The name of the list to match against. - `FromValue RedirectRuleActionParametersFromValue` A redirect based on the request properties. - `TargetURL RedirectRuleActionParametersFromValueTargetURL` A URL to redirect the request to. - `Expression string` An expression that evaluates to a URL to redirect the request to. - `Value string` A URL to redirect the request to. - `PreserveQueryString bool` Whether to keep the query string of the original request. - `StatusCode RedirectRuleActionParametersFromValueStatusCode` The status code to use for the redirect. - `const RedirectRuleActionParametersFromValueStatusCode301 RedirectRuleActionParametersFromValueStatusCode = 301` - `const RedirectRuleActionParametersFromValueStatusCode302 RedirectRuleActionParametersFromValueStatusCode = 302` - `const RedirectRuleActionParametersFromValueStatusCode303 RedirectRuleActionParametersFromValueStatusCode = 303` - `const RedirectRuleActionParametersFromValueStatusCode307 RedirectRuleActionParametersFromValueStatusCode = 307` - `const RedirectRuleActionParametersFromValueStatusCode308 RedirectRuleActionParametersFromValueStatusCode = 308` - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RedirectRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit RedirectRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type RewriteRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RewriteRuleAction` The action to perform when the rule matches. - `const RewriteRuleActionRewrite RewriteRuleAction = "rewrite"` - `ActionParameters RewriteRuleActionParameters` The parameters configuring the rule's action. - `Headers map[string, RewriteRuleActionParametersHeader]` A map of headers to rewrite. - `type RewriteRuleActionParametersHeadersAddStaticHeader struct{…}` A header with a static value to add. - `Operation RewriteRuleActionParametersHeadersAddStaticHeaderOperation` The operation to perform on the header. - `const RewriteRuleActionParametersHeadersAddStaticHeaderOperationAdd RewriteRuleActionParametersHeadersAddStaticHeaderOperation = "add"` - `Value string` A static value for the header. - `type RewriteRuleActionParametersHeadersAddDynamicHeader struct{…}` A header with a dynamic value to add. - `Expression string` An expression that evaluates to a value for the header. - `Operation RewriteRuleActionParametersHeadersAddDynamicHeaderOperation` The operation to perform on the header. - `const RewriteRuleActionParametersHeadersAddDynamicHeaderOperationAdd RewriteRuleActionParametersHeadersAddDynamicHeaderOperation = "add"` - `type RewriteRuleActionParametersHeadersSetStaticHeader struct{…}` A header with a static value to set. - `Operation RewriteRuleActionParametersHeadersSetStaticHeaderOperation` The operation to perform on the header. - `const RewriteRuleActionParametersHeadersSetStaticHeaderOperationSet RewriteRuleActionParametersHeadersSetStaticHeaderOperation = "set"` - `Value string` A static value for the header. - `type RewriteRuleActionParametersHeadersSetDynamicHeader struct{…}` A header with a dynamic value to set. - `Expression string` An expression that evaluates to a value for the header. - `Operation RewriteRuleActionParametersHeadersSetDynamicHeaderOperation` The operation to perform on the header. - `const RewriteRuleActionParametersHeadersSetDynamicHeaderOperationSet RewriteRuleActionParametersHeadersSetDynamicHeaderOperation = "set"` - `type RewriteRuleActionParametersHeadersRemoveHeader struct{…}` A header to remove. - `Operation RewriteRuleActionParametersHeadersRemoveHeaderOperation` The operation to perform on the header. - `const RewriteRuleActionParametersHeadersRemoveHeaderOperationRemove RewriteRuleActionParametersHeadersRemoveHeaderOperation = "remove"` - `URI RewriteRuleActionParametersURI` A URI path rewrite. - `type RewriteRuleActionParametersURIURIPath struct{…}` A URI path rewrite. - `Path RewriteRuleActionParametersURIURIPathPath` A URI path rewrite. - `Expression string` An expression that evaluates to a value to rewrite the URI path to. - `Value string` A value to rewrite the URI path to. - `Origin bool` Whether to propagate the rewritten URI to origin. - `type RewriteRuleActionParametersURIURIQuery struct{…}` A URI query rewrite. - `Query RewriteRuleActionParametersURIURIQueryQuery` A URI query rewrite. - `Expression string` An expression that evaluates to a value to rewrite the URI query to. - `Value string` A value to rewrite the URI query to. - `Origin bool` Whether to propagate the rewritten URI to origin. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RewriteRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit RewriteRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type RouteRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RouteRuleAction` The action to perform when the rule matches. - `const RouteRuleActionRoute RouteRuleAction = "route"` - `ActionParameters RouteRuleActionParameters` The parameters configuring the rule's action. - `HostHeader string` A value to rewrite the HTTP host header to. - `Origin RouteRuleActionParametersOrigin` An origin to route to. - `Host string` A resolved host to route to. - `Port int64` A destination port to route to. - `SNI RouteRuleActionParametersSNI` A Server Name Indication (SNI) override. - `Value string` A value to override the SNI to. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RouteRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit RouteRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type ScoreRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action ScoreRuleAction` The action to perform when the rule matches. - `const ScoreRuleActionScore ScoreRuleAction = "score"` - `ActionParameters ScoreRuleActionParameters` The parameters configuring the rule's action. - `Increment int64` A delta to change the score by, which can be either positive or negative. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck ScoreRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit ScoreRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type ServeErrorRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action ServeErrorRuleAction` The action to perform when the rule matches. - `const ServeErrorRuleActionServeError ServeErrorRuleAction = "serve_error"` - `ActionParameters ServeErrorRuleActionParameters` The parameters configuring the rule's action. - `type ServeErrorRuleActionParametersActionParametersContent struct{…}` - `Content string` The response content. - `ContentType ServeErrorRuleActionParametersActionParametersContentContentType` The content type header to set with the error response. - `const ServeErrorRuleActionParametersActionParametersContentContentTypeApplicationJson ServeErrorRuleActionParametersActionParametersContentContentType = "application/json"` - `const ServeErrorRuleActionParametersActionParametersContentContentTypeTextHTML ServeErrorRuleActionParametersActionParametersContentContentType = "text/html"` - `const ServeErrorRuleActionParametersActionParametersContentContentTypeTextPlain ServeErrorRuleActionParametersActionParametersContentContentType = "text/plain"` - `const ServeErrorRuleActionParametersActionParametersContentContentTypeTextXml ServeErrorRuleActionParametersActionParametersContentContentType = "text/xml"` - `StatusCode int64` The status code to use for the error. - `type ServeErrorRuleActionParametersActionParametersAsset struct{…}` - `AssetName string` The name of a custom asset to serve as the error response. - `ContentType ServeErrorRuleActionParametersActionParametersAssetContentType` The content type header to set with the error response. - `const ServeErrorRuleActionParametersActionParametersAssetContentTypeApplicationJson ServeErrorRuleActionParametersActionParametersAssetContentType = "application/json"` - `const ServeErrorRuleActionParametersActionParametersAssetContentTypeTextHTML ServeErrorRuleActionParametersActionParametersAssetContentType = "text/html"` - `const ServeErrorRuleActionParametersActionParametersAssetContentTypeTextPlain ServeErrorRuleActionParametersActionParametersAssetContentType = "text/plain"` - `const ServeErrorRuleActionParametersActionParametersAssetContentTypeTextXml ServeErrorRuleActionParametersActionParametersAssetContentType = "text/xml"` - `StatusCode int64` The status code to use for the error. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck ServeErrorRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit ServeErrorRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type RuleEditResponseRulesRulesetsSetCacheControlRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RuleEditResponseRulesRulesetsSetCacheControlRuleAction` The action to perform when the rule matches. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionSetCacheControl RuleEditResponseRulesRulesetsSetCacheControlRuleAction = "set_cache_control"` - `ActionParameters RuleEditResponseRulesRulesetsSetCacheControlRuleActionParameters` The parameters configuring the rule's action. - `Immutable RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersImmutable` A cache-control directive configuration. - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirective struct{…}` Set the directive. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective struct{…}` Remove the directive. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `MaxAge RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAge` A cache-control directive configuration that accepts a duration value in seconds. - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective struct{…}` Set the directive with a duration value in seconds. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation = "remove"` - `Value int64` The duration value in seconds for the directive. - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective struct{…}` Remove the directive. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `MustRevalidate RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidate` A cache-control directive configuration. - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective struct{…}` Set the directive. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective struct{…}` Remove the directive. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `MustUnderstand RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstand` A cache-control directive configuration. - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective struct{…}` Set the directive. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective struct{…}` Remove the directive. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `NoCache RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoCache` A cache-control directive configuration that accepts optional qualifiers (header names). - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective struct{…}` Set the directive with optional qualifiers. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `Qualifiers []string` Optional list of header names to qualify the directive (e.g., for "private" or "no-cache" directives). - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective struct{…}` Remove the directive. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `NoStore RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoStore` A cache-control directive configuration. - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective struct{…}` Set the directive. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective struct{…}` Remove the directive. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `NoTransform RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransform` A cache-control directive configuration. - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective struct{…}` Set the directive. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective struct{…}` Remove the directive. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `Private RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPrivate` A cache-control directive configuration that accepts optional qualifiers (header names). - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirective struct{…}` Set the directive with optional qualifiers. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `Qualifiers []string` Optional list of header names to qualify the directive (e.g., for "private" or "no-cache" directives). - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective struct{…}` Remove the directive. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `ProxyRevalidate RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidate` A cache-control directive configuration. - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective struct{…}` Set the directive. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective struct{…}` Remove the directive. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `Public RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPublic` A cache-control directive configuration. - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirective struct{…}` Set the directive. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective struct{…}` Remove the directive. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `SMaxage RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxage` A cache-control directive configuration that accepts a duration value in seconds. - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective struct{…}` Set the directive with a duration value in seconds. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation = "remove"` - `Value int64` The duration value in seconds for the directive. - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective struct{…}` Remove the directive. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `StaleIfError RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfError` A cache-control directive configuration that accepts a duration value in seconds. - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective struct{…}` Set the directive with a duration value in seconds. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation = "remove"` - `Value int64` The duration value in seconds for the directive. - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective struct{…}` Remove the directive. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `StaleWhileRevalidate RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate` A cache-control directive configuration that accepts a duration value in seconds. - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective struct{…}` Set the directive with a duration value in seconds. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation = "remove"` - `Value int64` The duration value in seconds for the directive. - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective struct{…}` Remove the directive. - `Operation RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperationSet RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation = "set"` - `const RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperationRemove RuleEditResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RuleEditResponseRulesRulesetsSetCacheControlRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit RuleEditResponseRulesRulesetsSetCacheControlRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type SetCacheSettingsRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action SetCacheSettingsRuleAction` The action to perform when the rule matches. - `const SetCacheSettingsRuleActionSetCacheSettings SetCacheSettingsRuleAction = "set_cache_settings"` - `ActionParameters SetCacheSettingsRuleActionParameters` The parameters configuring the rule's action. - `AdditionalCacheablePorts []int64` A list of additional ports that caching should be enabled on. - `BrowserTTL SetCacheSettingsRuleActionParametersBrowserTTL` How long client browsers should cache the response. Cloudflare cache purge will not purge content cached on client browsers, so high browser TTLs may lead to stale content. - `Mode SetCacheSettingsRuleActionParametersBrowserTTLMode` The browser TTL mode. - `const SetCacheSettingsRuleActionParametersBrowserTTLModeRespectOrigin SetCacheSettingsRuleActionParametersBrowserTTLMode = "respect_origin"` - `const SetCacheSettingsRuleActionParametersBrowserTTLModeBypassByDefault SetCacheSettingsRuleActionParametersBrowserTTLMode = "bypass_by_default"` - `const SetCacheSettingsRuleActionParametersBrowserTTLModeOverrideOrigin SetCacheSettingsRuleActionParametersBrowserTTLMode = "override_origin"` - `const SetCacheSettingsRuleActionParametersBrowserTTLModeBypass SetCacheSettingsRuleActionParametersBrowserTTLMode = "bypass"` - `Default int64` The browser TTL (in seconds) if you choose the "override_origin" mode. - `Cache bool` Whether the request's response from the origin is eligible for caching. Caching itself will still depend on the cache control header and your other caching configurations. - `CacheKey SetCacheSettingsRuleActionParametersCacheKey` Which components of the request are included in or excluded from the cache key Cloudflare uses to store the response in cache. - `CacheByDeviceType bool` Whether to separate cached content based on the visitor's device type. - `CacheDeceptionArmor bool` Whether to protect from web cache deception attacks, while allowing static assets to be cached. - `CustomKey SetCacheSettingsRuleActionParametersCacheKeyCustomKey` Which components of the request are included or excluded from the cache key. - `Cookie SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookie` Which cookies to include in the cache key. - `CheckPresence []string` A list of cookies to check for the presence of. The presence of these cookies is included in the cache key. - `Include []string` A list of cookies to include in the cache key. - `Header SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader` Which headers to include in the cache key. - `CheckPresence []string` A list of headers to check for the presence of. The presence of these headers is included in the cache key. - `Contains map[string, []string]` A mapping of header names to a list of values. If a header is present in the request and contains any of the values provided, its value is included in the cache key. - `ExcludeOrigin bool` Whether to exclude the origin header in the cache key. - `Include []string` A list of headers to include in the cache key. - `Host SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost` How to use the host in the cache key. - `Resolved bool` Whether to use the resolved host in the cache key. - `QueryString SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString` Which query string parameters to include in or exclude from the cache key. - `Exclude SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude` Which query string parameters to exclude from the cache key. - `All SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeAll` Whether to exclude all query string parameters from the cache key. - `const SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeAllTrue SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeAll = true` - `List []string` A list of query string parameters to exclude from the cache key. - `Include SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude` Which query string parameters to include in the cache key. - `All SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeAll` Whether to include all query string parameters in the cache key. - `const SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeAllTrue SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeAll = true` - `List []string` A list of query string parameters to include in the cache key. - `User SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser` How to use characteristics of the request user agent in the cache key. - `DeviceType bool` Whether to use the user agent's device type in the cache key. - `Geo bool` Whether to use the user agents's country in the cache key. - `Lang bool` Whether to use the user agent's language in the cache key. - `IgnoreQueryStringsOrder bool` Whether to treat requests with the same query parameters the same, regardless of the order those query parameters are in. - `CacheReserve SetCacheSettingsRuleActionParametersCacheReserve` Settings to determine whether the request's response from origin is eligible for Cache Reserve (requires a Cache Reserve add-on plan). - `Eligible bool` Whether Cache Reserve is enabled. If this is true and a request meets eligibility criteria, Cloudflare will write the resource to Cache Reserve. - `MinimumFileSize int64` The minimum file size eligible for storage in Cache Reserve. - `EdgeTTL SetCacheSettingsRuleActionParametersEdgeTTL` How long the Cloudflare edge network should cache the response. - `Mode SetCacheSettingsRuleActionParametersEdgeTTLMode` The edge TTL mode. - `const SetCacheSettingsRuleActionParametersEdgeTTLModeRespectOrigin SetCacheSettingsRuleActionParametersEdgeTTLMode = "respect_origin"` - `const SetCacheSettingsRuleActionParametersEdgeTTLModeBypassByDefault SetCacheSettingsRuleActionParametersEdgeTTLMode = "bypass_by_default"` - `const SetCacheSettingsRuleActionParametersEdgeTTLModeOverrideOrigin SetCacheSettingsRuleActionParametersEdgeTTLMode = "override_origin"` - `Default int64` The edge TTL (in seconds) if you choose the "override_origin" mode. - `StatusCodeTTL []SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL` A list of TTLs to apply to specific status codes or status code ranges. - `Value int64` The time to cache the response for (in seconds). A value of 0 is equivalent to setting the cache control header with the value "no-cache". A value of -1 is equivalent to setting the cache control header with the value of "no-store". - `StatusCode int64` A single status code to apply the TTL to. - `StatusCodeRange SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRange` A range of status codes to apply the TTL to. - `From int64` The lower bound of the range. - `To int64` The upper bound of the range. - `OriginCacheControl bool` Whether Cloudflare will aim to strictly adhere to RFC 7234. - `OriginErrorPagePassthru bool` Whether to generate Cloudflare error pages for issues from the origin server. - `ReadTimeout int64` A timeout value between two successive read operations to use for your origin server. Historically, the timeout value between two read options from Cloudflare to an origin server is 100 seconds. If you are attempting to reduce HTTP 524 errors because of timeouts from an origin server, try increasing this timeout value. - `RespectStrongEtags bool` Whether Cloudflare should respect strong ETag (entity tag) headers. If false, Cloudflare converts strong ETag headers to weak ETag headers. - `ServeStale SetCacheSettingsRuleActionParametersServeStale` When to serve stale content from cache. - `DisableStaleWhileUpdating bool` Whether Cloudflare should disable serving stale content while getting the latest content from the origin. - `SharedDictionary SetCacheSettingsRuleActionParametersSharedDictionary` Configuration for shared dictionary compression. When set, Cloudflare injects Use-As-Dictionary headers on matching cacheable responses. - `MatchPattern string` URL pattern for the Use-As-Dictionary match field. This pattern specifies which URLs can use this response as a dictionary. - `StripEtags bool` Whether to strip ETag headers from the origin response before caching. - `StripLastModified bool` Whether to strip Last-Modified headers from the origin response before caching. - `StripSetCookie bool` Whether to strip Set-Cookie headers from the origin response before caching. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck SetCacheSettingsRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit SetCacheSettingsRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type RuleEditResponseRulesRulesetsSetCacheTagsRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RuleEditResponseRulesRulesetsSetCacheTagsRuleAction` The action to perform when the rule matches. - `const RuleEditResponseRulesRulesetsSetCacheTagsRuleActionSetCacheTags RuleEditResponseRulesRulesetsSetCacheTagsRuleAction = "set_cache_tags"` - `ActionParameters RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParameters` The parameters configuring the rule's action. - `type RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues struct{…}` Add cache tags using a list of values. - `Operation RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation` The operation to perform on the cache tags. - `const RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationAdd RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "add"` - `const RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationRemove RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "remove"` - `const RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationSet RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "set"` - `Values []string` A list of cache tag values. - `type RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression struct{…}` Add cache tags using an expression. - `Expression string` An expression that evaluates to an array of cache tag values. - `Operation RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation` The operation to perform on the cache tags. - `const RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationAdd RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "add"` - `const RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationRemove RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "remove"` - `const RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationSet RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "set"` - `type RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues struct{…}` Remove cache tags using a list of values. - `Operation RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation` The operation to perform on the cache tags. - `const RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationAdd RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "add"` - `const RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationRemove RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "remove"` - `const RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationSet RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "set"` - `Values []string` A list of cache tag values. - `type RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression struct{…}` Remove cache tags using an expression. - `Expression string` An expression that evaluates to an array of cache tag values. - `Operation RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation` The operation to perform on the cache tags. - `const RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationAdd RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "add"` - `const RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationRemove RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "remove"` - `const RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationSet RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "set"` - `type RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues struct{…}` Set cache tags using a list of values. - `Operation RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation` The operation to perform on the cache tags. - `const RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationAdd RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "add"` - `const RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationRemove RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "remove"` - `const RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationSet RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "set"` - `Values []string` A list of cache tag values. - `type RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression struct{…}` Set cache tags using an expression. - `Expression string` An expression that evaluates to an array of cache tag values. - `Operation RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation` The operation to perform on the cache tags. - `const RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationAdd RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "add"` - `const RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationRemove RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "remove"` - `const RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationSet RuleEditResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "set"` - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RuleEditResponseRulesRulesetsSetCacheTagsRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit RuleEditResponseRulesRulesetsSetCacheTagsRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type SetConfigRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action SetConfigRuleAction` The action to perform when the rule matches. - `const SetConfigRuleActionSetConfig SetConfigRuleAction = "set_config"` - `ActionParameters SetConfigRuleActionParameters` The parameters configuring the rule's action. - `AutomaticHTTPSRewrites bool` Whether to enable Automatic HTTPS Rewrites. - `Autominify SetConfigRuleActionParametersAutominify` Which file extensions to minify automatically. - `CSS bool` Whether to minify CSS files. - `HTML bool` Whether to minify HTML files. - `JS bool` Whether to minify JavaScript files. - `BIC bool` Whether to enable Browser Integrity Check (BIC). - `ContentConverter bool` Whether to enable content conversion (e.g., HTML to Markdown). - `DisableApps SetConfigRuleActionParametersDisableApps` Whether to disable Cloudflare Apps. - `const SetConfigRuleActionParametersDisableAppsTrue SetConfigRuleActionParametersDisableApps = true` - `DisablePayPerCrawl SetConfigRuleActionParametersDisablePayPerCrawl` Whether to disable Pay Per Crawl. - `const SetConfigRuleActionParametersDisablePayPerCrawlTrue SetConfigRuleActionParametersDisablePayPerCrawl = true` - `DisableRUM SetConfigRuleActionParametersDisableRUM` Whether to disable Real User Monitoring (RUM). - `const SetConfigRuleActionParametersDisableRUMTrue SetConfigRuleActionParametersDisableRUM = true` - `DisableZaraz SetConfigRuleActionParametersDisableZaraz` Whether to disable Zaraz. - `const SetConfigRuleActionParametersDisableZarazTrue SetConfigRuleActionParametersDisableZaraz = true` - `EmailObfuscation bool` Whether to enable Email Obfuscation. - `Fonts bool` Whether to enable Cloudflare Fonts. - `HotlinkProtection bool` Whether to enable Hotlink Protection. - `Mirage bool` Whether to enable Mirage. - `OpportunisticEncryption bool` Whether to enable Opportunistic Encryption. - `Polish SetConfigRuleActionParametersPolish` The Polish level to configure. - `const SetConfigRuleActionParametersPolishOff SetConfigRuleActionParametersPolish = "off"` - `const SetConfigRuleActionParametersPolishLossless SetConfigRuleActionParametersPolish = "lossless"` - `const SetConfigRuleActionParametersPolishLossy SetConfigRuleActionParametersPolish = "lossy"` - `const SetConfigRuleActionParametersPolishWebP SetConfigRuleActionParametersPolish = "webp"` - `RedirectsForAITraining bool` Whether to redirect verified AI training crawlers to canonical URLs found in the HTML response. - `RequestBodyBuffering SetConfigRuleActionParametersRequestBodyBuffering` The request body buffering mode. - `const SetConfigRuleActionParametersRequestBodyBufferingNone SetConfigRuleActionParametersRequestBodyBuffering = "none"` - `const SetConfigRuleActionParametersRequestBodyBufferingStandard SetConfigRuleActionParametersRequestBodyBuffering = "standard"` - `const SetConfigRuleActionParametersRequestBodyBufferingFull SetConfigRuleActionParametersRequestBodyBuffering = "full"` - `ResponseBodyBuffering SetConfigRuleActionParametersResponseBodyBuffering` The response body buffering mode. - `const SetConfigRuleActionParametersResponseBodyBufferingNone SetConfigRuleActionParametersResponseBodyBuffering = "none"` - `const SetConfigRuleActionParametersResponseBodyBufferingStandard SetConfigRuleActionParametersResponseBodyBuffering = "standard"` - `RocketLoader bool` Whether to enable Rocket Loader. - `SecurityLevel SetConfigRuleActionParametersSecurityLevel` The Security Level to configure. - `const SetConfigRuleActionParametersSecurityLevelOff SetConfigRuleActionParametersSecurityLevel = "off"` - `const SetConfigRuleActionParametersSecurityLevelEssentiallyOff SetConfigRuleActionParametersSecurityLevel = "essentially_off"` - `const SetConfigRuleActionParametersSecurityLevelLow SetConfigRuleActionParametersSecurityLevel = "low"` - `const SetConfigRuleActionParametersSecurityLevelMedium SetConfigRuleActionParametersSecurityLevel = "medium"` - `const SetConfigRuleActionParametersSecurityLevelHigh SetConfigRuleActionParametersSecurityLevel = "high"` - `const SetConfigRuleActionParametersSecurityLevelUnderAttack SetConfigRuleActionParametersSecurityLevel = "under_attack"` - `ServerSideExcludes bool` Whether to enable Server-Side Excludes. - `SSL SetConfigRuleActionParametersSSL` The SSL level to configure. - `const SetConfigRuleActionParametersSSLOff SetConfigRuleActionParametersSSL = "off"` - `const SetConfigRuleActionParametersSSLFlexible SetConfigRuleActionParametersSSL = "flexible"` - `const SetConfigRuleActionParametersSSLFull SetConfigRuleActionParametersSSL = "full"` - `const SetConfigRuleActionParametersSSLStrict SetConfigRuleActionParametersSSL = "strict"` - `const SetConfigRuleActionParametersSSLOriginPull SetConfigRuleActionParametersSSL = "origin_pull"` - `SXG bool` Whether to enable Signed Exchanges (SXG). - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck SetConfigRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit SetConfigRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type SkipRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action SkipRuleAction` The action to perform when the rule matches. - `const SkipRuleActionSkip SkipRuleAction = "skip"` - `ActionParameters SkipRuleActionParameters` The parameters configuring the rule's action. - `Phase SkipRuleActionParametersPhase` A phase to skip the execution of. This option is only compatible with the products option. - `const SkipRuleActionParametersPhaseCurrent SkipRuleActionParametersPhase = "current"` - `Phases []Phase` A list of phases to skip the execution of. This option is incompatible with the rulesets option. - `const PhaseDDoSL4 Phase = "ddos_l4"` - `const PhaseDDoSL7 Phase = "ddos_l7"` - `const PhaseHTTPConfigSettings Phase = "http_config_settings"` - `const PhaseHTTPCustomErrors Phase = "http_custom_errors"` - `const PhaseHTTPLogCustomFields Phase = "http_log_custom_fields"` - `const PhaseHTTPRatelimit Phase = "http_ratelimit"` - `const PhaseHTTPRequestCacheSettings Phase = "http_request_cache_settings"` - `const PhaseHTTPRequestDynamicRedirect Phase = "http_request_dynamic_redirect"` - `const PhaseHTTPRequestFirewallCustom Phase = "http_request_firewall_custom"` - `const PhaseHTTPRequestFirewallManaged Phase = "http_request_firewall_managed"` - `const PhaseHTTPRequestLateTransform Phase = "http_request_late_transform"` - `const PhaseHTTPRequestOrigin Phase = "http_request_origin"` - `const PhaseHTTPRequestRedirect Phase = "http_request_redirect"` - `const PhaseHTTPRequestSanitize Phase = "http_request_sanitize"` - `const PhaseHTTPRequestSBFM Phase = "http_request_sbfm"` - `const PhaseHTTPRequestTransform Phase = "http_request_transform"` - `const PhaseHTTPResponseCacheSettings Phase = "http_response_cache_settings"` - `const PhaseHTTPResponseCompression Phase = "http_response_compression"` - `const PhaseHTTPResponseFirewallManaged Phase = "http_response_firewall_managed"` - `const PhaseHTTPResponseHeadersTransform Phase = "http_response_headers_transform"` - `const PhaseMagicTransit Phase = "magic_transit"` - `const PhaseMagicTransitIDsManaged Phase = "magic_transit_ids_managed"` - `const PhaseMagicTransitManaged Phase = "magic_transit_managed"` - `const PhaseMagicTransitRatelimit Phase = "magic_transit_ratelimit"` - `Products []SkipRuleActionParametersProduct` A list of legacy security products to skip the execution of. - `const SkipRuleActionParametersProductBIC SkipRuleActionParametersProduct = "bic"` - `const SkipRuleActionParametersProductHot SkipRuleActionParametersProduct = "hot"` - `const SkipRuleActionParametersProductRateLimit SkipRuleActionParametersProduct = "rateLimit"` - `const SkipRuleActionParametersProductSecurityLevel SkipRuleActionParametersProduct = "securityLevel"` - `const SkipRuleActionParametersProductUABlock SkipRuleActionParametersProduct = "uaBlock"` - `const SkipRuleActionParametersProductWAF SkipRuleActionParametersProduct = "waf"` - `const SkipRuleActionParametersProductZoneLockdown SkipRuleActionParametersProduct = "zoneLockdown"` - `Rules map[string, []string]` A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the execution of. This option is incompatible with the ruleset option. - `Ruleset SkipRuleActionParametersRuleset` A ruleset to skip the execution of. This option is incompatible with the rulesets option. - `const SkipRuleActionParametersRulesetCurrent SkipRuleActionParametersRuleset = "current"` - `Rulesets []string` A list of ruleset IDs to skip the execution of. This option is incompatible with the ruleset and phases options. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck SkipRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit SkipRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `Version string` The version of the ruleset. - `Description string` An informative description of the ruleset. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/rulesets" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.Rulesets.Rules.Edit( context.TODO(), "2f2feab2026849078ba485f918791bdc", "3a03d665bac047339bb530ecb439a90d", rulesets.RuleEditParams{ Body: rulesets.RuleEditParamsBodyBlockRule(rulesets.RuleEditParamsBodyBlockRule{ BlockRuleParam: rulesets.BlockRuleParam{ }, }), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.ID) } ``` #### Response ```json { "errors": [ { "message": "something bad happened", "code": 10000, "source": { "pointer": "/rules/0/action" } } ], "messages": [ { "message": "something bad happened", "code": 10000, "source": { "pointer": "/rules/0/action" } } ], "result": { "id": "2f2feab2026849078ba485f918791bdc", "kind": "root", "last_updated": "2000-01-01T00:00:00.000000Z", "name": "My ruleset", "phase": "http_request_firewall_custom", "rules": [ { "last_updated": "2000-01-01T00:00:00.000000Z", "version": "1", "id": "3a03d665bac047339bb530ecb439a90d", "action": "block", "action_parameters": { "response": { "content": "{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}", "content_type": "application/json", "status_code": 400 } }, "categories": [ "directory-traversal" ], "description": "Block the request.", "enabled": true, "exposed_credential_check": { "password_expression": "url_decode(http.request.body.form[\\\"password\\\"][0])", "username_expression": "url_decode(http.request.body.form[\\\"username\\\"][0])" }, "expression": "ip.src eq 1.1.1.1", "logging": { "enabled": true }, "ratelimit": { "characteristics": [ "cf.colo.id" ], "period": 60, "counting_expression": "http.request.body.raw eq \"abcd\"", "mitigation_timeout": 600, "requests_per_period": 1000, "requests_to_origin": true, "score_per_period": 400, "score_response_header_name": "my-score" }, "ref": "my_ref" } ], "version": "1", "description": "A description for my ruleset." }, "success": true } ``` ## Delete an account or zone ruleset rule `client.Rulesets.Rules.Delete(ctx, rulesetID, ruleID, body) (*RuleDeleteResponse, error)` **delete** `/{accounts_or_zones}/{account_or_zone_id}/rulesets/{ruleset_id}/rules/{rule_id}` Deletes an existing rule from an account or zone ruleset. ### Parameters - `rulesetID string` The unique ID of the ruleset. - `ruleID string` The unique ID of the rule. - `body RuleDeleteParams` - `AccountID param.Field[string]` The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. - `ZoneID param.Field[string]` The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. ### Returns - `type RuleDeleteResponse struct{…}` A ruleset object. - `ID string` The unique ID of the ruleset. - `Kind Kind` The kind of the ruleset. - `const KindManaged Kind = "managed"` - `const KindCustom Kind = "custom"` - `const KindRoot Kind = "root"` - `const KindZone Kind = "zone"` - `LastUpdated Time` The timestamp of when the ruleset was last modified. - `Name string` The human-readable name of the ruleset. - `Phase Phase` The phase of the ruleset. - `const PhaseDDoSL4 Phase = "ddos_l4"` - `const PhaseDDoSL7 Phase = "ddos_l7"` - `const PhaseHTTPConfigSettings Phase = "http_config_settings"` - `const PhaseHTTPCustomErrors Phase = "http_custom_errors"` - `const PhaseHTTPLogCustomFields Phase = "http_log_custom_fields"` - `const PhaseHTTPRatelimit Phase = "http_ratelimit"` - `const PhaseHTTPRequestCacheSettings Phase = "http_request_cache_settings"` - `const PhaseHTTPRequestDynamicRedirect Phase = "http_request_dynamic_redirect"` - `const PhaseHTTPRequestFirewallCustom Phase = "http_request_firewall_custom"` - `const PhaseHTTPRequestFirewallManaged Phase = "http_request_firewall_managed"` - `const PhaseHTTPRequestLateTransform Phase = "http_request_late_transform"` - `const PhaseHTTPRequestOrigin Phase = "http_request_origin"` - `const PhaseHTTPRequestRedirect Phase = "http_request_redirect"` - `const PhaseHTTPRequestSanitize Phase = "http_request_sanitize"` - `const PhaseHTTPRequestSBFM Phase = "http_request_sbfm"` - `const PhaseHTTPRequestTransform Phase = "http_request_transform"` - `const PhaseHTTPResponseCacheSettings Phase = "http_response_cache_settings"` - `const PhaseHTTPResponseCompression Phase = "http_response_compression"` - `const PhaseHTTPResponseFirewallManaged Phase = "http_response_firewall_managed"` - `const PhaseHTTPResponseHeadersTransform Phase = "http_response_headers_transform"` - `const PhaseMagicTransit Phase = "magic_transit"` - `const PhaseMagicTransitIDsManaged Phase = "magic_transit_ids_managed"` - `const PhaseMagicTransitManaged Phase = "magic_transit_managed"` - `const PhaseMagicTransitRatelimit Phase = "magic_transit_ratelimit"` - `Rules []RuleDeleteResponseRule` The list of rules in the ruleset. - `type BlockRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action BlockRuleAction` The action to perform when the rule matches. - `const BlockRuleActionBlock BlockRuleAction = "block"` - `ActionParameters BlockRuleActionParameters` The parameters configuring the rule's action. - `Response BlockRuleActionParametersResponse` The response to show when the block is applied. - `Content string` The content to return. - `ContentType string` The type of the content to return. - `StatusCode int64` The status code to return. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck BlockRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Enabled bool` Whether to generate a log when the rule matches. - `Ratelimit BlockRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type RuleDeleteResponseRulesRulesetsChallengeRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RuleDeleteResponseRulesRulesetsChallengeRuleAction` The action to perform when the rule matches. - `const RuleDeleteResponseRulesRulesetsChallengeRuleActionChallenge RuleDeleteResponseRulesRulesetsChallengeRuleAction = "challenge"` - `ActionParameters unknown` The parameters configuring the rule's action. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RuleDeleteResponseRulesRulesetsChallengeRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit RuleDeleteResponseRulesRulesetsChallengeRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type CompressResponseRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action CompressResponseRuleAction` The action to perform when the rule matches. - `const CompressResponseRuleActionCompressResponse CompressResponseRuleAction = "compress_response"` - `ActionParameters CompressResponseRuleActionParameters` The parameters configuring the rule's action. - `Algorithms []CompressResponseRuleActionParametersAlgorithm` Custom order for compression algorithms. - `Name CompressResponseRuleActionParametersAlgorithmsName` Name of the compression algorithm to enable. - `const CompressResponseRuleActionParametersAlgorithmsNameNone CompressResponseRuleActionParametersAlgorithmsName = "none"` - `const CompressResponseRuleActionParametersAlgorithmsNameAuto CompressResponseRuleActionParametersAlgorithmsName = "auto"` - `const CompressResponseRuleActionParametersAlgorithmsNameDefault CompressResponseRuleActionParametersAlgorithmsName = "default"` - `const CompressResponseRuleActionParametersAlgorithmsNameGzip CompressResponseRuleActionParametersAlgorithmsName = "gzip"` - `const CompressResponseRuleActionParametersAlgorithmsNameBrotli CompressResponseRuleActionParametersAlgorithmsName = "brotli"` - `const CompressResponseRuleActionParametersAlgorithmsNameZstd CompressResponseRuleActionParametersAlgorithmsName = "zstd"` - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck CompressResponseRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit CompressResponseRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type DDoSDynamicRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action DDoSDynamicRuleAction` The action to perform when the rule matches. - `const DDoSDynamicRuleActionDDoSDynamic DDoSDynamicRuleAction = "ddos_dynamic"` - `ActionParameters unknown` The parameters configuring the rule's action. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck DDoSDynamicRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit DDoSDynamicRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type ExecuteRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action ExecuteRuleAction` The action to perform when the rule matches. - `const ExecuteRuleActionExecute ExecuteRuleAction = "execute"` - `ActionParameters ExecuteRuleActionParameters` The parameters configuring the rule's action. - `ID string` The ID of the ruleset to execute. - `MatchedData ExecuteRuleActionParametersMatchedData` The configuration to use for matched data logging. - `PublicKey string` The public key to encrypt matched data logs with. - `Overrides ExecuteRuleActionParametersOverrides` A set of overrides to apply to the target ruleset. - `Action string` An action to override all rules with. This option has lower precedence than rule and category overrides. - `Categories []ExecuteRuleActionParametersOverridesCategory` A list of category-level overrides. This option has the second-highest precedence after rule-level overrides. - `Category string` The name of the category to override. - `Action string` The action to override rules in the category with. - `Enabled bool` Whether to enable execution of rules in the category. - `SensitivityLevel ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel` The sensitivity level to use for rules in the category. This option is only applicable for DDoS phases. - `const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"` - `const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"` - `const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"` - `const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"` - `Enabled bool` Whether to enable execution of all rules. This option has lower precedence than rule and category overrides. - `Rules []ExecuteRuleActionParametersOverridesRule` A list of rule-level overrides. This option has the highest precedence. - `ID string` The ID of the rule to override. - `Action string` The action to override the rule with. - `Enabled bool` Whether to enable execution of the rule. - `ScoreThreshold int64` The score threshold to use for the rule. - `SensitivityLevel ExecuteRuleActionParametersOverridesRulesSensitivityLevel` The sensitivity level to use for the rule. This option is only applicable for DDoS phases. - `const ExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"` - `const ExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"` - `const ExecuteRuleActionParametersOverridesRulesSensitivityLevelLow ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"` - `const ExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"` - `SensitivityLevel ExecuteRuleActionParametersOverridesSensitivityLevel` A sensitivity level to set for all rules. This option has lower precedence than rule and category overrides and is only applicable for DDoS phases. - `const ExecuteRuleActionParametersOverridesSensitivityLevelDefault ExecuteRuleActionParametersOverridesSensitivityLevel = "default"` - `const ExecuteRuleActionParametersOverridesSensitivityLevelMedium ExecuteRuleActionParametersOverridesSensitivityLevel = "medium"` - `const ExecuteRuleActionParametersOverridesSensitivityLevelLow ExecuteRuleActionParametersOverridesSensitivityLevel = "low"` - `const ExecuteRuleActionParametersOverridesSensitivityLevelEoff ExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"` - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck ExecuteRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit ExecuteRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type ForceConnectionCloseRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action ForceConnectionCloseRuleAction` The action to perform when the rule matches. - `const ForceConnectionCloseRuleActionForceConnectionClose ForceConnectionCloseRuleAction = "force_connection_close"` - `ActionParameters unknown` The parameters configuring the rule's action. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck ForceConnectionCloseRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit ForceConnectionCloseRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type RuleDeleteResponseRulesRulesetsJSChallengeRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RuleDeleteResponseRulesRulesetsJSChallengeRuleAction` The action to perform when the rule matches. - `const RuleDeleteResponseRulesRulesetsJSChallengeRuleActionJSChallenge RuleDeleteResponseRulesRulesetsJSChallengeRuleAction = "js_challenge"` - `ActionParameters unknown` The parameters configuring the rule's action. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RuleDeleteResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit RuleDeleteResponseRulesRulesetsJSChallengeRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type LogRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action LogRuleAction` The action to perform when the rule matches. - `const LogRuleActionLog LogRuleAction = "log"` - `ActionParameters unknown` The parameters configuring the rule's action. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck LogRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit LogRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type LogCustomFieldRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action LogCustomFieldRuleAction` The action to perform when the rule matches. - `const LogCustomFieldRuleActionLogCustomField LogCustomFieldRuleAction = "log_custom_field"` - `ActionParameters LogCustomFieldRuleActionParameters` The parameters configuring the rule's action. - `CookieFields []LogCustomFieldRuleActionParametersCookieField` The cookie fields to log. - `Name string` The name of the cookie. - `RawResponseFields []LogCustomFieldRuleActionParametersRawResponseField` The raw response fields to log. - `Name string` The name of the response header. - `PreserveDuplicates bool` Whether to log duplicate values of the same header. - `RequestFields []LogCustomFieldRuleActionParametersRequestField` The raw request fields to log. - `Name string` The name of the header. - `ResponseFields []LogCustomFieldRuleActionParametersResponseField` The transformed response fields to log. - `Name string` The name of the response header. - `PreserveDuplicates bool` Whether to log duplicate values of the same header. - `TransformedRequestFields []LogCustomFieldRuleActionParametersTransformedRequestField` The transformed request fields to log. - `Name string` The name of the header. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck LogCustomFieldRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit LogCustomFieldRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type ManagedChallengeRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action ManagedChallengeRuleAction` The action to perform when the rule matches. - `const ManagedChallengeRuleActionManagedChallenge ManagedChallengeRuleAction = "managed_challenge"` - `ActionParameters unknown` The parameters configuring the rule's action. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck ManagedChallengeRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit ManagedChallengeRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type RedirectRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RedirectRuleAction` The action to perform when the rule matches. - `const RedirectRuleActionRedirect RedirectRuleAction = "redirect"` - `ActionParameters RedirectRuleActionParameters` The parameters configuring the rule's action. - `FromList RedirectRuleActionParametersFromList` A redirect based on a bulk list lookup. - `Key string` An expression that evaluates to the list lookup key. - `Name string` The name of the list to match against. - `FromValue RedirectRuleActionParametersFromValue` A redirect based on the request properties. - `TargetURL RedirectRuleActionParametersFromValueTargetURL` A URL to redirect the request to. - `Expression string` An expression that evaluates to a URL to redirect the request to. - `Value string` A URL to redirect the request to. - `PreserveQueryString bool` Whether to keep the query string of the original request. - `StatusCode RedirectRuleActionParametersFromValueStatusCode` The status code to use for the redirect. - `const RedirectRuleActionParametersFromValueStatusCode301 RedirectRuleActionParametersFromValueStatusCode = 301` - `const RedirectRuleActionParametersFromValueStatusCode302 RedirectRuleActionParametersFromValueStatusCode = 302` - `const RedirectRuleActionParametersFromValueStatusCode303 RedirectRuleActionParametersFromValueStatusCode = 303` - `const RedirectRuleActionParametersFromValueStatusCode307 RedirectRuleActionParametersFromValueStatusCode = 307` - `const RedirectRuleActionParametersFromValueStatusCode308 RedirectRuleActionParametersFromValueStatusCode = 308` - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RedirectRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit RedirectRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type RewriteRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RewriteRuleAction` The action to perform when the rule matches. - `const RewriteRuleActionRewrite RewriteRuleAction = "rewrite"` - `ActionParameters RewriteRuleActionParameters` The parameters configuring the rule's action. - `Headers map[string, RewriteRuleActionParametersHeader]` A map of headers to rewrite. - `type RewriteRuleActionParametersHeadersAddStaticHeader struct{…}` A header with a static value to add. - `Operation RewriteRuleActionParametersHeadersAddStaticHeaderOperation` The operation to perform on the header. - `const RewriteRuleActionParametersHeadersAddStaticHeaderOperationAdd RewriteRuleActionParametersHeadersAddStaticHeaderOperation = "add"` - `Value string` A static value for the header. - `type RewriteRuleActionParametersHeadersAddDynamicHeader struct{…}` A header with a dynamic value to add. - `Expression string` An expression that evaluates to a value for the header. - `Operation RewriteRuleActionParametersHeadersAddDynamicHeaderOperation` The operation to perform on the header. - `const RewriteRuleActionParametersHeadersAddDynamicHeaderOperationAdd RewriteRuleActionParametersHeadersAddDynamicHeaderOperation = "add"` - `type RewriteRuleActionParametersHeadersSetStaticHeader struct{…}` A header with a static value to set. - `Operation RewriteRuleActionParametersHeadersSetStaticHeaderOperation` The operation to perform on the header. - `const RewriteRuleActionParametersHeadersSetStaticHeaderOperationSet RewriteRuleActionParametersHeadersSetStaticHeaderOperation = "set"` - `Value string` A static value for the header. - `type RewriteRuleActionParametersHeadersSetDynamicHeader struct{…}` A header with a dynamic value to set. - `Expression string` An expression that evaluates to a value for the header. - `Operation RewriteRuleActionParametersHeadersSetDynamicHeaderOperation` The operation to perform on the header. - `const RewriteRuleActionParametersHeadersSetDynamicHeaderOperationSet RewriteRuleActionParametersHeadersSetDynamicHeaderOperation = "set"` - `type RewriteRuleActionParametersHeadersRemoveHeader struct{…}` A header to remove. - `Operation RewriteRuleActionParametersHeadersRemoveHeaderOperation` The operation to perform on the header. - `const RewriteRuleActionParametersHeadersRemoveHeaderOperationRemove RewriteRuleActionParametersHeadersRemoveHeaderOperation = "remove"` - `URI RewriteRuleActionParametersURI` A URI path rewrite. - `type RewriteRuleActionParametersURIURIPath struct{…}` A URI path rewrite. - `Path RewriteRuleActionParametersURIURIPathPath` A URI path rewrite. - `Expression string` An expression that evaluates to a value to rewrite the URI path to. - `Value string` A value to rewrite the URI path to. - `Origin bool` Whether to propagate the rewritten URI to origin. - `type RewriteRuleActionParametersURIURIQuery struct{…}` A URI query rewrite. - `Query RewriteRuleActionParametersURIURIQueryQuery` A URI query rewrite. - `Expression string` An expression that evaluates to a value to rewrite the URI query to. - `Value string` A value to rewrite the URI query to. - `Origin bool` Whether to propagate the rewritten URI to origin. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RewriteRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit RewriteRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type RouteRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RouteRuleAction` The action to perform when the rule matches. - `const RouteRuleActionRoute RouteRuleAction = "route"` - `ActionParameters RouteRuleActionParameters` The parameters configuring the rule's action. - `HostHeader string` A value to rewrite the HTTP host header to. - `Origin RouteRuleActionParametersOrigin` An origin to route to. - `Host string` A resolved host to route to. - `Port int64` A destination port to route to. - `SNI RouteRuleActionParametersSNI` A Server Name Indication (SNI) override. - `Value string` A value to override the SNI to. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RouteRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit RouteRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type ScoreRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action ScoreRuleAction` The action to perform when the rule matches. - `const ScoreRuleActionScore ScoreRuleAction = "score"` - `ActionParameters ScoreRuleActionParameters` The parameters configuring the rule's action. - `Increment int64` A delta to change the score by, which can be either positive or negative. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck ScoreRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit ScoreRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type ServeErrorRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action ServeErrorRuleAction` The action to perform when the rule matches. - `const ServeErrorRuleActionServeError ServeErrorRuleAction = "serve_error"` - `ActionParameters ServeErrorRuleActionParameters` The parameters configuring the rule's action. - `type ServeErrorRuleActionParametersActionParametersContent struct{…}` - `Content string` The response content. - `ContentType ServeErrorRuleActionParametersActionParametersContentContentType` The content type header to set with the error response. - `const ServeErrorRuleActionParametersActionParametersContentContentTypeApplicationJson ServeErrorRuleActionParametersActionParametersContentContentType = "application/json"` - `const ServeErrorRuleActionParametersActionParametersContentContentTypeTextHTML ServeErrorRuleActionParametersActionParametersContentContentType = "text/html"` - `const ServeErrorRuleActionParametersActionParametersContentContentTypeTextPlain ServeErrorRuleActionParametersActionParametersContentContentType = "text/plain"` - `const ServeErrorRuleActionParametersActionParametersContentContentTypeTextXml ServeErrorRuleActionParametersActionParametersContentContentType = "text/xml"` - `StatusCode int64` The status code to use for the error. - `type ServeErrorRuleActionParametersActionParametersAsset struct{…}` - `AssetName string` The name of a custom asset to serve as the error response. - `ContentType ServeErrorRuleActionParametersActionParametersAssetContentType` The content type header to set with the error response. - `const ServeErrorRuleActionParametersActionParametersAssetContentTypeApplicationJson ServeErrorRuleActionParametersActionParametersAssetContentType = "application/json"` - `const ServeErrorRuleActionParametersActionParametersAssetContentTypeTextHTML ServeErrorRuleActionParametersActionParametersAssetContentType = "text/html"` - `const ServeErrorRuleActionParametersActionParametersAssetContentTypeTextPlain ServeErrorRuleActionParametersActionParametersAssetContentType = "text/plain"` - `const ServeErrorRuleActionParametersActionParametersAssetContentTypeTextXml ServeErrorRuleActionParametersActionParametersAssetContentType = "text/xml"` - `StatusCode int64` The status code to use for the error. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck ServeErrorRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit ServeErrorRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type RuleDeleteResponseRulesRulesetsSetCacheControlRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RuleDeleteResponseRulesRulesetsSetCacheControlRuleAction` The action to perform when the rule matches. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionSetCacheControl RuleDeleteResponseRulesRulesetsSetCacheControlRuleAction = "set_cache_control"` - `ActionParameters RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParameters` The parameters configuring the rule's action. - `Immutable RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersImmutable` A cache-control directive configuration. - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirective struct{…}` Set the directive. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective struct{…}` Remove the directive. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `MaxAge RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAge` A cache-control directive configuration that accepts a duration value in seconds. - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective struct{…}` Set the directive with a duration value in seconds. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation = "remove"` - `Value int64` The duration value in seconds for the directive. - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective struct{…}` Remove the directive. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `MustRevalidate RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidate` A cache-control directive configuration. - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective struct{…}` Set the directive. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective struct{…}` Remove the directive. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `MustUnderstand RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstand` A cache-control directive configuration. - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective struct{…}` Set the directive. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective struct{…}` Remove the directive. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `NoCache RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoCache` A cache-control directive configuration that accepts optional qualifiers (header names). - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective struct{…}` Set the directive with optional qualifiers. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `Qualifiers []string` Optional list of header names to qualify the directive (e.g., for "private" or "no-cache" directives). - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective struct{…}` Remove the directive. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `NoStore RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoStore` A cache-control directive configuration. - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective struct{…}` Set the directive. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective struct{…}` Remove the directive. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `NoTransform RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransform` A cache-control directive configuration. - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective struct{…}` Set the directive. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective struct{…}` Remove the directive. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `Private RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPrivate` A cache-control directive configuration that accepts optional qualifiers (header names). - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirective struct{…}` Set the directive with optional qualifiers. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `Qualifiers []string` Optional list of header names to qualify the directive (e.g., for "private" or "no-cache" directives). - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective struct{…}` Remove the directive. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `ProxyRevalidate RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidate` A cache-control directive configuration. - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective struct{…}` Set the directive. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective struct{…}` Remove the directive. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `Public RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPublic` A cache-control directive configuration. - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirective struct{…}` Set the directive. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective struct{…}` Remove the directive. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `SMaxage RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxage` A cache-control directive configuration that accepts a duration value in seconds. - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective struct{…}` Set the directive with a duration value in seconds. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation = "remove"` - `Value int64` The duration value in seconds for the directive. - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective struct{…}` Remove the directive. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `StaleIfError RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfError` A cache-control directive configuration that accepts a duration value in seconds. - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective struct{…}` Set the directive with a duration value in seconds. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation = "remove"` - `Value int64` The duration value in seconds for the directive. - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective struct{…}` Remove the directive. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `StaleWhileRevalidate RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate` A cache-control directive configuration that accepts a duration value in seconds. - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective struct{…}` Set the directive with a duration value in seconds. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation = "remove"` - `Value int64` The duration value in seconds for the directive. - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `type RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective struct{…}` Remove the directive. - `Operation RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation` The operation to perform on the cache-control directive. - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperationSet RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation = "set"` - `const RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperationRemove RuleDeleteResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation = "remove"` - `CloudflareOnly bool` Whether the directive should only be applied to the Cloudflare CDN cache. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RuleDeleteResponseRulesRulesetsSetCacheControlRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit RuleDeleteResponseRulesRulesetsSetCacheControlRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type SetCacheSettingsRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action SetCacheSettingsRuleAction` The action to perform when the rule matches. - `const SetCacheSettingsRuleActionSetCacheSettings SetCacheSettingsRuleAction = "set_cache_settings"` - `ActionParameters SetCacheSettingsRuleActionParameters` The parameters configuring the rule's action. - `AdditionalCacheablePorts []int64` A list of additional ports that caching should be enabled on. - `BrowserTTL SetCacheSettingsRuleActionParametersBrowserTTL` How long client browsers should cache the response. Cloudflare cache purge will not purge content cached on client browsers, so high browser TTLs may lead to stale content. - `Mode SetCacheSettingsRuleActionParametersBrowserTTLMode` The browser TTL mode. - `const SetCacheSettingsRuleActionParametersBrowserTTLModeRespectOrigin SetCacheSettingsRuleActionParametersBrowserTTLMode = "respect_origin"` - `const SetCacheSettingsRuleActionParametersBrowserTTLModeBypassByDefault SetCacheSettingsRuleActionParametersBrowserTTLMode = "bypass_by_default"` - `const SetCacheSettingsRuleActionParametersBrowserTTLModeOverrideOrigin SetCacheSettingsRuleActionParametersBrowserTTLMode = "override_origin"` - `const SetCacheSettingsRuleActionParametersBrowserTTLModeBypass SetCacheSettingsRuleActionParametersBrowserTTLMode = "bypass"` - `Default int64` The browser TTL (in seconds) if you choose the "override_origin" mode. - `Cache bool` Whether the request's response from the origin is eligible for caching. Caching itself will still depend on the cache control header and your other caching configurations. - `CacheKey SetCacheSettingsRuleActionParametersCacheKey` Which components of the request are included in or excluded from the cache key Cloudflare uses to store the response in cache. - `CacheByDeviceType bool` Whether to separate cached content based on the visitor's device type. - `CacheDeceptionArmor bool` Whether to protect from web cache deception attacks, while allowing static assets to be cached. - `CustomKey SetCacheSettingsRuleActionParametersCacheKeyCustomKey` Which components of the request are included or excluded from the cache key. - `Cookie SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookie` Which cookies to include in the cache key. - `CheckPresence []string` A list of cookies to check for the presence of. The presence of these cookies is included in the cache key. - `Include []string` A list of cookies to include in the cache key. - `Header SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader` Which headers to include in the cache key. - `CheckPresence []string` A list of headers to check for the presence of. The presence of these headers is included in the cache key. - `Contains map[string, []string]` A mapping of header names to a list of values. If a header is present in the request and contains any of the values provided, its value is included in the cache key. - `ExcludeOrigin bool` Whether to exclude the origin header in the cache key. - `Include []string` A list of headers to include in the cache key. - `Host SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost` How to use the host in the cache key. - `Resolved bool` Whether to use the resolved host in the cache key. - `QueryString SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString` Which query string parameters to include in or exclude from the cache key. - `Exclude SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude` Which query string parameters to exclude from the cache key. - `All SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeAll` Whether to exclude all query string parameters from the cache key. - `const SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeAllTrue SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeAll = true` - `List []string` A list of query string parameters to exclude from the cache key. - `Include SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude` Which query string parameters to include in the cache key. - `All SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeAll` Whether to include all query string parameters in the cache key. - `const SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeAllTrue SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeAll = true` - `List []string` A list of query string parameters to include in the cache key. - `User SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser` How to use characteristics of the request user agent in the cache key. - `DeviceType bool` Whether to use the user agent's device type in the cache key. - `Geo bool` Whether to use the user agents's country in the cache key. - `Lang bool` Whether to use the user agent's language in the cache key. - `IgnoreQueryStringsOrder bool` Whether to treat requests with the same query parameters the same, regardless of the order those query parameters are in. - `CacheReserve SetCacheSettingsRuleActionParametersCacheReserve` Settings to determine whether the request's response from origin is eligible for Cache Reserve (requires a Cache Reserve add-on plan). - `Eligible bool` Whether Cache Reserve is enabled. If this is true and a request meets eligibility criteria, Cloudflare will write the resource to Cache Reserve. - `MinimumFileSize int64` The minimum file size eligible for storage in Cache Reserve. - `EdgeTTL SetCacheSettingsRuleActionParametersEdgeTTL` How long the Cloudflare edge network should cache the response. - `Mode SetCacheSettingsRuleActionParametersEdgeTTLMode` The edge TTL mode. - `const SetCacheSettingsRuleActionParametersEdgeTTLModeRespectOrigin SetCacheSettingsRuleActionParametersEdgeTTLMode = "respect_origin"` - `const SetCacheSettingsRuleActionParametersEdgeTTLModeBypassByDefault SetCacheSettingsRuleActionParametersEdgeTTLMode = "bypass_by_default"` - `const SetCacheSettingsRuleActionParametersEdgeTTLModeOverrideOrigin SetCacheSettingsRuleActionParametersEdgeTTLMode = "override_origin"` - `Default int64` The edge TTL (in seconds) if you choose the "override_origin" mode. - `StatusCodeTTL []SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL` A list of TTLs to apply to specific status codes or status code ranges. - `Value int64` The time to cache the response for (in seconds). A value of 0 is equivalent to setting the cache control header with the value "no-cache". A value of -1 is equivalent to setting the cache control header with the value of "no-store". - `StatusCode int64` A single status code to apply the TTL to. - `StatusCodeRange SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRange` A range of status codes to apply the TTL to. - `From int64` The lower bound of the range. - `To int64` The upper bound of the range. - `OriginCacheControl bool` Whether Cloudflare will aim to strictly adhere to RFC 7234. - `OriginErrorPagePassthru bool` Whether to generate Cloudflare error pages for issues from the origin server. - `ReadTimeout int64` A timeout value between two successive read operations to use for your origin server. Historically, the timeout value between two read options from Cloudflare to an origin server is 100 seconds. If you are attempting to reduce HTTP 524 errors because of timeouts from an origin server, try increasing this timeout value. - `RespectStrongEtags bool` Whether Cloudflare should respect strong ETag (entity tag) headers. If false, Cloudflare converts strong ETag headers to weak ETag headers. - `ServeStale SetCacheSettingsRuleActionParametersServeStale` When to serve stale content from cache. - `DisableStaleWhileUpdating bool` Whether Cloudflare should disable serving stale content while getting the latest content from the origin. - `SharedDictionary SetCacheSettingsRuleActionParametersSharedDictionary` Configuration for shared dictionary compression. When set, Cloudflare injects Use-As-Dictionary headers on matching cacheable responses. - `MatchPattern string` URL pattern for the Use-As-Dictionary match field. This pattern specifies which URLs can use this response as a dictionary. - `StripEtags bool` Whether to strip ETag headers from the origin response before caching. - `StripLastModified bool` Whether to strip Last-Modified headers from the origin response before caching. - `StripSetCookie bool` Whether to strip Set-Cookie headers from the origin response before caching. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck SetCacheSettingsRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit SetCacheSettingsRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type RuleDeleteResponseRulesRulesetsSetCacheTagsRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RuleDeleteResponseRulesRulesetsSetCacheTagsRuleAction` The action to perform when the rule matches. - `const RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionSetCacheTags RuleDeleteResponseRulesRulesetsSetCacheTagsRuleAction = "set_cache_tags"` - `ActionParameters RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParameters` The parameters configuring the rule's action. - `type RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues struct{…}` Add cache tags using a list of values. - `Operation RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation` The operation to perform on the cache tags. - `const RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationAdd RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "add"` - `const RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationRemove RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "remove"` - `const RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationSet RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "set"` - `Values []string` A list of cache tag values. - `type RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression struct{…}` Add cache tags using an expression. - `Expression string` An expression that evaluates to an array of cache tag values. - `Operation RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation` The operation to perform on the cache tags. - `const RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationAdd RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "add"` - `const RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationRemove RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "remove"` - `const RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationSet RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "set"` - `type RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues struct{…}` Remove cache tags using a list of values. - `Operation RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation` The operation to perform on the cache tags. - `const RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationAdd RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "add"` - `const RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationRemove RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "remove"` - `const RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationSet RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "set"` - `Values []string` A list of cache tag values. - `type RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression struct{…}` Remove cache tags using an expression. - `Expression string` An expression that evaluates to an array of cache tag values. - `Operation RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation` The operation to perform on the cache tags. - `const RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationAdd RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "add"` - `const RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationRemove RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "remove"` - `const RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationSet RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "set"` - `type RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues struct{…}` Set cache tags using a list of values. - `Operation RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation` The operation to perform on the cache tags. - `const RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationAdd RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "add"` - `const RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationRemove RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "remove"` - `const RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationSet RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "set"` - `Values []string` A list of cache tag values. - `type RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression struct{…}` Set cache tags using an expression. - `Expression string` An expression that evaluates to an array of cache tag values. - `Operation RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation` The operation to perform on the cache tags. - `const RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationAdd RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "add"` - `const RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationRemove RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "remove"` - `const RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationSet RuleDeleteResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "set"` - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RuleDeleteResponseRulesRulesetsSetCacheTagsRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit RuleDeleteResponseRulesRulesetsSetCacheTagsRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type SetConfigRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action SetConfigRuleAction` The action to perform when the rule matches. - `const SetConfigRuleActionSetConfig SetConfigRuleAction = "set_config"` - `ActionParameters SetConfigRuleActionParameters` The parameters configuring the rule's action. - `AutomaticHTTPSRewrites bool` Whether to enable Automatic HTTPS Rewrites. - `Autominify SetConfigRuleActionParametersAutominify` Which file extensions to minify automatically. - `CSS bool` Whether to minify CSS files. - `HTML bool` Whether to minify HTML files. - `JS bool` Whether to minify JavaScript files. - `BIC bool` Whether to enable Browser Integrity Check (BIC). - `ContentConverter bool` Whether to enable content conversion (e.g., HTML to Markdown). - `DisableApps SetConfigRuleActionParametersDisableApps` Whether to disable Cloudflare Apps. - `const SetConfigRuleActionParametersDisableAppsTrue SetConfigRuleActionParametersDisableApps = true` - `DisablePayPerCrawl SetConfigRuleActionParametersDisablePayPerCrawl` Whether to disable Pay Per Crawl. - `const SetConfigRuleActionParametersDisablePayPerCrawlTrue SetConfigRuleActionParametersDisablePayPerCrawl = true` - `DisableRUM SetConfigRuleActionParametersDisableRUM` Whether to disable Real User Monitoring (RUM). - `const SetConfigRuleActionParametersDisableRUMTrue SetConfigRuleActionParametersDisableRUM = true` - `DisableZaraz SetConfigRuleActionParametersDisableZaraz` Whether to disable Zaraz. - `const SetConfigRuleActionParametersDisableZarazTrue SetConfigRuleActionParametersDisableZaraz = true` - `EmailObfuscation bool` Whether to enable Email Obfuscation. - `Fonts bool` Whether to enable Cloudflare Fonts. - `HotlinkProtection bool` Whether to enable Hotlink Protection. - `Mirage bool` Whether to enable Mirage. - `OpportunisticEncryption bool` Whether to enable Opportunistic Encryption. - `Polish SetConfigRuleActionParametersPolish` The Polish level to configure. - `const SetConfigRuleActionParametersPolishOff SetConfigRuleActionParametersPolish = "off"` - `const SetConfigRuleActionParametersPolishLossless SetConfigRuleActionParametersPolish = "lossless"` - `const SetConfigRuleActionParametersPolishLossy SetConfigRuleActionParametersPolish = "lossy"` - `const SetConfigRuleActionParametersPolishWebP SetConfigRuleActionParametersPolish = "webp"` - `RedirectsForAITraining bool` Whether to redirect verified AI training crawlers to canonical URLs found in the HTML response. - `RequestBodyBuffering SetConfigRuleActionParametersRequestBodyBuffering` The request body buffering mode. - `const SetConfigRuleActionParametersRequestBodyBufferingNone SetConfigRuleActionParametersRequestBodyBuffering = "none"` - `const SetConfigRuleActionParametersRequestBodyBufferingStandard SetConfigRuleActionParametersRequestBodyBuffering = "standard"` - `const SetConfigRuleActionParametersRequestBodyBufferingFull SetConfigRuleActionParametersRequestBodyBuffering = "full"` - `ResponseBodyBuffering SetConfigRuleActionParametersResponseBodyBuffering` The response body buffering mode. - `const SetConfigRuleActionParametersResponseBodyBufferingNone SetConfigRuleActionParametersResponseBodyBuffering = "none"` - `const SetConfigRuleActionParametersResponseBodyBufferingStandard SetConfigRuleActionParametersResponseBodyBuffering = "standard"` - `RocketLoader bool` Whether to enable Rocket Loader. - `SecurityLevel SetConfigRuleActionParametersSecurityLevel` The Security Level to configure. - `const SetConfigRuleActionParametersSecurityLevelOff SetConfigRuleActionParametersSecurityLevel = "off"` - `const SetConfigRuleActionParametersSecurityLevelEssentiallyOff SetConfigRuleActionParametersSecurityLevel = "essentially_off"` - `const SetConfigRuleActionParametersSecurityLevelLow SetConfigRuleActionParametersSecurityLevel = "low"` - `const SetConfigRuleActionParametersSecurityLevelMedium SetConfigRuleActionParametersSecurityLevel = "medium"` - `const SetConfigRuleActionParametersSecurityLevelHigh SetConfigRuleActionParametersSecurityLevel = "high"` - `const SetConfigRuleActionParametersSecurityLevelUnderAttack SetConfigRuleActionParametersSecurityLevel = "under_attack"` - `ServerSideExcludes bool` Whether to enable Server-Side Excludes. - `SSL SetConfigRuleActionParametersSSL` The SSL level to configure. - `const SetConfigRuleActionParametersSSLOff SetConfigRuleActionParametersSSL = "off"` - `const SetConfigRuleActionParametersSSLFlexible SetConfigRuleActionParametersSSL = "flexible"` - `const SetConfigRuleActionParametersSSLFull SetConfigRuleActionParametersSSL = "full"` - `const SetConfigRuleActionParametersSSLStrict SetConfigRuleActionParametersSSL = "strict"` - `const SetConfigRuleActionParametersSSLOriginPull SetConfigRuleActionParametersSSL = "origin_pull"` - `SXG bool` Whether to enable Signed Exchanges (SXG). - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck SetConfigRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit SetConfigRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `type SkipRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action SkipRuleAction` The action to perform when the rule matches. - `const SkipRuleActionSkip SkipRuleAction = "skip"` - `ActionParameters SkipRuleActionParameters` The parameters configuring the rule's action. - `Phase SkipRuleActionParametersPhase` A phase to skip the execution of. This option is only compatible with the products option. - `const SkipRuleActionParametersPhaseCurrent SkipRuleActionParametersPhase = "current"` - `Phases []Phase` A list of phases to skip the execution of. This option is incompatible with the rulesets option. - `const PhaseDDoSL4 Phase = "ddos_l4"` - `const PhaseDDoSL7 Phase = "ddos_l7"` - `const PhaseHTTPConfigSettings Phase = "http_config_settings"` - `const PhaseHTTPCustomErrors Phase = "http_custom_errors"` - `const PhaseHTTPLogCustomFields Phase = "http_log_custom_fields"` - `const PhaseHTTPRatelimit Phase = "http_ratelimit"` - `const PhaseHTTPRequestCacheSettings Phase = "http_request_cache_settings"` - `const PhaseHTTPRequestDynamicRedirect Phase = "http_request_dynamic_redirect"` - `const PhaseHTTPRequestFirewallCustom Phase = "http_request_firewall_custom"` - `const PhaseHTTPRequestFirewallManaged Phase = "http_request_firewall_managed"` - `const PhaseHTTPRequestLateTransform Phase = "http_request_late_transform"` - `const PhaseHTTPRequestOrigin Phase = "http_request_origin"` - `const PhaseHTTPRequestRedirect Phase = "http_request_redirect"` - `const PhaseHTTPRequestSanitize Phase = "http_request_sanitize"` - `const PhaseHTTPRequestSBFM Phase = "http_request_sbfm"` - `const PhaseHTTPRequestTransform Phase = "http_request_transform"` - `const PhaseHTTPResponseCacheSettings Phase = "http_response_cache_settings"` - `const PhaseHTTPResponseCompression Phase = "http_response_compression"` - `const PhaseHTTPResponseFirewallManaged Phase = "http_response_firewall_managed"` - `const PhaseHTTPResponseHeadersTransform Phase = "http_response_headers_transform"` - `const PhaseMagicTransit Phase = "magic_transit"` - `const PhaseMagicTransitIDsManaged Phase = "magic_transit_ids_managed"` - `const PhaseMagicTransitManaged Phase = "magic_transit_managed"` - `const PhaseMagicTransitRatelimit Phase = "magic_transit_ratelimit"` - `Products []SkipRuleActionParametersProduct` A list of legacy security products to skip the execution of. - `const SkipRuleActionParametersProductBIC SkipRuleActionParametersProduct = "bic"` - `const SkipRuleActionParametersProductHot SkipRuleActionParametersProduct = "hot"` - `const SkipRuleActionParametersProductRateLimit SkipRuleActionParametersProduct = "rateLimit"` - `const SkipRuleActionParametersProductSecurityLevel SkipRuleActionParametersProduct = "securityLevel"` - `const SkipRuleActionParametersProductUABlock SkipRuleActionParametersProduct = "uaBlock"` - `const SkipRuleActionParametersProductWAF SkipRuleActionParametersProduct = "waf"` - `const SkipRuleActionParametersProductZoneLockdown SkipRuleActionParametersProduct = "zoneLockdown"` - `Rules map[string, []string]` A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the execution of. This option is incompatible with the ruleset option. - `Ruleset SkipRuleActionParametersRuleset` A ruleset to skip the execution of. This option is incompatible with the rulesets option. - `const SkipRuleActionParametersRulesetCurrent SkipRuleActionParametersRuleset = "current"` - `Rulesets []string` A list of ruleset IDs to skip the execution of. This option is incompatible with the ruleset and phases options. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck SkipRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Ratelimit SkipRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). - `Version string` The version of the ruleset. - `Description string` An informative description of the ruleset. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/rulesets" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) rule, err := client.Rulesets.Rules.Delete( context.TODO(), "2f2feab2026849078ba485f918791bdc", "3a03d665bac047339bb530ecb439a90d", rulesets.RuleDeleteParams{ }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", rule.ID) } ``` #### Response ```json { "errors": [ { "message": "something bad happened", "code": 10000, "source": { "pointer": "/rules/0/action" } } ], "messages": [ { "message": "something bad happened", "code": 10000, "source": { "pointer": "/rules/0/action" } } ], "result": { "id": "2f2feab2026849078ba485f918791bdc", "kind": "root", "last_updated": "2000-01-01T00:00:00.000000Z", "name": "My ruleset", "phase": "http_request_firewall_custom", "rules": [ { "last_updated": "2000-01-01T00:00:00.000000Z", "version": "1", "id": "3a03d665bac047339bb530ecb439a90d", "action": "block", "action_parameters": { "response": { "content": "{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}", "content_type": "application/json", "status_code": 400 } }, "categories": [ "directory-traversal" ], "description": "Block the request.", "enabled": true, "exposed_credential_check": { "password_expression": "url_decode(http.request.body.form[\\\"password\\\"][0])", "username_expression": "url_decode(http.request.body.form[\\\"username\\\"][0])" }, "expression": "ip.src eq 1.1.1.1", "logging": { "enabled": true }, "ratelimit": { "characteristics": [ "cf.colo.id" ], "period": 60, "counting_expression": "http.request.body.raw eq \"abcd\"", "mitigation_timeout": 600, "requests_per_period": 1000, "requests_to_origin": true, "score_per_period": 400, "score_response_header_name": "my-score" }, "ref": "my_ref" } ], "version": "1", "description": "A description for my ruleset." }, "success": true } ``` ## Domain Types ### Block Rule - `type BlockRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action BlockRuleAction` The action to perform when the rule matches. - `const BlockRuleActionBlock BlockRuleAction = "block"` - `ActionParameters BlockRuleActionParameters` The parameters configuring the rule's action. - `Response BlockRuleActionParametersResponse` The response to show when the block is applied. - `Content string` The content to return. - `ContentType string` The type of the content to return. - `StatusCode int64` The status code to return. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck BlockRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Enabled bool` Whether to generate a log when the rule matches. - `Ratelimit BlockRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). ### Compress Response Rule - `type CompressResponseRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action CompressResponseRuleAction` The action to perform when the rule matches. - `const CompressResponseRuleActionCompressResponse CompressResponseRuleAction = "compress_response"` - `ActionParameters CompressResponseRuleActionParameters` The parameters configuring the rule's action. - `Algorithms []CompressResponseRuleActionParametersAlgorithm` Custom order for compression algorithms. - `Name CompressResponseRuleActionParametersAlgorithmsName` Name of the compression algorithm to enable. - `const CompressResponseRuleActionParametersAlgorithmsNameNone CompressResponseRuleActionParametersAlgorithmsName = "none"` - `const CompressResponseRuleActionParametersAlgorithmsNameAuto CompressResponseRuleActionParametersAlgorithmsName = "auto"` - `const CompressResponseRuleActionParametersAlgorithmsNameDefault CompressResponseRuleActionParametersAlgorithmsName = "default"` - `const CompressResponseRuleActionParametersAlgorithmsNameGzip CompressResponseRuleActionParametersAlgorithmsName = "gzip"` - `const CompressResponseRuleActionParametersAlgorithmsNameBrotli CompressResponseRuleActionParametersAlgorithmsName = "brotli"` - `const CompressResponseRuleActionParametersAlgorithmsNameZstd CompressResponseRuleActionParametersAlgorithmsName = "zstd"` - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck CompressResponseRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Enabled bool` Whether to generate a log when the rule matches. - `Ratelimit CompressResponseRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). ### DDoS Dynamic Rule - `type DDoSDynamicRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action DDoSDynamicRuleAction` The action to perform when the rule matches. - `const DDoSDynamicRuleActionDDoSDynamic DDoSDynamicRuleAction = "ddos_dynamic"` - `ActionParameters unknown` The parameters configuring the rule's action. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck DDoSDynamicRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Enabled bool` Whether to generate a log when the rule matches. - `Ratelimit DDoSDynamicRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). ### Execute Rule - `type ExecuteRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action ExecuteRuleAction` The action to perform when the rule matches. - `const ExecuteRuleActionExecute ExecuteRuleAction = "execute"` - `ActionParameters ExecuteRuleActionParameters` The parameters configuring the rule's action. - `ID string` The ID of the ruleset to execute. - `MatchedData ExecuteRuleActionParametersMatchedData` The configuration to use for matched data logging. - `PublicKey string` The public key to encrypt matched data logs with. - `Overrides ExecuteRuleActionParametersOverrides` A set of overrides to apply to the target ruleset. - `Action string` An action to override all rules with. This option has lower precedence than rule and category overrides. - `Categories []ExecuteRuleActionParametersOverridesCategory` A list of category-level overrides. This option has the second-highest precedence after rule-level overrides. - `Category string` The name of the category to override. - `Action string` The action to override rules in the category with. - `Enabled bool` Whether to enable execution of rules in the category. - `SensitivityLevel ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel` The sensitivity level to use for rules in the category. This option is only applicable for DDoS phases. - `const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"` - `const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"` - `const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"` - `const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"` - `Enabled bool` Whether to enable execution of all rules. This option has lower precedence than rule and category overrides. - `Rules []ExecuteRuleActionParametersOverridesRule` A list of rule-level overrides. This option has the highest precedence. - `ID string` The ID of the rule to override. - `Action string` The action to override the rule with. - `Enabled bool` Whether to enable execution of the rule. - `ScoreThreshold int64` The score threshold to use for the rule. - `SensitivityLevel ExecuteRuleActionParametersOverridesRulesSensitivityLevel` The sensitivity level to use for the rule. This option is only applicable for DDoS phases. - `const ExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"` - `const ExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"` - `const ExecuteRuleActionParametersOverridesRulesSensitivityLevelLow ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"` - `const ExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"` - `SensitivityLevel ExecuteRuleActionParametersOverridesSensitivityLevel` A sensitivity level to set for all rules. This option has lower precedence than rule and category overrides and is only applicable for DDoS phases. - `const ExecuteRuleActionParametersOverridesSensitivityLevelDefault ExecuteRuleActionParametersOverridesSensitivityLevel = "default"` - `const ExecuteRuleActionParametersOverridesSensitivityLevelMedium ExecuteRuleActionParametersOverridesSensitivityLevel = "medium"` - `const ExecuteRuleActionParametersOverridesSensitivityLevelLow ExecuteRuleActionParametersOverridesSensitivityLevel = "low"` - `const ExecuteRuleActionParametersOverridesSensitivityLevelEoff ExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"` - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck ExecuteRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Enabled bool` Whether to generate a log when the rule matches. - `Ratelimit ExecuteRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). ### Force Connection Close Rule - `type ForceConnectionCloseRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action ForceConnectionCloseRuleAction` The action to perform when the rule matches. - `const ForceConnectionCloseRuleActionForceConnectionClose ForceConnectionCloseRuleAction = "force_connection_close"` - `ActionParameters unknown` The parameters configuring the rule's action. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck ForceConnectionCloseRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Enabled bool` Whether to generate a log when the rule matches. - `Ratelimit ForceConnectionCloseRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). ### Log Custom Field Rule - `type LogCustomFieldRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action LogCustomFieldRuleAction` The action to perform when the rule matches. - `const LogCustomFieldRuleActionLogCustomField LogCustomFieldRuleAction = "log_custom_field"` - `ActionParameters LogCustomFieldRuleActionParameters` The parameters configuring the rule's action. - `CookieFields []LogCustomFieldRuleActionParametersCookieField` The cookie fields to log. - `Name string` The name of the cookie. - `RawResponseFields []LogCustomFieldRuleActionParametersRawResponseField` The raw response fields to log. - `Name string` The name of the response header. - `PreserveDuplicates bool` Whether to log duplicate values of the same header. - `RequestFields []LogCustomFieldRuleActionParametersRequestField` The raw request fields to log. - `Name string` The name of the header. - `ResponseFields []LogCustomFieldRuleActionParametersResponseField` The transformed response fields to log. - `Name string` The name of the response header. - `PreserveDuplicates bool` Whether to log duplicate values of the same header. - `TransformedRequestFields []LogCustomFieldRuleActionParametersTransformedRequestField` The transformed request fields to log. - `Name string` The name of the header. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck LogCustomFieldRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Enabled bool` Whether to generate a log when the rule matches. - `Ratelimit LogCustomFieldRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). ### Log Rule - `type LogRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action LogRuleAction` The action to perform when the rule matches. - `const LogRuleActionLog LogRuleAction = "log"` - `ActionParameters unknown` The parameters configuring the rule's action. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck LogRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Enabled bool` Whether to generate a log when the rule matches. - `Ratelimit LogRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). ### Logging - `type Logging struct{…}` An object configuring the rule's logging behavior. - `Enabled bool` Whether to generate a log when the rule matches. ### Managed Challenge Rule - `type ManagedChallengeRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action ManagedChallengeRuleAction` The action to perform when the rule matches. - `const ManagedChallengeRuleActionManagedChallenge ManagedChallengeRuleAction = "managed_challenge"` - `ActionParameters unknown` The parameters configuring the rule's action. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck ManagedChallengeRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Enabled bool` Whether to generate a log when the rule matches. - `Ratelimit ManagedChallengeRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). ### Redirect Rule - `type RedirectRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RedirectRuleAction` The action to perform when the rule matches. - `const RedirectRuleActionRedirect RedirectRuleAction = "redirect"` - `ActionParameters RedirectRuleActionParameters` The parameters configuring the rule's action. - `FromList RedirectRuleActionParametersFromList` A redirect based on a bulk list lookup. - `Key string` An expression that evaluates to the list lookup key. - `Name string` The name of the list to match against. - `FromValue RedirectRuleActionParametersFromValue` A redirect based on the request properties. - `TargetURL RedirectRuleActionParametersFromValueTargetURL` A URL to redirect the request to. - `Expression string` An expression that evaluates to a URL to redirect the request to. - `Value string` A URL to redirect the request to. - `PreserveQueryString bool` Whether to keep the query string of the original request. - `StatusCode RedirectRuleActionParametersFromValueStatusCode` The status code to use for the redirect. - `const RedirectRuleActionParametersFromValueStatusCode301 RedirectRuleActionParametersFromValueStatusCode = 301` - `const RedirectRuleActionParametersFromValueStatusCode302 RedirectRuleActionParametersFromValueStatusCode = 302` - `const RedirectRuleActionParametersFromValueStatusCode303 RedirectRuleActionParametersFromValueStatusCode = 303` - `const RedirectRuleActionParametersFromValueStatusCode307 RedirectRuleActionParametersFromValueStatusCode = 307` - `const RedirectRuleActionParametersFromValueStatusCode308 RedirectRuleActionParametersFromValueStatusCode = 308` - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RedirectRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Enabled bool` Whether to generate a log when the rule matches. - `Ratelimit RedirectRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). ### Rewrite Rule - `type RewriteRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RewriteRuleAction` The action to perform when the rule matches. - `const RewriteRuleActionRewrite RewriteRuleAction = "rewrite"` - `ActionParameters RewriteRuleActionParameters` The parameters configuring the rule's action. - `Headers map[string, RewriteRuleActionParametersHeader]` A map of headers to rewrite. - `type RewriteRuleActionParametersHeadersAddStaticHeader struct{…}` A header with a static value to add. - `Operation RewriteRuleActionParametersHeadersAddStaticHeaderOperation` The operation to perform on the header. - `const RewriteRuleActionParametersHeadersAddStaticHeaderOperationAdd RewriteRuleActionParametersHeadersAddStaticHeaderOperation = "add"` - `Value string` A static value for the header. - `type RewriteRuleActionParametersHeadersAddDynamicHeader struct{…}` A header with a dynamic value to add. - `Expression string` An expression that evaluates to a value for the header. - `Operation RewriteRuleActionParametersHeadersAddDynamicHeaderOperation` The operation to perform on the header. - `const RewriteRuleActionParametersHeadersAddDynamicHeaderOperationAdd RewriteRuleActionParametersHeadersAddDynamicHeaderOperation = "add"` - `type RewriteRuleActionParametersHeadersSetStaticHeader struct{…}` A header with a static value to set. - `Operation RewriteRuleActionParametersHeadersSetStaticHeaderOperation` The operation to perform on the header. - `const RewriteRuleActionParametersHeadersSetStaticHeaderOperationSet RewriteRuleActionParametersHeadersSetStaticHeaderOperation = "set"` - `Value string` A static value for the header. - `type RewriteRuleActionParametersHeadersSetDynamicHeader struct{…}` A header with a dynamic value to set. - `Expression string` An expression that evaluates to a value for the header. - `Operation RewriteRuleActionParametersHeadersSetDynamicHeaderOperation` The operation to perform on the header. - `const RewriteRuleActionParametersHeadersSetDynamicHeaderOperationSet RewriteRuleActionParametersHeadersSetDynamicHeaderOperation = "set"` - `type RewriteRuleActionParametersHeadersRemoveHeader struct{…}` A header to remove. - `Operation RewriteRuleActionParametersHeadersRemoveHeaderOperation` The operation to perform on the header. - `const RewriteRuleActionParametersHeadersRemoveHeaderOperationRemove RewriteRuleActionParametersHeadersRemoveHeaderOperation = "remove"` - `URI RewriteRuleActionParametersURI` A URI path rewrite. - `type RewriteRuleActionParametersURIURIPath struct{…}` A URI path rewrite. - `Path RewriteRuleActionParametersURIURIPathPath` A URI path rewrite. - `Expression string` An expression that evaluates to a value to rewrite the URI path to. - `Value string` A value to rewrite the URI path to. - `Origin bool` Whether to propagate the rewritten URI to origin. - `type RewriteRuleActionParametersURIURIQuery struct{…}` A URI query rewrite. - `Query RewriteRuleActionParametersURIURIQueryQuery` A URI query rewrite. - `Expression string` An expression that evaluates to a value to rewrite the URI query to. - `Value string` A value to rewrite the URI query to. - `Origin bool` Whether to propagate the rewritten URI to origin. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RewriteRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Enabled bool` Whether to generate a log when the rule matches. - `Ratelimit RewriteRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). ### Route Rule - `type RouteRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action RouteRuleAction` The action to perform when the rule matches. - `const RouteRuleActionRoute RouteRuleAction = "route"` - `ActionParameters RouteRuleActionParameters` The parameters configuring the rule's action. - `HostHeader string` A value to rewrite the HTTP host header to. - `Origin RouteRuleActionParametersOrigin` An origin to route to. - `Host string` A resolved host to route to. - `Port int64` A destination port to route to. - `SNI RouteRuleActionParametersSNI` A Server Name Indication (SNI) override. - `Value string` A value to override the SNI to. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RouteRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Enabled bool` Whether to generate a log when the rule matches. - `Ratelimit RouteRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). ### Ruleset Rule - `type RulesetRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action string` The action to perform when the rule matches. - `ActionParameters unknown` The parameters configuring the rule's action. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck RulesetRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Enabled bool` Whether to generate a log when the rule matches. - `Ratelimit RulesetRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). ### Score Rule - `type ScoreRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action ScoreRuleAction` The action to perform when the rule matches. - `const ScoreRuleActionScore ScoreRuleAction = "score"` - `ActionParameters ScoreRuleActionParameters` The parameters configuring the rule's action. - `Increment int64` A delta to change the score by, which can be either positive or negative. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck ScoreRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Enabled bool` Whether to generate a log when the rule matches. - `Ratelimit ScoreRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). ### Serve Error Rule - `type ServeErrorRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action ServeErrorRuleAction` The action to perform when the rule matches. - `const ServeErrorRuleActionServeError ServeErrorRuleAction = "serve_error"` - `ActionParameters ServeErrorRuleActionParameters` The parameters configuring the rule's action. - `type ServeErrorRuleActionParametersActionParametersContent struct{…}` - `Content string` The response content. - `ContentType ServeErrorRuleActionParametersActionParametersContentContentType` The content type header to set with the error response. - `const ServeErrorRuleActionParametersActionParametersContentContentTypeApplicationJson ServeErrorRuleActionParametersActionParametersContentContentType = "application/json"` - `const ServeErrorRuleActionParametersActionParametersContentContentTypeTextHTML ServeErrorRuleActionParametersActionParametersContentContentType = "text/html"` - `const ServeErrorRuleActionParametersActionParametersContentContentTypeTextPlain ServeErrorRuleActionParametersActionParametersContentContentType = "text/plain"` - `const ServeErrorRuleActionParametersActionParametersContentContentTypeTextXml ServeErrorRuleActionParametersActionParametersContentContentType = "text/xml"` - `StatusCode int64` The status code to use for the error. - `type ServeErrorRuleActionParametersActionParametersAsset struct{…}` - `AssetName string` The name of a custom asset to serve as the error response. - `ContentType ServeErrorRuleActionParametersActionParametersAssetContentType` The content type header to set with the error response. - `const ServeErrorRuleActionParametersActionParametersAssetContentTypeApplicationJson ServeErrorRuleActionParametersActionParametersAssetContentType = "application/json"` - `const ServeErrorRuleActionParametersActionParametersAssetContentTypeTextHTML ServeErrorRuleActionParametersActionParametersAssetContentType = "text/html"` - `const ServeErrorRuleActionParametersActionParametersAssetContentTypeTextPlain ServeErrorRuleActionParametersActionParametersAssetContentType = "text/plain"` - `const ServeErrorRuleActionParametersActionParametersAssetContentTypeTextXml ServeErrorRuleActionParametersActionParametersAssetContentType = "text/xml"` - `StatusCode int64` The status code to use for the error. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck ServeErrorRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Enabled bool` Whether to generate a log when the rule matches. - `Ratelimit ServeErrorRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). ### Set Cache Settings Rule - `type SetCacheSettingsRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action SetCacheSettingsRuleAction` The action to perform when the rule matches. - `const SetCacheSettingsRuleActionSetCacheSettings SetCacheSettingsRuleAction = "set_cache_settings"` - `ActionParameters SetCacheSettingsRuleActionParameters` The parameters configuring the rule's action. - `AdditionalCacheablePorts []int64` A list of additional ports that caching should be enabled on. - `BrowserTTL SetCacheSettingsRuleActionParametersBrowserTTL` How long client browsers should cache the response. Cloudflare cache purge will not purge content cached on client browsers, so high browser TTLs may lead to stale content. - `Mode SetCacheSettingsRuleActionParametersBrowserTTLMode` The browser TTL mode. - `const SetCacheSettingsRuleActionParametersBrowserTTLModeRespectOrigin SetCacheSettingsRuleActionParametersBrowserTTLMode = "respect_origin"` - `const SetCacheSettingsRuleActionParametersBrowserTTLModeBypassByDefault SetCacheSettingsRuleActionParametersBrowserTTLMode = "bypass_by_default"` - `const SetCacheSettingsRuleActionParametersBrowserTTLModeOverrideOrigin SetCacheSettingsRuleActionParametersBrowserTTLMode = "override_origin"` - `const SetCacheSettingsRuleActionParametersBrowserTTLModeBypass SetCacheSettingsRuleActionParametersBrowserTTLMode = "bypass"` - `Default int64` The browser TTL (in seconds) if you choose the "override_origin" mode. - `Cache bool` Whether the request's response from the origin is eligible for caching. Caching itself will still depend on the cache control header and your other caching configurations. - `CacheKey SetCacheSettingsRuleActionParametersCacheKey` Which components of the request are included in or excluded from the cache key Cloudflare uses to store the response in cache. - `CacheByDeviceType bool` Whether to separate cached content based on the visitor's device type. - `CacheDeceptionArmor bool` Whether to protect from web cache deception attacks, while allowing static assets to be cached. - `CustomKey SetCacheSettingsRuleActionParametersCacheKeyCustomKey` Which components of the request are included or excluded from the cache key. - `Cookie SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookie` Which cookies to include in the cache key. - `CheckPresence []string` A list of cookies to check for the presence of. The presence of these cookies is included in the cache key. - `Include []string` A list of cookies to include in the cache key. - `Header SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader` Which headers to include in the cache key. - `CheckPresence []string` A list of headers to check for the presence of. The presence of these headers is included in the cache key. - `Contains map[string, []string]` A mapping of header names to a list of values. If a header is present in the request and contains any of the values provided, its value is included in the cache key. - `ExcludeOrigin bool` Whether to exclude the origin header in the cache key. - `Include []string` A list of headers to include in the cache key. - `Host SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost` How to use the host in the cache key. - `Resolved bool` Whether to use the resolved host in the cache key. - `QueryString SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString` Which query string parameters to include in or exclude from the cache key. - `Exclude SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude` Which query string parameters to exclude from the cache key. - `All SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeAll` Whether to exclude all query string parameters from the cache key. - `const SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeAllTrue SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeAll = true` - `List []string` A list of query string parameters to exclude from the cache key. - `Include SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude` Which query string parameters to include in the cache key. - `All SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeAll` Whether to include all query string parameters in the cache key. - `const SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeAllTrue SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeAll = true` - `List []string` A list of query string parameters to include in the cache key. - `User SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser` How to use characteristics of the request user agent in the cache key. - `DeviceType bool` Whether to use the user agent's device type in the cache key. - `Geo bool` Whether to use the user agents's country in the cache key. - `Lang bool` Whether to use the user agent's language in the cache key. - `IgnoreQueryStringsOrder bool` Whether to treat requests with the same query parameters the same, regardless of the order those query parameters are in. - `CacheReserve SetCacheSettingsRuleActionParametersCacheReserve` Settings to determine whether the request's response from origin is eligible for Cache Reserve (requires a Cache Reserve add-on plan). - `Eligible bool` Whether Cache Reserve is enabled. If this is true and a request meets eligibility criteria, Cloudflare will write the resource to Cache Reserve. - `MinimumFileSize int64` The minimum file size eligible for storage in Cache Reserve. - `EdgeTTL SetCacheSettingsRuleActionParametersEdgeTTL` How long the Cloudflare edge network should cache the response. - `Mode SetCacheSettingsRuleActionParametersEdgeTTLMode` The edge TTL mode. - `const SetCacheSettingsRuleActionParametersEdgeTTLModeRespectOrigin SetCacheSettingsRuleActionParametersEdgeTTLMode = "respect_origin"` - `const SetCacheSettingsRuleActionParametersEdgeTTLModeBypassByDefault SetCacheSettingsRuleActionParametersEdgeTTLMode = "bypass_by_default"` - `const SetCacheSettingsRuleActionParametersEdgeTTLModeOverrideOrigin SetCacheSettingsRuleActionParametersEdgeTTLMode = "override_origin"` - `Default int64` The edge TTL (in seconds) if you choose the "override_origin" mode. - `StatusCodeTTL []SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL` A list of TTLs to apply to specific status codes or status code ranges. - `Value int64` The time to cache the response for (in seconds). A value of 0 is equivalent to setting the cache control header with the value "no-cache". A value of -1 is equivalent to setting the cache control header with the value of "no-store". - `StatusCode int64` A single status code to apply the TTL to. - `StatusCodeRange SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRange` A range of status codes to apply the TTL to. - `From int64` The lower bound of the range. - `To int64` The upper bound of the range. - `OriginCacheControl bool` Whether Cloudflare will aim to strictly adhere to RFC 7234. - `OriginErrorPagePassthru bool` Whether to generate Cloudflare error pages for issues from the origin server. - `ReadTimeout int64` A timeout value between two successive read operations to use for your origin server. Historically, the timeout value between two read options from Cloudflare to an origin server is 100 seconds. If you are attempting to reduce HTTP 524 errors because of timeouts from an origin server, try increasing this timeout value. - `RespectStrongEtags bool` Whether Cloudflare should respect strong ETag (entity tag) headers. If false, Cloudflare converts strong ETag headers to weak ETag headers. - `ServeStale SetCacheSettingsRuleActionParametersServeStale` When to serve stale content from cache. - `DisableStaleWhileUpdating bool` Whether Cloudflare should disable serving stale content while getting the latest content from the origin. - `SharedDictionary SetCacheSettingsRuleActionParametersSharedDictionary` Configuration for shared dictionary compression. When set, Cloudflare injects Use-As-Dictionary headers on matching cacheable responses. - `MatchPattern string` URL pattern for the Use-As-Dictionary match field. This pattern specifies which URLs can use this response as a dictionary. - `StripEtags bool` Whether to strip ETag headers from the origin response before caching. - `StripLastModified bool` Whether to strip Last-Modified headers from the origin response before caching. - `StripSetCookie bool` Whether to strip Set-Cookie headers from the origin response before caching. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck SetCacheSettingsRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Enabled bool` Whether to generate a log when the rule matches. - `Ratelimit SetCacheSettingsRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). ### Set Config Rule - `type SetConfigRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action SetConfigRuleAction` The action to perform when the rule matches. - `const SetConfigRuleActionSetConfig SetConfigRuleAction = "set_config"` - `ActionParameters SetConfigRuleActionParameters` The parameters configuring the rule's action. - `AutomaticHTTPSRewrites bool` Whether to enable Automatic HTTPS Rewrites. - `Autominify SetConfigRuleActionParametersAutominify` Which file extensions to minify automatically. - `CSS bool` Whether to minify CSS files. - `HTML bool` Whether to minify HTML files. - `JS bool` Whether to minify JavaScript files. - `BIC bool` Whether to enable Browser Integrity Check (BIC). - `ContentConverter bool` Whether to enable content conversion (e.g., HTML to Markdown). - `DisableApps SetConfigRuleActionParametersDisableApps` Whether to disable Cloudflare Apps. - `const SetConfigRuleActionParametersDisableAppsTrue SetConfigRuleActionParametersDisableApps = true` - `DisablePayPerCrawl SetConfigRuleActionParametersDisablePayPerCrawl` Whether to disable Pay Per Crawl. - `const SetConfigRuleActionParametersDisablePayPerCrawlTrue SetConfigRuleActionParametersDisablePayPerCrawl = true` - `DisableRUM SetConfigRuleActionParametersDisableRUM` Whether to disable Real User Monitoring (RUM). - `const SetConfigRuleActionParametersDisableRUMTrue SetConfigRuleActionParametersDisableRUM = true` - `DisableZaraz SetConfigRuleActionParametersDisableZaraz` Whether to disable Zaraz. - `const SetConfigRuleActionParametersDisableZarazTrue SetConfigRuleActionParametersDisableZaraz = true` - `EmailObfuscation bool` Whether to enable Email Obfuscation. - `Fonts bool` Whether to enable Cloudflare Fonts. - `HotlinkProtection bool` Whether to enable Hotlink Protection. - `Mirage bool` Whether to enable Mirage. - `OpportunisticEncryption bool` Whether to enable Opportunistic Encryption. - `Polish SetConfigRuleActionParametersPolish` The Polish level to configure. - `const SetConfigRuleActionParametersPolishOff SetConfigRuleActionParametersPolish = "off"` - `const SetConfigRuleActionParametersPolishLossless SetConfigRuleActionParametersPolish = "lossless"` - `const SetConfigRuleActionParametersPolishLossy SetConfigRuleActionParametersPolish = "lossy"` - `const SetConfigRuleActionParametersPolishWebP SetConfigRuleActionParametersPolish = "webp"` - `RedirectsForAITraining bool` Whether to redirect verified AI training crawlers to canonical URLs found in the HTML response. - `RequestBodyBuffering SetConfigRuleActionParametersRequestBodyBuffering` The request body buffering mode. - `const SetConfigRuleActionParametersRequestBodyBufferingNone SetConfigRuleActionParametersRequestBodyBuffering = "none"` - `const SetConfigRuleActionParametersRequestBodyBufferingStandard SetConfigRuleActionParametersRequestBodyBuffering = "standard"` - `const SetConfigRuleActionParametersRequestBodyBufferingFull SetConfigRuleActionParametersRequestBodyBuffering = "full"` - `ResponseBodyBuffering SetConfigRuleActionParametersResponseBodyBuffering` The response body buffering mode. - `const SetConfigRuleActionParametersResponseBodyBufferingNone SetConfigRuleActionParametersResponseBodyBuffering = "none"` - `const SetConfigRuleActionParametersResponseBodyBufferingStandard SetConfigRuleActionParametersResponseBodyBuffering = "standard"` - `RocketLoader bool` Whether to enable Rocket Loader. - `SecurityLevel SetConfigRuleActionParametersSecurityLevel` The Security Level to configure. - `const SetConfigRuleActionParametersSecurityLevelOff SetConfigRuleActionParametersSecurityLevel = "off"` - `const SetConfigRuleActionParametersSecurityLevelEssentiallyOff SetConfigRuleActionParametersSecurityLevel = "essentially_off"` - `const SetConfigRuleActionParametersSecurityLevelLow SetConfigRuleActionParametersSecurityLevel = "low"` - `const SetConfigRuleActionParametersSecurityLevelMedium SetConfigRuleActionParametersSecurityLevel = "medium"` - `const SetConfigRuleActionParametersSecurityLevelHigh SetConfigRuleActionParametersSecurityLevel = "high"` - `const SetConfigRuleActionParametersSecurityLevelUnderAttack SetConfigRuleActionParametersSecurityLevel = "under_attack"` - `ServerSideExcludes bool` Whether to enable Server-Side Excludes. - `SSL SetConfigRuleActionParametersSSL` The SSL level to configure. - `const SetConfigRuleActionParametersSSLOff SetConfigRuleActionParametersSSL = "off"` - `const SetConfigRuleActionParametersSSLFlexible SetConfigRuleActionParametersSSL = "flexible"` - `const SetConfigRuleActionParametersSSLFull SetConfigRuleActionParametersSSL = "full"` - `const SetConfigRuleActionParametersSSLStrict SetConfigRuleActionParametersSSL = "strict"` - `const SetConfigRuleActionParametersSSLOriginPull SetConfigRuleActionParametersSSL = "origin_pull"` - `SXG bool` Whether to enable Signed Exchanges (SXG). - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck SetConfigRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Enabled bool` Whether to generate a log when the rule matches. - `Ratelimit SetConfigRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default). ### Skip Rule - `type SkipRule struct{…}` - `LastUpdated Time` The timestamp of when the rule was last modified. - `Version string` The version of the rule. - `ID string` The unique ID of the rule. - `Action SkipRuleAction` The action to perform when the rule matches. - `const SkipRuleActionSkip SkipRuleAction = "skip"` - `ActionParameters SkipRuleActionParameters` The parameters configuring the rule's action. - `Phase SkipRuleActionParametersPhase` A phase to skip the execution of. This option is only compatible with the products option. - `const SkipRuleActionParametersPhaseCurrent SkipRuleActionParametersPhase = "current"` - `Phases []Phase` A list of phases to skip the execution of. This option is incompatible with the rulesets option. - `const PhaseDDoSL4 Phase = "ddos_l4"` - `const PhaseDDoSL7 Phase = "ddos_l7"` - `const PhaseHTTPConfigSettings Phase = "http_config_settings"` - `const PhaseHTTPCustomErrors Phase = "http_custom_errors"` - `const PhaseHTTPLogCustomFields Phase = "http_log_custom_fields"` - `const PhaseHTTPRatelimit Phase = "http_ratelimit"` - `const PhaseHTTPRequestCacheSettings Phase = "http_request_cache_settings"` - `const PhaseHTTPRequestDynamicRedirect Phase = "http_request_dynamic_redirect"` - `const PhaseHTTPRequestFirewallCustom Phase = "http_request_firewall_custom"` - `const PhaseHTTPRequestFirewallManaged Phase = "http_request_firewall_managed"` - `const PhaseHTTPRequestLateTransform Phase = "http_request_late_transform"` - `const PhaseHTTPRequestOrigin Phase = "http_request_origin"` - `const PhaseHTTPRequestRedirect Phase = "http_request_redirect"` - `const PhaseHTTPRequestSanitize Phase = "http_request_sanitize"` - `const PhaseHTTPRequestSBFM Phase = "http_request_sbfm"` - `const PhaseHTTPRequestTransform Phase = "http_request_transform"` - `const PhaseHTTPResponseCacheSettings Phase = "http_response_cache_settings"` - `const PhaseHTTPResponseCompression Phase = "http_response_compression"` - `const PhaseHTTPResponseFirewallManaged Phase = "http_response_firewall_managed"` - `const PhaseHTTPResponseHeadersTransform Phase = "http_response_headers_transform"` - `const PhaseMagicTransit Phase = "magic_transit"` - `const PhaseMagicTransitIDsManaged Phase = "magic_transit_ids_managed"` - `const PhaseMagicTransitManaged Phase = "magic_transit_managed"` - `const PhaseMagicTransitRatelimit Phase = "magic_transit_ratelimit"` - `Products []SkipRuleActionParametersProduct` A list of legacy security products to skip the execution of. - `const SkipRuleActionParametersProductBIC SkipRuleActionParametersProduct = "bic"` - `const SkipRuleActionParametersProductHot SkipRuleActionParametersProduct = "hot"` - `const SkipRuleActionParametersProductRateLimit SkipRuleActionParametersProduct = "rateLimit"` - `const SkipRuleActionParametersProductSecurityLevel SkipRuleActionParametersProduct = "securityLevel"` - `const SkipRuleActionParametersProductUABlock SkipRuleActionParametersProduct = "uaBlock"` - `const SkipRuleActionParametersProductWAF SkipRuleActionParametersProduct = "waf"` - `const SkipRuleActionParametersProductZoneLockdown SkipRuleActionParametersProduct = "zoneLockdown"` - `Rules map[string, []string]` A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the execution of. This option is incompatible with the ruleset option. - `Ruleset SkipRuleActionParametersRuleset` A ruleset to skip the execution of. This option is incompatible with the rulesets option. - `const SkipRuleActionParametersRulesetCurrent SkipRuleActionParametersRuleset = "current"` - `Rulesets []string` A list of ruleset IDs to skip the execution of. This option is incompatible with the ruleset and phases options. - `Categories []string` The categories of the rule. - `Description string` An informative description of the rule. - `Enabled bool` Whether the rule should be executed. - `ExposedCredentialCheck SkipRuleExposedCredentialCheck` Configuration for exposed credential checking. - `PasswordExpression string` An expression that selects the password used in the credentials check. - `UsernameExpression string` An expression that selects the user ID used in the credentials check. - `Expression string` The expression defining which traffic will match the rule. - `Logging Logging` An object configuring the rule's logging behavior. - `Enabled bool` Whether to generate a log when the rule matches. - `Ratelimit SkipRuleRatelimit` An object configuring the rule's rate limit behavior. - `Characteristics []string` Characteristics of the request on which the rate limit counter will be incremented. - `Period int64` Period in seconds over which the counter is being incremented. - `CountingExpression string` An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule's expression. - `MitigationTimeout int64` Period of time in seconds after which the action will be disabled following its first execution. - `RequestsPerPeriod int64` The threshold of requests per period after which the action will be executed for the first time. - `RequestsToOrigin bool` Whether counting is only performed when an origin is reached. - `ScorePerPeriod int64` The score threshold per period for which the action will be executed the first time. - `ScoreResponseHeaderName string` A response header name provided by the origin, which contains the score to increment rate limit counter with. - `Ref string` The reference of the rule (the rule's ID by default).