对象存储

  • 对象存储 > API 文档 > 数据统计接口 > blob_io

    blob_io

    最近更新时间: 2023-12-25 11:38:12

    描述

    该接口可以获取外网流出流量、CDN回源流量统计和 GET 请求次数。可查询当天计量,统计延迟大概 5 分钟。


    请求


    语法

    GET /v6/blob_io?begin=<BeginTime>&end=<EndTime>&g=day&select=flow HTTP/1.1
    Host: api.qiniuapi.com
    Content-Type: application/x-www-form-urlencoded
    X-Qiniu-Date: 20060102T150405Z
    Authorization:  Qiniu <AccessToken>
    

    请求参数

    参数名称 必填 说明
    begin 起始时间字符串,格式为 20060102150405,闭区间
    end 结束时间字符串,格式为 20060102150405,开区间
    g 时间聚合粒度(5min hour day month)
    select 值字段
  • flow 流量 (Byte)
  • hits GET 请求次数
  • $bucket 空间名称
    $domain 空间访问域名
    $ftype 存储类型
  • 0 标准存储
  • 1 低频存储
  • 2 归档存储
  • 3 深度归档存储
  • 4 归档直读存储
  • $region 存储区域 ID, 七牛对象存储支持的 存储区域列表
    $metric
  • flow_out 用户直接到源站的请求
  • cdn_flow_out CDN 回源请求
  • hits GET 请求
    • 查询外网流出流量:select=flow&$metric=flow_out
    • 查询 CDN 回源流量:select=flow&$metric=cdn_flow_out
    • 查询 GET 请求次数:select=hits&$metric=hits

    请求头

    该请求操作的实现使用了所有操作的公共请求头。有关详细信息,请查阅公共请求头


    响应


    响应头

    该请求操作的实现使用了所有操作的公共响应头。有关详细信息,请查阅公共响应头


    响应元素

    名称 说明
    time 统计时间

    类型:字符串
    hits GET 请求次数

    类型:数字
    flow 流量,单位 Byte

    类型:数字

    特殊错误

    该操作的实现不会返回特殊错误。有关错误和错误代码列表的一般信息,请查阅错误响应


    示例


    外网流出流量统计示例

    请求:
    GET /v6/blob_io?begin=20170818120000&end=20170818180000&g=day&select=flow&$metric=flow_out HTTP/1.1
    Host: api.qiniuapi.com
    User-Agent: Go-http-client/1.1
    Content-Type: application/x-www-form-urlencoded
    X-Qiniu-Date: 20170818T094233Z
    Authorization: Qiniu j853F3bLkWl59I5BOkWm6q1Z1mZClpr9Z9CLfDE0:DOvuE4XbmHZYHSg_ZwUB6M5cqaU=
    Accept-Encoding: gzip
    
    响应:
    HTTP/1.1 200 OK
    Content-Length: 62
    Connection: keep-alive
    Content-Type: application/json
    Date: Fri, 18 Aug 2017 09:42:33 GMT
    Server: nginx
    X-Log: KODOBILL:210;APIS:211
    X-Reqid: YCIAAGgyN1ts59sU
    
    [
      {
        "time": "2017-08-18T00:00:00+08:00", 
        "values": {
          "flow": 43482
        }
      }
    ]
    

    GET 请求次数统计示例

    请求:
    GET /v6/blob_io?begin=20170818120000&end=20170818180000&g=day&select=hits HTTP/1.1
    Host: api.qiniuapi.com
    User-Agent: Go-http-client/1.1
    Content-Type:application/x-www-form-urlencoded
    X-Qiniu-Date: 20170818T094233Z
    Authorization: Qiniu j853F3bLkWl59I5BOkWm6q1Z1mZClpr9Z9CLfDE0:uQE-nhBv5IZSeOG2bbHX94bA1LM=
    Accept-Encoding: gzip
    
    响应:
    HTTP/1.1 200 OK
    Content-Length: 58
    Connection: keep-alive
    Content-Type: application/json
    Date: Fri, 18 Aug 2017 09:43:23 GMT
    Server: nginx
    X-Log: KODOBILL:198;APIS:203
    X-Reqid: BksAAH_izh1459sU
    
    [
      {
        "time": "2017-08-18T00:00:00+08:00", 
        "values": {
          "hits": 2
        }
      }
    ]
    
    以上内容是否对您有帮助?
  • Qvm free helper
    Close