云服务器内容精选

  • 响应示例 状态码: 200 OK { "datapoints" : [ { "average" : 5, "timestamp" : 1665304920000, "unit" : "Byte" } ] } 状态码: 400 Bad Request { "error_code" : "APIG.2012", "error_msg" : "Invalid parameter value,parameterName:api_id. Please refer to the support documentation" } 状态码: 401 Unauthorized { "error_code" : "APIG.1002", "error_msg" : "Incorrect token or token resolution failed" } 状态码: 403 Forbidden { "error_code" : "APIG.1005", "error_msg" : "No permissions to request this method" } 状态码: 404 Not Found { "error_code" : "APIG.3002", "error_msg" : "API 39bce6d25a3f470e8cf7b2c97174f7d9 does not exist" } 状态码: 500 Internal Server Error { "error_code" : "APIG.9999", "error_msg" : "System error" }
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 datapoints Array of MetricData objects 指标数据列表 表5 MetricData 参数 参数类型 描述 average Integer 聚合周期内指标数据的平均值,仅当请求参数filter字段值为average时支持。 max Integer 聚合周期内指标数据的最大值,仅当请求参数filter字段值为max时支持。 min Integer 聚合周期内指标数据的最小值,仅当请求参数filter字段值为min时支持。 sum Integer 聚合周期内指标数据的求和值,仅当请求参数filter字段值为sum时支持。 variance Integer 聚合周期内指标数据的方差,仅当请求参数filter字段值为variance时支持。 timestamp Long 指标采集时间,UNIX时间戳,单位毫秒。 unit String 指标单位。 状态码: 400 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 401 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 403 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 404 表9 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 500 表10 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述
  • URI GET /v2/{project_id}/apigw/instances/{instance_id}/metric-data 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID,获取方式请参见获取项目ID。 instance_id 是 String 实例ID,在API网关控制台的“实例信息”中获取。 表2 Query参数 参数 是否必选 参数类型 描述 dim 是 String 指标维度 inbound_eip:入口公网带宽,仅ELB类型实例支持 outbound_eip:出口公网带宽 枚举值: inbound_eip outbound_eip metric_name 是 String 指标名称 upstream_bandwidth:出网带宽 downstream_bandwidth:入网带宽 upstream_bandwidth_usage:出网带宽使用率 downstream_bandwidth_usage:入网带宽使用率 up_stream:出网流量 down_stream:入网流量 枚举值: upstream_bandwidth downstream_bandwidth upstream_bandwidth_usage downstream_bandwidth_usage up_stream down_stream from 是 String 查询数据起始时间,UNIX时间戳,单位毫秒。 to 是 String 查询数据截止时间UNIX时间戳,单位毫秒。from必须小于to。 period 是 Integer 监控数据粒度。 1:实时数据 300:5分钟粒度 1200:20分钟粒度 3600:1小时粒度 14400:4小时粒度 86400:1天粒度 枚举值: 1 300 1200 3600 14400 86400 filter 是 String 数据聚合方式。 average:聚合周期内指标数据的平均值。 max:聚合周期内指标数据的最大值。 min:聚合周期内指标数据的最小值。 sum:聚合周期内指标数据的求和值。 variance:聚合周期内指标数据的方差。 枚举值: average max min sum variance
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 code String 响应码 msg String 返回消息 start_time Long 开始时间的UTC的时间戳 end_time Long 截止时间的UTC的时间戳 list Array of StatisticsGroup objects 统计指标的数据结构结构体 表5 StatisticsGroup 参数 参数类型 描述 max_latency Integer 最大延时 单位:ms avg_latency Float 平均延时 单位:ms req_count Integer 请求总次数 req_count2xx Integer 2xx响应码总次数 req_count4xx Integer 4xx响应码总次数 req_count5xx Integer 5xx响应码总次数 req_count_error Integer 错误次数 output_throughput Long 下行吞吐量(byte) input_throughput Long 上行吞吐量(byte) current_minute Long API访问的UTC时间戳 group_id String API分组编号 provider String API拥有者 req_time String API请求时间 register_time String 记录时间 状态码: 400 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 401 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 403 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 404 表9 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 500 表10 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述
  • 响应示例 状态码: 200 OK { "code" : "APIG.0000", "start_time" : 1595574540, "end_time" : 1595578080, "list" : [ { "avg_latency" : 4.14, "current_minute" : 1595576640, "group_id" : "d0fc4e40b7d1492cba802f667c7c7226", "input_throughput" : 1071, "max_latency" : 14, "output_throughput" : 3790, "provider" : "73d69ae0cfcf460190522d06b60f05ad", "register_time" : "2020-07-24 15:44:56", "req_count" : 7, "req_count2xx" : 0, "req_count4xx" : 6, "req_count5xx" : 1, "req_count_error" : 7, "req_time" : "2020-07-24 15:44:00" }, { "avg_latency" : 3.67, "current_minute" : 1595577900, "group_id" : "d0fc4e40b7d1492cba802f667c7c7226", "input_throughput" : 915, "max_latency" : 6, "output_throughput" : 2763, "provider" : "73d69ae0cfcf460190522d06b60f05ad", "register_time" : "2020-07-24 16:05:12", "req_count" : 6, "req_count2xx" : 3, "req_count4xx" : 0, "req_count5xx" : 3, "req_count_error" : 3, "req_time" : "2020-07-24 16:05:00" } ] } 状态码: 400 Bad Request { "error_code" : "APIG.2012", "error_msg" : "Invalid parameter value,parameterName:group_id. Please refer to the support documentation" } 状态码: 401 Unauthorized { "error_code" : "APIG.1002", "error_msg" : "Incorrect token or token resolution failed" } 状态码: 403 Forbidden { "error_code" : "APIG.1005", "error_msg" : "No permissions to request this method" } 状态码: 404 Not Found { "error_code" : "APIG.3001", "error_msg" : "API group d0fc4e40b7d1492cba802f667c7c7226 does not exist" } 状态码: 500 Internal Server Error { "error_code" : "APIG.9999", "error_msg" : "System error" }
  • URI GET /v2/{project_id}/apigw/instances/{instance_id}/statistics/group/latest 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID,获取方式请参见获取项目ID。 instance_id 是 String 实例ID,在API网关控制台的“实例信息”中获取。 表2 Query参数 参数 是否必选 参数类型 描述 group_id 是 String API分组的编号