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.

RuleName String Yes testrule

The name of the scheduling rule.

Rules String Yes [{"Type":"A", "Value":"1.1.1.1", "Priority":80,"ValueType":2, "RegionId":"cn-hangzhou" },{"Type":"A", "Value":"203. ***. ***.199", "Priority":80,"ValueType":1}]

Details about the scheduling rule. This parameter is a JSON string. The fields in the value are described as follows:

  • 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 Anti-DDoS Pro or Anti-DDoS Premium
    • 2: the IP address of the interaction resource (in the tiered protection scenario)
    • 3: the IP address used to accelerate access (in the network acceleration scenario)
    • 5: the domain name configured in 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.
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
RegionId String No cn-hangzhou

The region ID of the instance. Valid values:

  • cn-hangzhou: mainland China, which indicates an Anti-DDoS Pro instance
  • ap-southeast-1: outside mainland China, which indicates an Anti-DDoS Premium instance
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.

Param String No {"ParamType":"cdn","ParamData":{"Domain":"cdn.test.com","Cname":"cdncname.test.com","AccessQps":100,"UpstreamQps":100}}

Details about the CDN interaction rule. This parameter is a JSON string. The fields in the value are described as follows:

  • ParamType: the type of the scheduling rule that you want to create. 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. The field is required and must be of the MAP type.
    • Domain: the domain name configured in CDN. It is required and must be of the STRING type.
    • Cname: the CNAME record of the domain name configured in CDN. It is required and must be of the STRING type.
    • AccessQps: the queries per second (QPS) threshold used to switch service traffic to Anti-DDoS Pro or Anti-DDoS Premium. It is required and must be of the INTEGER type.
    • UpstreamQps: the QPS threshold used to switch service traffic to CDN. It must be of the INTEGER type.

Response parameters

Parameter Type Example Description
Cname String 48k7b372gpl4****.aliyunddos0001.com

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

Note To enable the rule, you must map the domain name of your service to the CNAME record.
RequestId String 0bcf28g5-d57c-11e7-9bs0-d89d6717dxbc

The ID of the request.

RuleName String testrule

The name of the rule.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateSchedulerRule
&RuleName=testrule
&Rules=[{"Type":"A", "Value":"1.1.1.1", "Priority":80,"ValueType":2, "RegionId":"cn-hangzhou" },{"Type":"A", "Value":"203. ***. ***.199", "Priority":80,"ValueType":1}]
&RuleType=2
&<Common request parameters>

Sample success responses

XML format

<CreateSchedulerRuleResponse>
      <RequestId>0bcf28g5-d57c-11e7-9bs0-d89d6717dxbc</RequestId>
      <Cname>48k7b372gpl4****.aliyunddos0001.com</Cname>
      <RuleName>testrule</RuleName>
</CreateSchedulerRuleResponse>

JSON format

{
    "RequestId": "0bcf28g5-d57c-11e7-9bs0-d89d6717dxbc",
    "Cname": "48k7b372gpl4****.aliyunddos0001.com",
    "RuleName": "testrule"
}

Error codes

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