Creates a scheduling rule for an on-demand instance.

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 CreateSchedruleOnDemand

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

InstanceId String Yes ddosbgp-cn-z2q1qzxb****

The ID of the on-demand instance.

Note You can call the DescribeOnDemandInstance operation to query the IDs of all on-demand instances.
RuleAction String Yes declare

The scheduling action. Set the value to declare, which indicates that the route is advertised.

RuleConditionCnt String Yes 3

If the inbound bandwidth or packets consecutively exceed the threshold for the specified number of times, the scheduling rule is triggered and traffic is rerouted to the on-demand instance. The specified number of times is the value of this parameter.

Note The threshold of inbound bandwidth is the value of RuleConditionMbps. The threshold of inbound packets is the value of RuleConditionKpps.
RuleConditionKpps String Yes 10

The threshold of inbound packets. Unit: Kpps. Minimum value: 10.

RuleConditionMbps String Yes 100

The threshold of inbound bandwidth. Unit: Mbit/s. Minimum value: 100.

RuleName String Yes ddosbgp-cn-z2q1qzxb****

The name of the scheduling rule.

The name can contain lowercase letters, digits, hyphens (-), and underscores (_). The name can be up to 32 characters in length. We recommend that you use the ID of the on-demand instance as the name. Example: ddosbgp-cn-z2q1qzxb****.

RuleSwitch String Yes on

Specifies whether the scheduling rule is enabled. Valid values:

  • on: enabled
  • off: disabled
RuleUndoBeginTime String Yes 03:00

The start time of the period during which the scheduling rule is automatically stopped. The time must be in the 24-hour clock and in the hh:mm format.

If the system detects that DDoS attacks stop, the system no longer reroutes traffic to the on-demand instance from the time you specified. We recommend that you set this parameter to a value that is defined as off-peak hours.

Note This parameter takes effect only when the RuleUndoMode parameter is set to auto.
RuleUndoMode String Yes auto

The stop method of the scheduling rule. Valid values:

  • auto: The scheduling rule automatically stops.
  • manual: The scheduling rule is manually stopped.
TimeZone String Yes GMT-08:00

The time zone of the time when the scheduling rule automatically stops. The time zone must be in the GMT-hh:mm format.

For example, the value GMT-08:00 indicates that the time zone is UTC+8.

Note This parameter takes effect only when the RuleUndoMode parameter is set to auto.
RuleUndoEndTime String No 03:05

The end time of the period during which the scheduling rule is automatically stopped. The time must be in the 24-hour clock and in the hh:mm format.

RegionId String No cn-zhangjiakou

The region ID of the on-demand instance.

Note You can call the DescribeRegions operation to query all regions supported by Anti-DDoS Origin.

All Alibaba Cloud API operations must include common request parameters. For more information about common request parameters, see Common parameters.

For more information about sample requests, see the "Examples" section of this topic.

Response parameters

Parameter Type Example Description
RequestId String BD06F539-2FBE-450D-9391-7EFF787128F5

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateSchedruleOnDemand
&InstanceId=ddosbgp-cn-z2q1qzxb****
&RuleAction=declare
&RuleConditionCnt=3
&RuleConditionKpps=10
&RuleConditionMbps=100
&RuleName=ddosbgp-cn-z2q1qzxb****
&RuleSwitch=on
&RuleUndoBeginTime=03:00
&RuleUndoMode=auto
&TimeZone=GMT-08:00
&<Common request parameters>

Sample success responses

XML format

<CreateSchedruleOnDemandResponse>
      <RequestId>BD06F539-2FBE-450D-9391-7EFF787128F5</RequestId>
</CreateSchedruleOnDemandResponse>

JSON format

{
    "RequestId": "BD06F539-2FBE-450D-9391-7EFF787128F5"
}

Error codes

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