You need to enable JavaScript to run this app.
最新活动
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们
导航

数据监控

最近更新时间2023.03.31 14:08:54

首次发布时间2023.03.03 11:29:08

阅读本文,您可以快速了解数据监控 Python SDK 的使用方法。

说明

以下 SDK 示例中仅展示了部分参数,您可以在 veImageX 的接口文档中查看该接口支持的全部参数及取值。

初始化

调用接口前请先完成初始化,具体操作请参考初始化

查询边缘请求次数

查询当前账号下对应域名的边缘请求次数。

具体接口参数和返回字段请参考 DescribeImageXEdgeRequest。我们同时在 GitHub 上提供了参考示例

具体示例如下所示:

from __future__ import print_function
from volcengine.imagex.ImageXService import ImageXService

if __name__ == '__main__':
    imagex_service = ImageXService()

    # call below method if you dont set ak and sk in $HOME/.volc/config
    imagex_service.set_ak('ak')
    imagex_service.set_sk('sk')

    query = dict()
    query['DataTypes'] = "2xx,3xx,4xx,5xx"
    query['GroupBy'] = "DomainName,DataType"
    query['StartTime'] = "2023-01-21T00:00:00+08:00"
    query['EndTime'] = "2023-01-28T00:00:00+08:00"
    query['Interval'] = "300"

    resp = imagex_service.describe_imagex_edge_request(query)
    print(resp)

查询镜像回源带宽

本接口支持查询当前账号下镜像回源带宽用量数据。

具体接口参数和返回字段请参考 DescribeImageXMirrorRequestBandwidth。我们同时在 GitHub 上提供了参考示例

具体示例如下所示:

from __future__ import print_function
from volcengine.imagex.ImageXService import ImageXService

if __name__ == '__main__':
    imagex_service = ImageXService()

    # call below method if you dont set ak and sk in $HOME/.volc/config
    imagex_service.set_ak('ak')
    imagex_service.set_sk('sk')

    query = dict()
    query['StartTime'] = "2023-01-21T00:00:00+08:00"
    query['EndTime'] = "2023-01-28T00:00:00+08:00"
    query['Interval'] = "5m"

    resp = imagex_service.describe_imagex_mirror_request_bandwidth(query)
    print(resp)

查询镜像回源流量

本接口支持查询当前账号下镜像回源流量用量数据。

具体接口参数和返回字段请参考 DescribeImageXMirrorRequestTraffic。我们同时在 GitHub 上提供了参考示例

具体示例如下所示:

from __future__ import print_function
from volcengine.imagex.ImageXService import ImageXService

if __name__ == '__main__':
    imagex_service = ImageXService()

    # call below method if you dont set ak and sk in $HOME/.volc/config
    imagex_service.set_ak('ak')
    imagex_service.set_sk('sk')

    query = dict()
    query['StartTime'] = "2023-01-21T00:00:00+08:00"
    query['EndTime'] = "2023-01-28T00:00:00+08:00"
    query['Interval'] = "5m"

    resp = imagex_service.describe_imagex_mirror_request_traffic(query)
    print(resp)

查询镜像回源请求次时序数据

本接口支持查询当前账号下的镜像回源请求次时序数据。

具体接口参数和返回字段请参考 DescribeImageXMirrorRequestHttpCodeByTime。我们同时在 GitHub 上提供了参考示例

具体示例如下所示:

from __future__ import print_function
from volcengine.imagex.ImageXService import ImageXService

if __name__ == '__main__':
    imagex_service = ImageXService()

    # call below method if you dont set ak and sk in $HOME/.volc/config
    imagex_service.set_ak('ak')
    imagex_service.set_sk('sk')

    query = dict()
    query['StartTime'] = "2023-01-21T00:00:00+08:00"
    query['EndTime'] = "2023-01-28T00:00:00+08:00"
    query['Interval'] = "5m"

    resp = imagex_service.describe_imagex_mirror_request_http_code_by_time(query)
    print(resp)

查询镜像回源请求次域名明细数据

本接口支持查询当前账号下镜像回源请求次的域名明细数据用量数据。

具体接口参数和返回字段请参考 DescribeImageXMirrorRequestHttpCodeOverview。我们同时在 GitHub 上提供了参考示例

具体示例如下所示:

from __future__ import print_function
from volcengine.imagex.ImageXService import ImageXService

if __name__ == '__main__':
    imagex_service = ImageXService()

    # call below method if you dont set ak and sk in $HOME/.volc/config
    imagex_service.set_ak('ak')
    imagex_service.set_sk('sk')

    query = dict()
    query['StartTime'] = "2023-01-21T00:00:00+08:00"
    query['EndTime'] = "2023-01-28T00:00:00+08:00"
    query['Interval'] = "5m"

    resp = imagex_service.describe_imagex_mirror_request_http_code_overview(query)
    print(resp)

查询边缘分发带宽用量

本接口支持查询账号下对应域名的边缘分发带宽用量。

具体接口参数和返回字段请参考 DescribeImageXEdgeRequestBandwidth。我们同时在 GitHub 上提供了参考示例

具体示例如下所示:

from __future__ import print_function
from volcengine.imagex.ImageXService import ImageXService

if __name__ == '__main__':
    imagex_service = ImageXService()

    # call below method if you dont set ak and sk in $HOME/.volc/config
    imagex_service.set_ak('ak')
    imagex_service.set_sk('sk')

    query = dict()
    query['StartTime'] = "2023-01-21T00:00:00+08:00"
    query['EndTime'] = "2023-01-28T00:00:00+08:00"
    query['Interval'] = "300"

    resp = imagex_service.describe_imagex_edge_request_bandwidth(query)
    print(resp)

查询边缘分发流量用量

本接口支持查询账号下对应域名的边缘分发流量用量。

具体接口参数和返回字段请参考 DescribeImageXEdgeRequestTraffic。我们同时在 GitHub 上提供了参考示例

具体示例如下所示:

from __future__ import print_function
from volcengine.imagex.ImageXService import ImageXService

if __name__ == '__main__':
    imagex_service = ImageXService()

    # call below method if you dont set ak and sk in $HOME/.volc/config
    imagex_service.set_ak('ak')
    imagex_service.set_sk('sk')

    query = dict()
    query['StartTime'] = "2023-01-21T00:00:00+08:00"
    query['EndTime'] = "2023-01-28T00:00:00+08:00"
    query['Interval'] = "300"

    resp = imagex_service.describe_imagex_edge_request_traffic(query)
    print(resp)

获取边缘分发地区列表

本接口支持查询账号下边缘分发数据的地区列表。

具体接口参数和返回字段请参考 DescribeImageXEdgeRequestRegions。我们同时在 GitHub 上提供了参考示例

具体示例如下所示:

from __future__ import print_function
from volcengine.imagex.ImageXService import ImageXService

if __name__ == '__main__':
    imagex_service = ImageXService()

    # call below method if you dont set ak and sk in $HOME/.volc/config
    imagex_service.set_ak('ak')
    imagex_service.set_sk('sk')

    query = dict()
    query['StartTime'] = "2023-01-21T00:00:00+08:00"
    query['EndTime'] = "2023-01-28T00:00:00+08:00"

    resp = imagex_service.describe_imagex_edge_request_regions(query)
    print(resp)