You need to enable JavaScript to run this app.
导航

GetAidQuotaUsedTrend

最近更新时间2023.12.25 20:24:13

首次发布时间2022.11.25 11:53:32

调用GetAidQuotaUsedTrend接口获取指定应用指定服务下的资源用量趋势。

使用说明

  • 接口名称:GetAidQuotaUsedTrend
  • 请求方式:POST
  • 接口地址:/?Action=GetAidQuotaUsedTrend&Version=2022-10-12

请求参数

Query

参数

类型

是否必选

示例值

描述

Action

String

GetAidQuotaUsedTrend

请求名称。

Version

String

2022-10-12

请求版本。

ServiceName : apmplus_openapi
Region : cn-beijing 
X-App-Ids : xxx
Content-Type : application/json

Body

参数

类型

是否必选

示例值

描述

start_time

i64

1665417600

查询起始时间。

end_time

i64

1666083280

查询终止时间。

granularity

string

week

时间聚合粒度。

  • week
  • day
  • month

aid

i64

12345

应用ID。

service_key

string

webpro_monitor

指定服务,可选值由GetServiceList方法获取。

返回参数

参数

类型

示例值

描述

data

object of data

-

资源用量趋势。

error_msg

string

-

错误信息,成功为空。

error_no

i32

0

错误码,成功为0。

data

参数

类型

示例值

描述

total

object of total

-

总用量趋势。

modules

array of modules

-

具体服务下各模块用量趋势。

total

参数

类型

示例值

描述

name

string

test123

线的名称,在分组的情况下,name应该是分组维度的取值,比如用来显示曲线的图标。

points

array of points

-

曲线上的点。

modules

参数

类型

示例值

描述

name

string

test123

线的名称,在分组的情况下,name应该是分组维度的取值,比如用来显示曲线的图标。

points

array of points

-

曲线上的点。

points

参数

类型

示例值

描述

timestamp

i64

1665417600

unix时间戳。

readable_timestamp

string

2022-10-11

日历时间。

value

double

123

指标值。

alert

object of alert

-

提示信息。

alert

参数

类型

示例值

描述

alert

boolean

true

是否需要提示。

msg

string

-

提示信息。

请求示例

POST https://open.volcengineapi.com/?Action=GetAidQuotaUsedTrend&Version=2022-10-12 
{
    "start_time": 1665417600,
    "end_time": 1666083280,
    "granularity": "week,day,month",
    "aid": 12345,
    "service_key": "webpro_monitor"
}

返回示例

正常返回示例

{
    "data": {
        "modules": [
            {
                "name": "test123",
                "points": [
                    {
                        "timestamp": 1665417600,
                        "readable_timestamp": "2022-10-11",
                        "alert": {
                            "msg": "",
                            "alert": true
                        },
                        "value": 123
                    }
                ]
            }
        ],
        "total": {
            "name": "test123",
            "points": [
                {
                    "readable_timestamp": "2022-10-11",
                    "alert": {
                        "msg": "",
                        "alert": true
                    },
                    "value": 123,
                    "timestamp": 1665417600
                }
            ]
        }
    },
    "error_no": 0,
    "error_msg": ""
}

异常返回示例

{
    "ResponseMetadata": {
        "RequestId": "201806041104200100100232280022D30",
        "Action": "GetAidQuotaUsedTrend",
        "Version": "2022-10-12",
        "Service": "***",
        "Region": "cn-north-1",
        "Error": {
            "Code": "200000",
            "Message": "参数异常"
        }
    }
}