Overview

Namespaces

  • Cloudflare
    • Organizations
      • Firewall
        • AccessRules
    • User
      • Billing
        • Subscriptions
      • Firewall
    • Zone
      • Firewall
      • SSL
      • WAF
        • Packages

Classes

  • AccessRules
  • Overview
  • Namespace
  • Class

Class AccessRules

CloudFlare API wrapper

Firewall access rules for a Zone

Cloudflare\Api
Extended by Cloudflare\Zone\Firewall\AccessRules
Namespace: Cloudflare\Zone\Firewall
Author: James Bell james@james-bell.co.uk
Version: 1
Located at CloudFlare/Zone/Firewall/AccessRules.php
Methods summary
public
# rules( string $zone_id, string|null $scope_type = null, string|null $mode = null, string|null $configuration_target = null, string|null $configuration_value = null, integer|null $page = null, integer|null $per_page = null, string|null $order = null, string|null $direction = null, string|null $match = null )

List access rules (permission needed: #zone:read) Search, sort, and filter IP/country access rule

List access rules (permission needed: #zone:read) Search, sort, and filter IP/country access rule

Parameters

$zone_id
$scope_type
The scope of the rules
$mode
The action to apply to a matched request
$configuration_target
The rule configuration target
$configuration_value
Search by IP, range, or country code
$page
Page number of paginated results
$per_page
Number of rules per page
$order
Field to order rules by
$direction
Direction to order rules
$match
Whether to match all search requirements or at least one (any)
public
# create( string $zone_id, string $mode, object $configuration, string|null $notes = null )

Create access rule (permission needed: #zone:edit) Make a new IP, IP range, or country access rule for the zone. Note: If you would like to create an access rule that applies across all of your owned zones, use the user or organization firewall endpoints as appropriate.

Create access rule (permission needed: #zone:edit) Make a new IP, IP range, or country access rule for the zone. Note: If you would like to create an access rule that applies across all of your owned zones, use the user or organization firewall endpoints as appropriate.

Parameters

$zone_id
$mode
The action to apply to a matched request
$configuration
Rule configuration
$notes
A personal note about the rule. Typically used as a reminder or explanation for the rule.
public
# update( string $zone_id, string $identifier, string|null $mode = null, string|null $notes = null )

Update access rule (permission needed: #zone:edit) Update rule state and/or configuration for the zone. Note: you can only edit rules in the 'zone' group via this endpoint. Use the appropriate owner rules endpoint if trying to manage owner-level rules

Update access rule (permission needed: #zone:edit) Update rule state and/or configuration for the zone. Note: you can only edit rules in the 'zone' group via this endpoint. Use the appropriate owner rules endpoint if trying to manage owner-level rules

Parameters

$zone_id
$identifier
$mode
The action to apply to a matched request
$notes
A personal note about the rule. Typically used as a reminder or explanation for the rule.
public
# delete_rule( string $zone_id, string $identifier, string|null $cascade = null )

Delete access rule (permission needed: #zone:edit) Remove an access rule so it is no longer evaluated during requests. Optionally, specify how to delete rules that match the mode and configuration across all other zones that this zone owner manages. 'none' is the default, and will only delete this rule. 'basic' will delete rules that match the same mode and configuration. 'aggressive' will delete rules that match the same configuration.

Delete access rule (permission needed: #zone:edit) Remove an access rule so it is no longer evaluated during requests. Optionally, specify how to delete rules that match the mode and configuration across all other zones that this zone owner manages. 'none' is the default, and will only delete this rule. 'basic' will delete rules that match the same mode and configuration. 'aggressive' will delete rules that match the same configuration.

Parameters

$zone_id
$identifier
$cascade
The level to attempt to delete rules defined on other zones that are similar to this rule
Methods inherited from Cloudflare\Api
__construct(), delete(), get(), patch(), permissions(), post(), put(), request(), setAuthKey(), setCurlOption(), setEmail()
Properties summary
protected array $permission_level

Default permissions level

Default permissions level

# ['read' => '#zone:read', 'edit' => '#zone:edit']
Properties inherited from Cloudflare\Api
$auth_key, $curl_options, $email
API documentation generated by ApiGen