PHP Class Cloudflare\Zone\Firewall\AccessRules

Firewall access rules for a Zone
Author: James Bell ([email protected])
Inheritance: extends CloudFlare\Api
ファイルを表示 Open project: jamesryanbell/cloudflare

Public Methods

Method Description
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.
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.
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
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.

Method Details

create() public method

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.
public create ( string $zone_id, string $mode, object $configuration, string | null $notes = null )
$zone_id string
$mode string The action to apply to a matched request
$configuration object Rule configuration
$notes string | null A personal note about the rule. Typically used as a reminder or explanation for the rule.

delete_rule() public method

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.
public delete_rule ( string $zone_id, string $identifier, string | null $cascade = null )
$zone_id string
$identifier string
$cascade string | null The level to attempt to delete rules defined on other zones that are similar to this rule

rules() public method

List access rules (permission needed: #zone:read) Search, sort, and filter IP/country access rule
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 )
$zone_id string
$scope_type string | null The scope of the rules
$mode string | null The action to apply to a matched request
$configuration_target string | null The rule configuration target
$configuration_value string | null Search by IP, range, or country code
$page integer | null Page number of paginated results
$per_page integer | null Number of rules per page
$order string | null Field to order rules by
$direction string | null Direction to order rules
$match string | null Whether to match all search requirements or at least one (any)

update() public method

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
public update ( string $zone_id, string $identifier, string | null $mode = null, string | null $notes = null )
$zone_id string
$identifier string
$mode string | null The action to apply to a matched request
$notes string | null A personal note about the rule. Typically used as a reminder or explanation for the rule.