All Products
Search
Document Center

Anti-DDoS:CreateSchedulerRule

Last Updated:Apr 16, 2024

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.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
yundun-ddoscoo:CreateSchedulerRuleWrite
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ResourceGroupIdstringNo

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.

default
RulesstringYes

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.

[{"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}]
RuleNamestringYes

The name of the rule.

testrule
RuleTypeintegerYes

The type of the custom defense rule. Valid values:

  • 2: tiered protection
  • 3: network acceleration
  • 5: CDN interaction
  • 6: cloud service interaction
2
ParamstringNo

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 modify a CDN interaction rule.

  • ParamData: the values of parameters that you want to modify for the CDN interaction rule. This field is required and must be of the map type. ParamData 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. This parameter 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.
{"ParamType":"cdn","ParamData":{"Domain":"example.aliyundoc.com","Cname":"demo.aliyundoc.com","AccessQps":100,"UpstreamQps":100}}

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

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

8DFB602D-1AAC-46C4-90F2-C84086E7A6E4
Cnamestring

The CNAME that is 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.
48k7b372gpl4****.aliyunddos0001.com
RuleNamestring

The name of the rule.

testrule

Examples

Sample success responses

JSONformat

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

Error codes

For a list of error codes, visit the Service error codes.