Creates a scenario-specific custom policy.

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 CreateSceneDefensePolicy

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

Name String Yes testpolicy

The name of the policy.

Template String Yes promotion

The type of the template. Set the value to promotion, which indicates the template for major events.

StartTime Long Yes 1585670400000

The time when the policy starts to take effect. The value is a UNIX timestamp. Unit: milliseconds.

EndTime Long Yes 1586016000000

The time when the policy expires. The value is a UNIX timestamp. Unit: milliseconds.

RegionId String No cn-hangzhou

The region ID of the instance. Valid values:

  • cn-hangzhou: mainland China, which indicates an Anti-DDoS Pro instance. This is the default value.
  • ap-southeast-1: outside mainland China, which indicates an Anti-DDoS Premium instance.

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 F65DF043-E0EB-4796-9467-23DDCDF92C1D

The ID of the request.

Success Boolean true

Indicates whether the request is successful. Valid values:

  • true: The request is successful.
  • false: The request failed.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateSceneDefensePolicy
&Name=testpolicy
&Template=promotion
&StartTime=1585670400000
&EndTime=1586016000000
&Common request parameters

Sample success responses

XML format

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

<CreateSceneDefensePolicyResponse>
    <RequestId>F65DF043-E0EB-4796-9467-23DDCDF92C1D</RequestId>
    <Success>true</Success>
</CreateSceneDefensePolicyResponse>

JSON format

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

{
  "RequestId" : "F65DF043-E0EB-4796-9467-23DDCDF92C1D",
  "Success" : true
}

Error codes

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