All Documents
Current Document

Content is empty

If you don't find the content you expect, please try another search term

Documentation

DescribeAlarmPolicy

Last updated:2026-03-18 14:12:49

DescribeAlarmPolicy

Call the DescribeAlarmPolicy API to retrieve detailed configuration information for a specific alarm policy under the specified account. Note that this response does not include the list of associated instance details — use the Query Alarm Policy Associated Instances API for that.


Description

Field

Value

API Name

DescribeAlarmPolicy

Request Method

GET

Endpoint

monitor.api.ksyun.com

VPC Internal Endpoint

monitor.internal.api.ksyun.com

Version

2021-01-01


Request Parameters

All requests must include the Common Request Parameters. The table below lists only the API-specific parameters.

Parameter

Required

Type

Description

Action

Yes

String

Fixed value: DescribeAlarmPolicy.

Version

Yes

String

Fixed value: 2021-01-01.

PolicyId

Yes

Integer

The ID of the alarm policy to query. To retrieve policy IDs, see Query Alarm Policies.


Response Parameters

Both XML and JSON formats are supported.

Top-Level Fields

Field

Type

Description

requestId

String

Unique request ID.

totalCount

Integer

Total number of records returned.

data.alarmPolicyList

Array of AlarmPolicyObject

List of alarm policy detail objects.

AlarmPolicyObject

Field

Type

Description

policyId

Integer

Unique ID of the alarm policy.

policyName

String

Name of the alarm policy.

productType

Integer

Cloud service category ID. See Cloud Service Categories.

policyType

Integer

Policy type. 0: Standard policy. 1: Default policy.

enabled

Integer

Whether the policy is enabled. 0: Disabled. 1: Enabled.

instanceInfoCount

Integer

Number of instances associated with this policy.

triggerRuleList

Array of TriggerRuleObject

List of trigger rules. See TriggerRule Object below.

contactInfoList

Array of ContactInfoObject

List of associated contacts. See ContactInfo Object below.

callbackUrl

String

Webhook callback URL for alarm notifications. Empty string if not configured.

TriggerRuleObject

Field

Type

Description

triggerId

Integer

Unique ID of the trigger rule.

period

String

Statistical period. Example: 3m (3 minutes), 60m (1 hour).

method

String

Statistical aggregation method. Supported values: avg, max, min, sum.

compare

String

Comparison operator. Supported values: >, <, =. (Note: \u003e is the Unicode escape for >.)

triggerValue

String

Threshold value that triggers the alarm.

itemName

String

Display name of the monitoring metric. Example: Disk Usage.

itemKey

String

Identifier key of the monitoring metric. Example: vfs.fs.size.

units

String

Unit of the monitoring metric. Example: %.

effectBT

String

Start time of the rule's effective window. Format: HH:mm. Example: 00:00.

effectET

String

End time of the rule's effective window. Format: HH:mm. Example: 23:59.

tags

String

Dimension tags for filtering metric data. Example: p2=pused.

interval

String

Interval between repeated alarm notifications. Example: 5m.

points

Integer

Number of consecutive periods that must breach the threshold before an alarm fires.

maxCount

Integer

Maximum number of alarm notifications to send. Valid range: 15.

ContactInfoObject

Field

Type

Description

contactId

Integer

Unique ID of the contact or contact group.

contactName

String

Name of the contact or contact group.

contactWay

Integer

Notification delivery method. 1: Email only. 2: SMS only. 3: Email and SMS.

contactFlag

Integer

Contact type. 1: Contact group. 2: Individual contact.


Request Examples

Example: Query Detailed Information for a Specific Alarm Policy

Request

Replace ${region} with the appropriate region code. See: Region Reference. Replace ${CommonParams} with the appropriate common parameters. See: Common Parameters.

curl -X GET 'https://monitor.${region}.api.ksyun.com/?Action=DescribeAlarmPolicy&Version=2021-01-01&PolicyId=20000' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'host: monitor.api.ksyun.com' \
-H 'cache-control: no-cache' \
-H ${CommonParams}
Successful Response

JSON Format

{
    "data": {
        "alarmPolicyList": [
            {
                "policyId": 20000,
                "policyName": "Disk Monitoring",
                "productType": 0,
                "policyType": 0,
                "enabled": 0,
                "instanceInfoCount": 10,
                "triggerRuleList": [
                    {
                        "triggerId": 10000,
                        "period": "3m",
                        "method": "avg",
                        "compare": ">",
                        "triggerValue": "90",
                        "itemName": "Disk Usage",
                        "itemKey": "vfs.fs.size",
                        "units": "%",
                        "effectBT": "00:00",
                        "effectET": "23:59",
                        "tags": "p2=pused",
                        "interval": "5m",
                        "points": 1,
                        "maxCount": 3
                    }
                ],
                "contactInfoList": [
                    {
                        "contactId": 1,
                        "contactName": "sys-kop",
                        "contactWay": 1,
                        "contactFlag": 1
                    }
                ],
                "callbackUrl": ""
            }
        ]
    },
    "totalCount": 1,
    "requestId": "xxxx"
}

XML Format

<Data>
    <AlarmPolicyList>
        <PolicyId>20000</PolicyId>
        <PolicyName>Disk Monitoring</PolicyName>
        <ProductType>0</ProductType>
        <PolicyType>0</PolicyType>
        <Enabled>0</Enabled>
        <InstanceInfoCount>10</InstanceInfoCount>
        <TriggerRuleList>
            <TriggerId>10000</TriggerId>
            <Period>3m</Period>
            <Method>avg</Method>
            <Compare>&gt;</Compare>
            <TriggerValue>90</TriggerValue>
            <ItemName>Disk Usage</ItemName>
            <ItemKey>vfs.fs.size</ItemKey>
            <Units>%</Units>
            <EffectBT>00:00</EffectBT>
            <EffectET>23:59</EffectET>
            <Tags>p2=pused</Tags>
            <Interval>5m</Interval>
            <Points>1</Points>
            <MaxCount>3</MaxCount>
        </TriggerRuleList>
        <ContactInfoList>
            <ContactId>1</ContactId>
            <ContactName>sys-kop</ContactName>
            <ContactWay>1</ContactWay>
            <ContactFlag>1</ContactFlag>
        </ContactInfoList>
        <CallbackUrl></CallbackUrl>
    </AlarmPolicyList>
</Data>
<TotalCount>1</TotalCount>
<RequestId>xxxxx</RequestId>
Error Response

JSON Format

{
    "requestId": "xxxx",
    "error": {
        "type": "sender",
        "code": "InvalidParameterValue",
        "message": "Invalid `PolicyId` parameter value, policy does not exist."
    }
}

Error Codes

The table below lists only the error codes specific to this API's business logic. For all other error codes, refer to Common Error Codes.

On this page
Pure ModeNormal Mode

Pure Mode

Click to preview the document content in full screen
Feedback