以下 API 皆需 API Token 相關 Header
GET /api/v1/user/site/{siteID}/firewall/setting/whitelists
根據站點ID取得此站點下的所有白名單列表。
curl --request GET \
--header "SKC-RefreshToken: {Your Refresh Token}" \
--header "SKC-AccessToken: {Your Access Token}" \
'{CDNRay API Endpoint}/api/v1/user/site/{siteID}/firewall/setting/whitelists'
{
"code": 101001,
"data": [
{
"id": 1,
"ips": [
"1.1.1.2"
],
"url": "kkk3.com",
"methods": {
"get": true,
"post": true,
"put": true,
"delete": true,
"head": true,
"patch": true,
"options": true
}
}
]
}
POST /api/v1/user/site/{siteID}/firewall/setting/whitelists
根據站點ID新增數個白名單。
curl --request POST \
--header 'Content-Type: application/json' \
--header "SKC-RefreshToken: {Your Refresh Token}" \
--header "SKC-AccessToken: {Your Access Token}" \
--data '{
"data": [
{
"ips": ["1.1.1.2"],
"url": "kkk3.com",
"methods": {
"get": true,
"post": true,
"put": true,
"delete": true,
"head": true,
"patch": true,
"options": true
},
"blockType": 2
}
]
}' \
'{CDNRay API Endpoint}/api/v1/user/site/{siteID}/firewall/setting/whitelists'
{
"data": [
{
"ips": ["1.1.1.2"],
"url": "kkk3.com",
"methods": {
"get": true,
"post": true,
"put": true,
"delete": true,
"head": true,
"patch": true,
"options": true
},
"blockType": 2
}
]
}
{ "code": 101001 }
PUT /api/v1/user/site/{siteID}/firewall/setting/whitelist
根據站點ID更新指定ID的白名單
curl --request PUT \
--header 'Content-Type: application/json' \
--header "SKC-RefreshToken: {Your Refresh Token}" \
--header "SKC-AccessToken: {Your Access Token}" \
--data '{
"id":1,
"ips": [
"1.1.1.1"
],
"url": "kkk.com",
"methods": {
"get": true,
"post": true,
"put": true,
"delete": true,
"head": true,
"patch": true,
"options": true
},
"blockType": 2
}' \
'{CDNRay API Endpoint}/api/v1/user/site/{siteID}/firewall/setting/whitelist'
{
"id":1,
"ips": [
"1.1.1.1"
],
"url": "kkk.com",
"methods": {
"get": true,
"post": true,
"put": true,
"delete": true,
"head": true,
"patch": true,
"options": true
},
"blockType": 2
}
{ "code": 101001 }
DELETE /api/v1/user/site/{siteID}/firewall/setting/whitelists
根據指定的IDs刪除複數白名單
curl ---request DELETE \
--header 'Content-Type: application/json' \
--header "SKC-RefreshToken: {Your Refresh Token}" \
--header "SKC-AccessToken: {Your Access Token}" \
--data '{
"ids":[1,2,3,8]
}' \
'{CDNRay API Endpoint}/api/v1/user/site/{siteID}/firewall/setting/whitelists'
{ "ids":[1,2,3,8] }
{ "code": 101001 }