List Access Controls
This API is used to list url access controls policy for website accleration domain or filedownload service.
1. Request Definition
- API URL
https://cdn-api.swiftfederation.com/v2.0/services/{serviceId}/access_controls
- Request Method
GET
- Request Header
Refer to HTTP Request Headers
- Request Body
No request body for this API.
2. Response Definition
- Response Header
Refer to HTTP Response Headers
- Response Body
Field | Type | Description |
---|---|---|
id | int | Policy ID number for access control. |
name | string | Policy name for access control. |
type | string | Access control type, could be "allow", "deny" or "token". |
matchType | string | Policy match type, could be "regex" or "prefix". |
match | string | Prefix or regex of url pattern. |
priority | int | Priority weight of access control policy. policy with bigger weight will have higher priority, weight value can not be zero. |
subnet | string | Comma-separated list of ips/networks.Only requests from these subnets are allowed, other requests will be rejected with 403 Forbidden response. Examples: 172.31.31.0/255.255.255.0,172.31.32.0/24 |
location | string | Comma-separated list of geographic locations to be matched. Each location should be specified as a 2-letter ISO3166 code. E.g "SG,GB". |
Field tokenSecret is only for type "token".
Field | Type | Description |
---|---|---|
tokenSecret | string | Comma-separated list of tokens. |
- Response Body Example
[
{
"id": 1001,
"name": "ac1001",
"type": "allow",
"matchType": "regex",
"match": "/*.js",
"priority": 20,
"subnet": "192.168.1.0/24",
"location": "SG,CN"
},
{
"id": 1002,
"name": "ac1002",
"type": "deny",
"matchType": "regex",
"match": "/*.js",
"priority": 15,
"subnet": "192.168.1.0/24",
"location": "SG,CN"
},
{
"id": 1003,
"name": "ac1003",
"type": "token",
"matchType": "prefix",
"match": "/protected/*",
"priority": 11,
"subnet": "172.31.31.0/255.255.255.0,172.31.32.0/24",
"location": "SG,CN",
"tokenSecret":"qjzw8z2c306hwqqg7pkl0po1k1afqljf4oxcbxv511wds50j56y5qyh1f2i8wi9b, 5i70op0gqbvvfbz6r8qosn0qkxsxcxavqy7xs2heoomhtt7n3bmtwye6qme5jxwu"
}
]