All Documents
Current Document

Content is empty

If you don't find the content you expect, please try another search term

Documentation

SetOriginAdvancedConfig

Last updated:2021-03-17 11:07:30

SetOriginAdvancedConfig

Description

You can call this operation to configure the hot standby origin and advanced back-to-origin policy.

Note:

  • After advanced back-to-origin is enabled, the basic back-to-origin configuration is disabled.

Request syntax

The API request contains the specified directory /2016-09-01/domain/SetOriginAdvancedConfig, common request headers, and operation-specific request parameters. For more information, see the sample request.

Request headers

Header Required Type Description
X-Version Yes String The version number. Set the value to 2016-09-01.
X-Action Yes String The operation that you want to perform. Set the value to SetOriginAdvancedConfig.

Request parameters

Parameter Required Type Description
DomainId Yes String The ID of the domain name.
Enable Yes String Specifies whether to enable advanced back-to-origin. Valid values: on and off. After advanced back-to-origin is enabled, the basic back-to-origin configuration is disabled. Default value: off. If the Enable parameter is set to on, the following parameters are required. If the Enable parameter is set to off, the following parameters are ignored.
OriginType Yes String The type of the main origin. Valid values: ipaddr (IP address) and domain (domain name). The main origin is specified when the domain name is added. After advanced back-to-origin is disabled, the back-to-origin configuration specified when the domain name is added takes effect.
Origin Yes String The address of the main origin, which is an IP address or a domain name. You can specify either up to 20 IP addresses separated with commas (,) or only one domain name.
BackupOriginType Yes String The type of the hot standby origin. Valid values: ipaddr (IP address) and domain (domain name).
BackupOrigin Yes String The address of the hot standby origin, which is an IP address or a domain name. You can specify either up to 20 IP addresses separated with commas (,) or only one domain name.
OriginPolicy Yes String The origin policy. Valid values: rr (round robin) and quality (round robin in top N origins).
OriginPolicyBestCount Yes Long The number of top origins. Valid values: 1 to 10. This parameter is required if the OriginPolicy parameter is set to quality.

Examples

Sample request

POST method:


POST /2016-09-01/domain/SetOriginAdvancedConfig
 Host: cdn.api.ksyun.com
 X-Amz-Date: date 
 Authorization:authorization string 
 x-action: SetOriginAdvancedConfig 
 x-version: 2016-09-01 
 Content-Type: application/json

{
    "DomainId": "2D08M8V",
    "Enable": "on",
    "OriginType": "domain",
    "Origin": "www.test1.com",
    "BackupOriginType": "domain",
    "BackupOrigin": "www.test2.com",
    "OriginPolicy": "quality",
    "OriginPolicyBestCount": 2
}

Sample response

  • Note: If this operation is successfully called, the HTTP status code 200 is returned, without a return value. If this operation fails to be called, the HTTP status code 403 or 400 is returned. For more information about the error codes for the HTTP status code 400, see Usage notes.
On this page
Pure ModeNormal Mode

Pure Mode

Click to preview the document content in full screen
Feedback