更新时间:2024-03-21 GMT+08:00
分享

查询通知规则

功能介绍

查询对应指标的通知规则;

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

GET /v2/{project_id}/statistics/notify-rules

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目ID。

表2 Query参数

参数

是否必选

参数类型

描述

metric_name

String

指标名称(精确匹配)

rule_id

String

通知规则ID

offset

Integer

查询的偏移量,默认值0

limit

Integer

单次查询的大小[1-100],默认值10

请求参数

表3 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

响应参数

状态码: 200

表4 响应Body参数

参数

参数类型

描述

count

Integer

总数

items

Array of MetricNotifyRule objects

规则列表

表5 MetricNotifyRule

参数

参数类型

描述

rule_id

String

规则ID

metric_name

String

统计指标名称,目前仅支持固定值:desktop_idle_duration

  • desktop_idle_duration - 桌面空闲时长

threshold

Integer

统计持续周期(天)

comparison_operator

String

统计指标对应的统计值和threshold进行比较的条件

  • >= - 统计指标大于等于threshold时触发

  • > - 统计指标大于threshold时触发

  • = - 统计指标等于threshold时触发

  • <= - 统计指标小于等于threshold时触发

  • < - 统计指标小于threshold时触发

interval

Integer

触发通知后;下次通知的间隔时间;默认每天一次

enable

Boolean

启禁用规则 true:启用 false:禁用

notify_object

String

通知对象;smn的主题urn

状态码: 400

表6 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 401

表7 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 500

表8 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

请求示例

响应示例

状态码

状态码

描述

200

响应成功

400

客户端请求有误

401

鉴权失败

500

内部错误

错误码

请参见错误码

分享:

    相关文档

    相关产品