Skip to content
Start here

Access Rules

List IP Access rules
client.Firewall.AccessRules.List(ctx, params) (*V4PagePaginationArray[AccessRuleListResponse], error)
GET/{accounts_or_zones}/{account_or_zone_id}/firewall/access_rules/rules
Get an IP Access rule
client.Firewall.AccessRules.Get(ctx, ruleID, query) (*AccessRuleGetResponse, error)
GET/{accounts_or_zones}/{account_or_zone_id}/firewall/access_rules/rules/{rule_id}
Create an IP Access rule
client.Firewall.AccessRules.New(ctx, params) (*AccessRuleNewResponse, error)
POST/{accounts_or_zones}/{account_or_zone_id}/firewall/access_rules/rules
Update an IP Access rule
client.Firewall.AccessRules.Edit(ctx, ruleID, params) (*AccessRuleEditResponse, error)
PATCH/{accounts_or_zones}/{account_or_zone_id}/firewall/access_rules/rules/{rule_id}
Delete an IP Access rule
client.Firewall.AccessRules.Delete(ctx, ruleID, body) (*AccessRuleDeleteResponse, error)
DELETE/{accounts_or_zones}/{account_or_zone_id}/firewall/access_rules/rules/{rule_id}
ModelsExpand Collapse
type AccessRuleCIDRConfiguration struct{…}
Target AccessRuleCIDRConfigurationTargetoptional

The configuration target. You must set the target to ip_range when specifying an IP address range in the rule.

Value stringoptional

The IP address range to match. You can only use prefix lengths /16 and /24 for IPv4 ranges, and prefix lengths /32, /48, and /64 for IPv6 ranges.

type AccessRuleIPConfiguration struct{…}
Target AccessRuleIPConfigurationTargetoptional

The configuration target. You must set the target to ip when specifying an IP address in the rule.

Value stringoptional

The IP address to match. This address will be compared to the IP address of incoming requests.

type ASNConfiguration struct{…}
Target ASNConfigurationTargetoptional

The configuration target. You must set the target to asn when specifying an Autonomous System Number (ASN) in the rule.

Value stringoptional

The AS number to match.

type CountryConfiguration struct{…}
Target CountryConfigurationTargetoptional

The configuration target. You must set the target to country when specifying a country code in the rule.

Value stringoptional

The two-letter ISO-3166-1 alpha-2 code to match. For more information, refer to IP Access rules: Parameters.

type IPV6Configuration struct{…}
Target IPV6ConfigurationTargetoptional

The configuration target. You must set the target to ip6 when specifying an IPv6 address in the rule.

Value stringoptional

The IPv6 address to match.