文档中心 > openRangeV2
openRangeV2

最近更新时间:2022-12-09

请求方法:POST

接口描述:时间范围段查询监控数据值。

请求参数

参数

数据类型

参数类型

是否必填

说明

Authorization

String

Header

Y

签名信息

Content-Type

String

Header

Y

application/json; charset=utf-8

X-UNI-Timestamp

String

Header

Y

工具类生成的时间戳

Host

String

Header

Y

紫光云openapi host地址

x-uni-version

String

Header

Y

工具类中获取

Action

Schema

Query

Y

openRangeV2

start

Long

Query

Y

开始时间(秒)

end

Long

Query

Y

截止时间(秒)

instanceIds

Array

Query

Y

实例ID集合

regionId

String

Query

Y

节点ID

categoriesAndUnits

Object

Query

Y

单位及指标项目

categoriesAndUnits

category

String

Query

Y

监控项

unit

String

Query

N

查询单位,b、k、M、G

tags

Map

Query

Y

需要查询的维度及实例或者节点

例:{"nodeId":"rabbitmq-t1od4hse96qg_DISK_1"}   若一次查询多个id,则需要使用 |   进行分割 如:{"nodeId":"rabbitmq-t1od4hse96qg_DISK_1|rabbitmq-t1od4hse96qg_DISK_2"}

多维度:   {"nodeId":"rabbitmq-t1od4hse96qg_DISK_1","instance":"rabbitmq-t1od4hse96qg"}

aggregationType

Integer

Query

N

原始值 0 平均值 1 最大值 2 最小值 3 和值 4

step

Long

Query

N

5分钟 300

15分钟 900

2小时 7200

4小时 14400

24小时 86400

默认5分钟和2小时(按照开始结束时间,小于等于48小时默认5分钟,大于48小时默认2小时)

返回参数

名称

类型

描述

code

String

接口调用返回码

msg

String

接口调用信息

res

Object

返回数据

data

Object


result

Array

结果集

metric

Object


values

Array

value[i][0]时间戳,value[i][1]指标值,二维数组

resultType

String

指标类型

错误码

公共错误参见“公共错误码集合”。

示例

请求示例

http://10.0.45.193:30990/openMonitor?Action=openRangeV2

 请求头

{"regionId":"cn-tianjin-yfb","instanceIds":[],"start":1662619611021,"categoriesAndUnits":[{"unit":"","category":"mqs_rabbitmq_node_cpu_usage"}],"ishdm":false,"end":1662623211021,"tags":{"nodeId":"rabbitmq-t1od4hse96qg_DISK_1"},"aggregationType":1, "step":300}

 请求体

{"regionId":"cn-tianjin-yfb","instanceIds":[],"start":1662619611021,"categoriesAndUnits":[{"unit":"","category":"mqs_rabbitmq_node_cpu_usage"}],"ishdm":false,"end":1662623211021,"isFineGrit":false,"tags":{"nodeId":"rabbitmq-t1od4hse96qg_DISK_1"}}

返回示例

JSON格式

{

    "status": true,

    "code": "0",

    "res": [

        {

            "data": {

                "resultType": "matrix",

                "result": [

                    {

                        "values": [

                            [

                                1.662619611E9,

                                7.79

                            ],

                            [

                                1.662619671E9,

                                4.53

                            ],

                            [

                                1.662619731E9,

                                4.95

                            ],

                            [

                                1.662619791E9,

                                4.95

                            ]

                        "metric": {

                            "nodeId": "rabbitmq-t1od4hse96qg_DISK_1",

                            "category": "mqs_rabbitmq_node_cpu_usage",

                            "categoryName": "CPU使用率",

                            "showUnit": "%",

                            "defaultUnit": "",

    "name": ""

 

                        }

                    }

                ]

            },

            "status": "success"

        }

    ],

    "msg": null,

    "auth": true

}