DescribeAlarmPolicies

Last updated: 2021-02-08 11:17:58

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
Dimensions No String Alarm object list
ReceiverUids.N No Array of Integer Search by recipient
ReceiverGroups.N No Array of Integer Search by recipient group
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
Order No String Sort order. Valid values: ASC (ascending), DESC (descending)
ProjectIds.N No Array of Integer Project ID array
NoticeIds.N No Array of String Alarm notification ID list
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 Status. Valid values: 1 (enabled), 0 (disabled)
NotBindingNoticeRule No Integer Indicates whether the notification rule is configured. 1: not configured; 0: configured

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 alarm policy list

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,
        "IsDefault": 0,
        "ProjectId": 0,
        "ProjectName": "",
        "Namespace": "cvm_device",
        "PolicyExpression": "",
        "ConditionTemplateId": "",
        "Condition": {
          "IsUnionRule": 0,
          "Rules": [
            {
              "MetricName": "CpuUsage",
              "Description": "CPU utilization",
              "Period": 60,
              "Operator": "gt",
              "Value": "0",
              "ContinuePeriod": 1,
              "NoticeFrequency": 86400,
              "IsPowerNotice": 0,
              "Filter": {
                "Type": "",
                "Expression": "",
                "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": {
          "ConditionId": 0,
          "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": 2
  }
}

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