All Documents
Current Document

Content is empty

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

Documentation

ListAlarmPolicy

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

ListAlarmPolicy

Call the ListAlarmPolicy API to retrieve all alarm policies configured under the specified account.


Description

Field

Value

API Name

ListAlarmPolicy

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: ListAlarmPolicy.

Version

Yes

String

Fixed value: 2021-01-01.

PageIndex

No

Integer

Page number. Must be greater than or equal to 1. Default: 1.

PageSize

No

Integer

Number of records per page. Valid range: 1100. Default: 10.


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 alarm policies matching the query.

data.alarmPolicyList

Array of AlarmPolicyObject

List of alarm policy objects. See AlarmPolicy Object below.

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.

triggerRuleCount

Integer

Number of trigger rules configured in this policy.

contactInfoCount

Integer

Number of contacts associated with this policy.

callbackUrl

String

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


Request Examples

Example: Query All Alarm Policies (Page 1)

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=ListAlarmPolicy&Version=2021-01-01&PageIndex=1&PageSize=10' \
-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": 10000,
                "policyName": "Disk Monitoring",
                "productType": 0,
                "policyType": 0,
                "enabled": 0,
                "instanceInfoCount": 2,
                "triggerRuleCount": 1,
                "contactInfoCount": 1,
                "callbackUrl": ""
            }
        ]
    },
    "totalCount": 1,
    "requestId": "xxxx"
}

XML Format

<Data>
    <AlarmPolicyList>
        <PolicyId>10000</PolicyId>
        <PolicyName>Disk Monitoring</PolicyName>
        <ProductType>0</ProductType>
        <PolicyType>0</PolicyType>
        <Enabled>0</Enabled>
        <InstanceInfoCount>2</InstanceInfoCount>
        <TriggerRuleCount>1</TriggerRuleCount>
        <ContactInfoCount>1</ContactInfoCount>
        <CallbackUrl></CallbackUrl>
    </AlarmPolicyList>
</Data>
<TotalCount>1</TotalCount>
<RequestId>xxxxx</RequestId>
Error Response

JSON Format

{
    "requestId": "xxxx",
    "error": {
        "type": "sender",
        "code": "InvalidParameterValue",
        "message": "Invalid `PageSize` parameter value, must be between 1 and 100."
    }
}

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