Queries details about 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 DescribeSceneDefensePolicies

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

Template String No promotion

The template of the policy. Valid values:

  • promotion: important activity
  • bypass: all traffic forwarded
Status String No 1

The status of the policy. Valid values:

  • 0: the Disabled state
  • 1: the Pending Enabled state
  • 2: the Running state
  • 3: the Expired state
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.

Response parameters

Parameter Type Example Description
Policies Array

Details about the policy.

Done Integer 1

The execution status of the policy. Valid values:

  • 1: not executed or execution completed
  • 0: being executed
  • -1: failed
EndTime Long 1586016000000

The end time of the policy. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.

Name String testpolicy

The name of the policy.

ObjectCount Integer 1

The number of protected targets.

PolicyId String 321a-fd31-df51-****

The ID of the policy.

RuntimePolicies Array

The running rules of the policy.

NewValue String {"cc_rule_enable": false}

The protection rule applied when the policy takes effect.

The value is {"cc_rule_enable": false} when PolicyType is set to 1. This indicates that the Frequency Control policy is disabled.

The value is {"ai_rule_enable": 0} when PolicyType is set to 2. This indicates that the Intelligent Protection policy is disabled.

PolicyType Integer 1

The protection policy whose status is changed when the policy takes effect. Valid values:

  • 1: the Frequency Control policy
  • 2: the Intelligent Protection policy
Status Integer 3

The running status of the policy. Valid values:

  • 0: The policy has not been issued or is restored.
  • 1: The policy is pending.
  • 2: The policy is being restored.
  • 3: The policy takes effect.
  • 4: The policy fails to take effect.
  • 5: The policy fails to be restored.
  • 6: The protection target specified in the policy does not exist, which may have been deleted.
oldValue String {"cc_rule_enable": true}

The protection rule applied before the policy takes effect.

The value is {"cc_rule_enable": true} when PolicyType is set to 1. This indicates that the Frequency Control policy is enabled.

The value is {"ai_rule_enable": 1} when PolicyType is set to 2. This indicates that the Intelligent Protection policy is enabled.

StartTime Long 1585670400000

The start time of the policy. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.

Status Integer 1

The status of the policy. Valid values:

  • 0: the Disabled state
  • 1: the Pending Enabled state
  • 2: the Running state
  • 3: the Expired state
Template String promotion

The template of the policy. Valid values:

  • promotion: important activity
  • bypass: all traffic forwarded
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=DescribeSceneDefensePolicies
&<Common request parameters>

Sample success responses

XML format

<DescribeSceneDefensePoliciesResponse>
      <Policies>
            <PolicyId>321a-fd31-df51-****</PolicyId>
            <Name>testpolicy</Name>
            <Template>promotion</Template>
            <StartTime>1585670400000</StartTime>
            <EndTime>1586016000000</EndTime>
            <Status>1</Status>
            <ObjectCount>1</ObjectCount>
            <Done>1</Done>
            <RuntimePolicies>
                  <Status>4</Status>
                  <PolicyType>1</PolicyType>
                  <NewValue>
                        <cc_rule_enable>false</cc_rule_enable>
                  </NewValue>
                  <oldValue>
                        <cc_rule_enable>true</cc_rule_enable>
                  </oldValue>
            </RuntimePolicies>
            <RuntimePolicies>
                  <Status>3</Status>
                  <PolicyType>2</PolicyType>
                  <NewValue>
                        <ai_rule_enable>0</ai_rule_enable>
                  </NewValue>
                  <oldValue>
                        <ai_rule_enable>1</ai_rule_enable>
                  </oldValue>
            </RuntimePolicies>
      </Policies>
      <Success>true</Success>
      <RequestId>F65DF043-E0EB-4796-9467-23DDCDF92C1D</RequestId>
</DescribeSceneDefensePoliciesResponse>

JSON format

{
    "Policies": [
        {
            "PolicyId": "321a-fd31-df51-****",
            "Name": "testpolicy",
            "Template": "promotion",
            "StartTime": 1585670400000,
            "EndTime": 1586016000000,
            "Status": 1,
            "ObjectCount": 1,
            "Done": 1,
            "RuntimePolicies": [
                {
                    "Status": 4,
                    "PolicyType": 1,
                    "NewValue": {
                        "cc_rule_enable": false
                    },
                    "oldValue": {
                        "cc_rule_enable": true
                    }
                },
                {
                    "Status": 3,
                    "PolicyType": 2,
                    "NewValue": {
                        "ai_rule_enable": 0
                    },
                    "oldValue": {
                        "ai_rule_enable": 1
                    }
                }
            ]
        }
    ],
    "Success": true,
    "RequestId": "F65DF043-E0EB-4796-9467-23DDCDF92C1D"
}

Error codes

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