List Access Control
This API is used to list access controls for the website acceleration service.
Request
Request-Line
GET /cdn/v1.0/services/{serviceId}/accessControl HTTP/1.1
Request Parameters
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| serviceId | Integer | Mandatory | The unique identifier of the website acceleration service. |
Response
Response Body
| Parameter | Type | Description |
|---|---|---|
| Array | Array of Access Controls. |
Object: Access Control
| Parameter | Type | Description |
|---|---|---|
| policyId | Integer | Policy id number for access control. |
| policyName | String | Policy name for access control. |
| type | String | Access control type. can be "allow", "deny" or "token". |
| matchUrlPath | Object | URL path matching configuration that determines which requests the rule applies to. See Match Url Path for details. |
| matchQueryString | Object | Query-string matching configuration used to refine which requests the rule applies to. See Match Query String for details. |
| priority | Integer | Priority weight for the rule. Rules with a higher weight take precedence. The weight must be a positive integer. |
| ipRestriction | String | The value must be a comma-separated list of IPs or CIDR networks. Only requests from these subnets are allowed. All other requests will be rejected with a 403 Forbidden response. |
| geoRestriction | String | The value must be a comma-separated list of geographic locations. Each location must be specified as a 2-letter ISO 3166 code (e.g., CN, GB). |
| anonymousIp | Boolean | When true, the rule applies to requests from anonymous IPs (e.g., VPNs, proxies). When false, it applies to non-anonymous IPs only, Default is false. |
| tokenSecret | String | The tokenSecret Field is applicable only when type is token. The value must be a comma-separated list of tokens. Each token must be exactly 64 characters long, and each character must be a digit (0-9) or a lowercase letter (a-z). |
| enabled | Boolean | Flag indicating whether the rule is active. Default is true. |
Object: Match Url Path
| Parameter | Type | Required | Description |
|---|---|---|---|
| operator | String | Mandatory | Defines how to match the field. Supported values: prefix, regex, equals, suffix. |
| patterns | Array | Mandatory | List of patterns matching the URL path string. |
Object: Match Query String
| Parameter | Type | Required | Description |
|---|---|---|---|
| operator | String | Mandatory | Defines how to match the field. Supported values: prefix, regex, equals, suffix. |
| patterns | Array | Mandatory | List of patterns matching the URL query string. |
Status Codes, Error Codes and Error Messages
| Status Code | Error Code | Error Message |
|---|---|---|
| 400 | InvalidService.IdIncorrect | Service ID is empty or invalid. |
| 400 | InvalidCustomer.IdEmpty | Customer ID cannot be empty or invalid. |
| 400 | InvalidService.IdPermission | Service ID cannot be found or unknown. |
Examples
List Access Control
Request
GET /cdn/v1.0/services/228654/accessControl HTTP/1.1
Successful Response Body
[
{
"policyId": 261847,
"policyName": "agfghjc",
"type": "token",
"matchUrlPath": {
"operator": "suffix",
"patterns": [
"/wp-content/web/"
]
},
"priority": 66,
"ipRestriction": "172.16.18.0/255.255.255.0",
"geoRestriction": "US",
"tokenSecret": "bdfy7r6jflo3iydy9zxigkl5m0hte6d423d45dfg6gavo07xvmtc4tzsdc9yxyjy",
"enabled": true
},
{
"policyId": 261848,
"policyName": "agfghjc",
"type": "token",
"matchUrlPath": {
"operator": "suffix",
"patterns": [
"/wp-content/web/"
]
},
"priority": 67,
"ipRestriction": "172.16.18.0/255.255.255.0",
"geoRestriction": "US",
"tokenSecret": "bdfy7r6jflo3iydy9zxigkl5m0hte6d423d45dfg6gavo07xvmtc4tzsdc9yxyjy",
"enabled": true
}
]