Class Pagerules
CloudFlare API wrapper
Page rules for a Zone
A rule describing target patterns for requests and actions to perform on matching requests
-
Cloudflare\Api
-
Cloudflare\Zone\Pagerules
Methods summary
public
|
#
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)
Create a page rule [BETA] (permission needed: #zone:edit)
Parameters
- $zone_identifier
- API item identifier tag
- $targets
- Targets to evaluate on a request
- $actions
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
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
- Status of the page rule
|
public
|
#
details( string $zone_identifier, string $identifier )
Page rule details [BETA] (permission needed: #zone:read)
Page rule details [BETA] (permission needed: #zone:read)
Parameters
- $zone_identifier
- API item identifier tag
- $identifier
|
public
|
#
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)
Change a page rule [BETA] (permission needed: #zone:edit)
Parameters
- $zone_identifier
- API item identifier tag
- $identifier
- $targets
- Targets to evaluate on a request
- $actions
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
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
- Status of the page rule
|
public
|
#
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.
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.
Parameters
- $zone_identifier
- API item identifier tag
- $identifier
- $targets
- Targets to evaluate on a request
- $actions
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
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
- Status of the page 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']
|