Found 0 result in total
Content is empty
If you don't find the content you expect, please try another search term
Last updated:2021-03-17 10:56:37
You can call this operation to block or unblock URLs.
Notes:
A URL blocking quota is specified for each account ID and is shared with the Kingsoft Cloud CDN console. You can query the quota in the Kingsoft Cloud CDN console or by calling the GetBlockUrlQuota
operation. Blocking fails when the number of blocked URLs exceeds the upper limit.
When you attempt to access a blocked URL, the HTTP status code 403 is returned.
Limits:
If you unblock a URL that does not exist or has been unblocked, a success message is returned.
All URLs must start with http://. Both HTTP access and HTTPS access are disabled for the specified URLs.
Each URL can be up to 1,000 characters in length.
All URLs must belong to the domain names that have been added to Kingsoft Cloud CDN for accelerated content delivery.
Chinese characters in URLs must be URL-encoded.
You can block or unblock up to 1,000 URLs at a time.
The API request contains the specified directory /2016-09-01/content/BlockDomainUrl, common request headers, and operation-specific request parameters. For more information, see the sample request.
Parameter | Type | Required | Description |
---|---|---|---|
BlockType | String | Yes | The type of the operation. Valid values: block and unblock. |
Urls | Url[] | Yes | The URLs. |
BlockTime | Long | No | The blocking period. Unit: seconds. This parameter takes effect only when the BlockType parameter is set to block. The period ranges from 1 hour to 31 days. Default value: 604800 (7 days). The URLs are automatically unblocked when the blocking period ends. Note: In the current version, you can set this parameter, but the setting does not take effect. The default value (7 days) is used. This issue will be fixed in the next version. |
RefreshOnUnblock | String | No | Specifies whether to trigger refreshing after unblocking. This parameter takes effect only when the BlockType parameter is set to unblock. Valid values: on and off. Default value: off. |
Parameter | Type | Description |
---|---|---|
Url | String | The specified URL, which starts with http://. Both HTTP access and HTTPS access are disabled. |
None
Error code | Error message | Description |
---|---|---|
IllegalOperation | Illegal domain operate is not permitted. | The error message returned because you are not authorized to perform this operation. |
QuotaOverfull | The error message returned because the quota runs out. |
Sample request
POST method:
POST /2016-09-01/content/BlockDomainUrl
Host: cdn.api.ksyun.com
X-Amz-Date: date
Authorization:authorization string
x-action: BlockDomainUrl
x-version: 2016-09-01
Content-Type: application/json
{
"DomainId": "2D08M8V",
"BlockType":"block",
"BlockTime":3600,
"Urls":[{"Url":"http://www.test.com/abc.txt"},
{"Url":"http://www.test.com/txa.txt"}]
}
Sample response
Pure Mode