Enabling or Disabling Range-based Retrieval
Function
In range-based retrieval, the origin server sends data of a specified range to a CDN node based on the range information in the HTTP request header.
Before enabling range-based retrieval, check whether the origin server supports range requests. If the origin server does not support range requests, enabling range-based retrieval will cause cache failure.
URI
PUT /v1.0/cdn/domains/{domain_id}/range-switch
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
domain_id |
Yes |
String |
Specifies the acceleration domain name ID. For details, see Querying Details About a Domain Name. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enterprise_project_id |
No |
String |
Enterprise project that the domain name to be modified belongs to. This parameter is valid only when the enterprise project function is enabled. The value all indicates all projects. This parameter is mandatory when you use an IAM user to call this API. Obtain the enterprise project ID by calling the ListEnterpriseProject API of Enterprise Project Management Service (EPS). |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Specifies the user token. The token can be obtained by calling the IAM API used to obtain a user token. The value of **X-Subject-Token** in the response header is the user token. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
range_status |
Yes |
String |
Specifies the status of range-based retrieval. Possible values: off and on. Enumeration values:
|
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
origin_range |
OriginRangeBody object |
Specifies the range-based retrieval settings. |
Example Requests
PUT https://cdn.myhuaweicloud.com/v1.0/cdn/domains/ff80808266fd001e0166fd21c65d0337/range-switch { "range_status" : "on" }
Example Responses
Status code: 200
OK
{ "origin_range" : { "domain_id" : "ff8080826812caa9016812dbfcd400ea", "range_status" : "off" } }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot