Creates a scheduling rule for Sec-Traffic Manager.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateSchedulerRule

The operation that you want to perform. Set the value to CreateSchedulerRule.

RegionId String No cn-hangzhou

The region ID of the instance. Valid values:

  • cn-hangzhou: Chinese mainland, which indicates Anti-DDoS Pro instances
  • ap-southeast-1: outside the Chinese mainland, which indicates Anti-DDoS Premium instances
ResourceGroupId String No default

The ID of the resource group to which the instance belongs in Resource Management. This parameter is empty by default, which indicates that the instance belongs to the default resource group.

Rules String Yes [{"Type":"A", "Value":"1.1.XX.XX", "Priority":80,"ValueType":2, "RegionId":"cn-hangzhou" },{"Type":"A", "Value":"203.199.XX.XX", "Priority":80,"ValueType":1}]

The details of the scheduling rule. This parameter is a JSON string. The following list describes the fields in the value of the parameter:

  • Type: the address type of the interaction resource that you want to use in the scheduling rule. This field is required and must be of the string type. Valid values:
    • A: IP address
    • CNAME: domain name
  • Value: the address of the interaction resource that you want to use in the scheduling rule. This field is required and must be of the string type.
  • Priority: the priority of the scheduling rule. This field is required and must be of the integer type. Valid values: 0 to 100. A larger value indicates a higher priority.
  • ValueType: the type of the interaction resource that you want to use in the scheduling rule. This field is required and must be of the integer type. Valid values:
    • 1: the IP address of the Anti-DDoS Pro or Anti-DDoS Premium instance
    • 2: the IP address of the interaction resource in the tiered protection scenario
    • 3: the IP address that is used to accelerate access in the network acceleration scenario
    • 5: the domain name that is configured in Alibaba Cloud CDN (CDN) in the CDN interaction scenario
    • 6 the IP address of the interaction resource in the cloud service interaction scenario
  • RegionId: the region where the interaction resource is deployed. This parameter must be specified when ValueType is set to 2. The value must be of the string type.
RuleName String Yes testrule

The name of the scheduling rule.

RuleType Integer Yes 2

The type of the scheduling rule. Valid values:

  • 2: tiered protection
  • 3: network acceleration
  • 5: CDN interaction
  • 6: cloud service interaction
Param String No {"ParamType":"cdn","ParamData":"Domain":"example.aliyundoc.com","Cname":"demo.aliyundoc.com","AccessQps":100,"UpstreamQps":100}}

The details of the CDN interaction rule. This parameter is a JSON string. The following list describes the fields in the value of the parameter:

  • ParamType: the type of the scheduling rule. This field is required and must be of the string type. Set the value to cdn. This indicates that you want to create a CDN interaction rule.
  • ParamData: the parameters that you want to configure for the CDN interaction rule. This field is required and must be of the map type. The ParamData field contains the following parameters:
    • Domain: the accelerated domain in CDN. This parameter is required and must be of the string type.
    • Cname: the CNAME that is assigned to the accelerated domain. It is required and must be of the string type.
    • AccessQps: the queries per second (QPS) threshold that is used to switch service traffic to Anti-DDoS Pro or Anti-DDoS Premium. This parameter is required and must be of the integer type.
    • UpstreamQps: the QPS threshold that is used to switch service traffic to CDN. This parameter is optional and must be of the integer type.

Response parameters

Parameter Type Example Description
RequestId String 8DFB602D-1AAC-46C4-90F2-C84086E7A6E4

The ID of the request, which is used to locate and troubleshoot issues.

Cname String 48k7b372gpl4****.aliyunddos0001.com

The CNAME assigned by Sec-Traffic Manager for the scheduling rule.

Note To enable the scheduling rule, you must map the domain name of the service to the CNAME.
RuleName String testrule

The name of the scheduling rule.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateSchedulerRule
&ResourceGroupId=default
&Rules=[{"Type":"A", "Value":"1.1.XX.XX", "Priority":80,"ValueType":2, "RegionId":"cn-hangzhou" },{"Type":"A", "Value":"203.199.XX.XX", "Priority":80,"ValueType":1}]
&RuleName=testrule
&RuleType=2
&Param={"ParamType":"cdn","ParamData":"Domain":"example.aliyundoc.com","Cname":"demo.aliyundoc.com","AccessQps":100,"UpstreamQps":100}}
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateSchedulerRuleResponse>
    <RequestId>8DFB602D-1AAC-46C4-90F2-C84086E7A6E4</RequestId>
    <Cname>48k7b372gpl4****.aliyunddos0001.com</Cname>
    <RuleName>testrule</RuleName>
</CreateSchedulerRuleResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "8DFB602D-1AAC-46C4-90F2-C84086E7A6E4",
  "Cname" : "48k7b372gpl4****.aliyunddos0001.com",
  "RuleName" : "testrule"
}

Error codes

For a list of error codes, visit the Error Center.