Queries the list of alarm policies (by instance, etc.)

Last updated: 2021-04-19 11:25:44

1. API Description

Domain name for API request: monitor.tencentcloudapi.com.

This API is used to query the list of alarm policies.

A maximum of 20 requests can be initiated per second for this API.

Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example: monitor.ap-shanghai-fsi.tencentcloudapi.com

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common parameter. The value used for this API: DescribeAlarmPolicies.
Version Yes String Common parameter. The value used for this API: 2018-07-24.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
Module Yes String Value fixed at "monitor"
PageNumber No Integer Page number starting from 1. Default value: 1
PageSize No Integer Number of entries per page. Value range: 1–100. Default value: 20
PolicyName No String Fuzzy search by policy name
MonitorTypes.N No Array of String Filter by monitor type. Valid values: MT_QCE (Tencent Cloud service monitoring). If this parameter is left empty, all will be queried by default
Namespaces.N No Array of String Filter by namespace. For the values of different policy types, please see:
Policy Type List
Dimensions No String Alarm object list. The outer array corresponds to multiple instances.
Each inner array corresponds to one instance, where object corresponds to the dimension information of the instance. The format is as follows:
[
[{"name":"unInstanceId","value":"ins-qr888845g"}],
[{"name":"unInstanceId","value":"ins-qr8d555g"}]
...
]
For the samples for different Tencent Cloud services, please see:
Dimension List
ReceiverUids.N No Array of Integer Search by recipient uid, which should be queried by calling the CAM API. For more information, please see:
ListUsers
ReceiverGroups.N No Array of Integer Search by recipient group uid, which should be queried by calling the CAM API. For more information, please see:
ListGroups
PolicyType.N No Array of String Filter by default policy. Valid values: DEFAULT (display default policy), NOT_DEFAULT (display non-default policies). If this parameter is left empty, all policies will be displayed
Field No String Sort by field. For example, to sort by the last modification time, use Field: "UpdateTime".
Order No String Sort order. Valid values: ASC (ascending), DESC (descending)
ProjectIds.N No Array of Integer ID array of the policy project, which can be viewed on the following page:
Project Management
NoticeIds.N No Array of String ID list of the notification template, which can be obtained by querying the notification template list.
DescribeAlarmNotices
RuleTypes.N No Array of String Filter by trigger condition. Valid values: STATIC (display policies with static threshold), DYNAMIC (display policies with dynamic threshold). If this parameter is left empty, all policies will be displayed
Enable.N No Array of Integer Filter by alarm status. Valid values: [1]: enabled; [0]: disabled; [0, 1]: all
NotBindingNoticeRule No Integer If 1 is passed in, alarm policies with no notification rules configured are queried. If it is left empty or other values are passed in, all alarm policies are queried.

3. Output Parameters

Parameter Name Type Description
TotalCount Integer Total number of policies
Policies Array of AlarmPolicy Policy array
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Querying the list of alarm policies (by instance, etc.)

Input Example

POST / HTTP/1.1
Host: monitor.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeAlarmPolicies
<Common request parameters>

{
    "Module": "monitor",
    "PolicyName": "policy",
    "PageSize": 10,
    "PageNumber": 1
}

Output Example

{
  "Response": {
    "Policies": [
      {
        "PolicyId": "policy-pvnj4u7h",
        "PolicyName": "Test-2",
        "UseSum": 0,
        "Remark": "For-Test-2",
        "MonitorType": "MT_QCE",
        "Enable": 1,
        "RuleType": "STATIC",
        "TagInstances": null,
        "IsDefault": 0,
        "ProjectId": 0,
        "ProjectName": "",
        "Namespace": "cvm_device",
        "ConditionTemplateId": "",
        "Condition": {
          "IsUnionRule": 0,
          "Rules": [
            {
              "MetricName": "CpuUsage",
              "Description": "CPU utilization",
              "Period": 60,
              "Operator": "gt",
              "Value": "0",
              "ContinuePeriod": 1,
              "NoticeFrequency": 86400,
              "IsPowerNotice": 0,
              "Filter": {
                "Type": "",
                "Dimensions": "[]"
              }
            }
          ]
        },
        "EventCondition": {
          "Rules": []
        },
        "NoticeIds": [
          "notice-esrwma09"
        ],
        "Notices": [
          {
            "Id": "notice-esrwma09",
            "Name": "Notice-Test-2",
            "UpdatedAt": "2020-10-19 20:56:50",
            "UpdatedBy": "1500000685",
            "NoticeType": "OK",
            "UserNotices": [
              {
                "ReceiverType": "GROUP",
                "UserIds": null,
                "GroupIds": [
                  3877
                ],
                "StartTime": 0,
                "EndTime": 1,
                "NoticeWay": [
                  "EMAIL"
                ],
                "PhoneOrder": null,
                "PhoneCircleTimes": 2,
                "PhoneInnerInterval": 60,
                "PhoneCircleInterval": 60,
                "NeedPhoneArriveNotice": 1
              }
            ],
            "URLNotices": [
              {
                "URL": "https://www.abc.com",
                "IsValid": 0
              }
            ],
            "IsPreset": 0
          }
        ],
        "TriggerTasks": [],
        "OriginId": "1314081",
        "ConditionsTemp": {
          "TemplateName": "",
          "Condition": null,
          "EventCondition": null
        },
        "LastEditUin": "1500000685",
        "UpdateTime": 1603114100,
        "InsertTime": 1603114100,
        "Region": [
          "bj",
          "ca",
          "cd",
          "cq",
          "de",
          "fzec",
          "gz",
          "gzopen",
          "hk",
          "hzec",
          "in",
          "jnec",
          "jp",
          "kr",
          "nj",
          "ru",
          "sg",
          "sh",
          "shjr",
          "szjr",
          "szx",
          "th",
          "tpe",
          "tsn",
          "use",
          "usw"
        ],
        "NamespaceShowName": "CVM - basic monitoring",
        "CanSetDefault": 1,
        "InstanceGroupId": 0,
        "InstanceGroupName": "",
        "InstanceSum": 0
      }
    ],
    "RequestId": "p7gicv4fb-4euztbaaczrsj4vz-s28g-",
    "TotalCount": 1
  }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation Operation failed.
InternalError Internal error.
UnsupportedOperation Unsupported operation.

Was this page helpful?

Was this page helpful?

  • Not at all
  • Not very helpful
  • Somewhat helpful
  • Very helpful
  • Extremely helpful
Send Feedback
Help