PHP Class Cloudflare\Zone\Pagerules

Page rules for a Zone A rule describing target patterns for requests and actions to perform on matching requests
Author: James Bell ([email protected])
Inheritance: extends CloudFlare\Api
Show file Open project: jamesryanbell/cloudflare

Public Methods

Method Description
change ( string $zone_identifier, string $identifier, array | null $targets = null, array | null $actions = null, integer | null $priority = null, string | null $status = null ) Change a page rule [BETA] (permission needed: #zone:edit)
create ( string $zone_identifier, array $targets, array $actions, integer | null $priority = null, string | null $status = 'active' ) Create a page rule [BETA] (permission needed: #zone:edit)
delete_pagerule ( string $zone_identifier, string $identifier ) Delete a page rule [BETA] (permission needed: #zone:edit)
details ( string $zone_identifier, string $identifier ) Page rule details [BETA] (permission needed: #zone:read)
list_pagerules ( string $zone_identifier, string | null $status = null, string | null $order = null, string | null $direction = null, string | null $match = null ) List page rules [BETA] (permission needed: #zone:read)
update ( string $zone_identifier, string $identifier, array $targets, array $actions, integer | null $priority = null, string | null $status = null ) Update a page rule [BETA] (permission needed: #zone:edit) Replace a page rule. The final rule will exactly match the data passed with this request.

Method Details

change() public method

Change a page rule [BETA] (permission needed: #zone:edit)
public change ( string $zone_identifier, string $identifier, array | null $targets = null, array | null $actions = null, integer | null $priority = null, string | null $status = null )
$zone_identifier string API item identifier tag
$identifier string
$targets array | null Targets to evaluate on a request
$actions array | null The set of actions to perform if the targets of this rule match the request. Actions can redirect the url to another url or override settings (but not both)
$priority integer | null A number that indicates the preference for a page rule over another. In the case where you may have a catch-all page rule (e.g., #1: '/images/') but want a rule that is more specific to take precedence (e.g., #2: '/images/special/'), you'll want to specify a higher priority on the latter (#2) so it will override the first.
$status string | null Status of the page rule

create() public method

Create a page rule [BETA] (permission needed: #zone:edit)
public create ( string $zone_identifier, array $targets, array $actions, integer | null $priority = null, string | null $status = 'active' )
$zone_identifier string API item identifier tag
$targets array Targets to evaluate on a request
$actions array The set of actions to perform if the targets of this rule match the request. Actions can redirect the url to another url or override settings (but not both)
$priority integer | null A number that indicates the preference for a page rule over another. In the case where you may have a catch-all page rule (e.g., #1: '/images/') but want a rule that is more specific to take precedence (e.g., #2: '/images/special/'), you'll want to specify a higher priority on the latter (#2) so it will override the first.
$status string | null Status of the page rule

delete_pagerule() public method

Delete a page rule [BETA] (permission needed: #zone:edit)
public delete_pagerule ( string $zone_identifier, string $identifier )
$zone_identifier string API item identifier tag
$identifier string

details() public method

Page rule details [BETA] (permission needed: #zone:read)
public details ( string $zone_identifier, string $identifier )
$zone_identifier string API item identifier tag
$identifier string

list_pagerules() public method

List page rules [BETA] (permission needed: #zone:read)
public list_pagerules ( string $zone_identifier, string | null $status = null, string | null $order = null, string | null $direction = null, string | null $match = null )
$zone_identifier string API item identifier tag
$status string | null Status of the page rule
$order string | null Field to order page rules by (status, priority)
$direction string | null Direction to order page rules (asc, desc)
$match string | null Whether to match all search requirements or at least one (any) (any, all)

update() public method

Update a page rule [BETA] (permission needed: #zone:edit) Replace a page rule. The final rule will exactly match the data passed with this request.
public update ( string $zone_identifier, string $identifier, array $targets, array $actions, integer | null $priority = null, string | null $status = null )
$zone_identifier string API item identifier tag
$identifier string
$targets array Targets to evaluate on a request
$actions array The set of actions to perform if the targets of this rule match the request. Actions can redirect the url to another url or override settings (but not both)
$priority integer | null A number that indicates the preference for a page rule over another. In the case where you may have a catch-all page rule (e.g., #1: '/images/') but want a rule that is more specific to take precedence (e.g., #2: '/images/special/'), you'll want to specify a higher priority on the latter (#2) so it will override the first.
$status string | null Status of the page rule