You need to enable JavaScript to run this app.
导航
数据监控
最近更新时间:2024.02.02 17:29:34首次发布时间:2023.03.03 11:26:44

阅读本文,您可以获取 Java SDK 数据监控的接口调用示例,实现快速开发。

调用说明

  • 本文提供的接口调用示例均通过 AK 和 SK 初始化实例。
  • 接口的参数说明和错误码等信息可通过接口文档查看。

前提条件

调用接口前,请先完成 Java SDK 的安装及初始化操作。

调用示例

本节为您介绍数据监控相关接口的功能和调用示例。

查询边缘请求次数

您可以调用 DescribeImageXEdgeRequest 接口获取指定时间段的边缘请求次数。详细的参数说明可参见 DescribeImageXEdgeRequest 接口文档。

接口调用示例如下所示。

package com.volcengine.example.imagex.v2.api;


import com.volcengine.model.imagex.v2.*; 
import com.volcengine.service.imagex.v2.ImagexService;

public class DescribeImageXEdgeRequestExample {
    public static void main(String[] args) {
        ImagexService service = ImagexService.getInstance();
        service.setAccessKey("ak");
        service.setSecretKey("sk");

        DescribeImageXEdgeRequestQuery query = new DescribeImageXEdgeRequestQuery();

        try {
            DescribeImageXEdgeRequestRes resp = service.describeImageXEdgeRequest(query);
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

查询边缘分发带宽用量

您可以调用 DescribeImageXEdgeRequestBandwidth 接口获取指定时间段的边缘分发带宽用量。详细的参数说明可参见 DescribeImageXEdgeRequestBandwidth 接口文档。

接口调用示例如下所示。

package com.volcengine.example.imagex.v2.api;


import com.volcengine.model.imagex.v2.*; 
import com.volcengine.service.imagex.v2.ImagexService;

public class DescribeImageXEdgeRequestBandwidthExample {
    public static void main(String[] args) {
        ImagexService service = ImagexService.getInstance();
        service.setAccessKey("ak");
        service.setSecretKey("sk");

        DescribeImageXEdgeRequestBandwidthQuery query = new DescribeImageXEdgeRequestBandwidthQuery();

        try {
            DescribeImageXEdgeRequestBandwidthRes resp = service.describeImageXEdgeRequestBandwidth(query);
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

查询边缘分发流量用量

您可以调用 DescribeImageXEdgeRequestTraffic 接口获取指定时间段的边缘分发流量用量。详细的参数说明可参见 DescribeImageXEdgeRequestTraffic 接口文档。

接口调用示例如下所示。

package com.volcengine.example.imagex.v2.api;


import com.volcengine.model.imagex.v2.*; 
import com.volcengine.service.imagex.v2.ImagexService;

public class DescribeImageXEdgeRequestTrafficExample {
    public static void main(String[] args) {
        ImagexService service = ImagexService.getInstance();
        service.setAccessKey("ak");
        service.setSecretKey("sk");

        DescribeImageXEdgeRequestTrafficQuery query = new DescribeImageXEdgeRequestTrafficQuery();

        try {
            DescribeImageXEdgeRequestTrafficRes resp = service.describeImageXEdgeRequestTraffic(query);
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

查询镜像回源带宽

您可以调用 DescribeImageXMirrorRequestBandwidth 接口获取指定时间段的镜像回源带宽。详细的参数说明可参见 DescribeImageXMirrorRequestBandwidth 接口文档。

接口调用示例如下所示。

package com.volcengine.example.imagex.v2.api;


import com.volcengine.model.imagex.v2.*; 
import com.volcengine.service.imagex.v2.ImagexService;

public class DescribeImageXMirrorRequestBandwidthExample {
    public static void main(String[] args) {
        ImagexService service = ImagexService.getInstance();
        service.setAccessKey("ak");
        service.setSecretKey("sk");

        DescribeImageXMirrorRequestBandwidthBody body = new DescribeImageXMirrorRequestBandwidthBody();

        try {
            DescribeImageXMirrorRequestBandwidthRes resp = service.describeImageXMirrorRequestBandwidth(body);
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

查询镜像回源流量

您可以调用 DescribeImageXMirrorRequestTraffic 接口获取指定时间段的镜像回源流量。详细的参数说明可参见 DescribeImageXMirrorRequestTraffic 接口文档。

接口调用示例如下所示。

package com.volcengine.example.imagex.v2.api;


import com.volcengine.model.imagex.v2.*; 
import com.volcengine.service.imagex.v2.ImagexService;

public class DescribeImageXMirrorRequestTrafficExample {
    public static void main(String[] args) {
        ImagexService service = ImagexService.getInstance();
        service.setAccessKey("ak");
        service.setSecretKey("sk");

        DescribeImageXMirrorRequestTrafficBody body = new DescribeImageXMirrorRequestTrafficBody();

        try {
            DescribeImageXMirrorRequestTrafficRes resp = service.describeImageXMirrorRequestTraffic(body);
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

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

您可以调用 DescribeImageXMirrorRequestHttpCodeByTime 接口获取指定时间段的镜像回源请求次时序数据。详细的参数说明可参见 DescribeImageXMirrorRequestHttpCodeByTime 接口文档。

接口调用示例如下所示。

package com.volcengine.example.imagex.v2.api;


import com.volcengine.model.imagex.v2.*; 
import com.volcengine.service.imagex.v2.ImagexService;

public class DescribeImageXMirrorRequestHttpCodeByTimeExample {
    public static void main(String[] args) {
        ImagexService service = ImagexService.getInstance();
        service.setAccessKey("ak");
        service.setSecretKey("sk");

        DescribeImageXMirrorRequestHttpCodeByTimeBody body = new DescribeImageXMirrorRequestHttpCodeByTimeBody();

        try {
            DescribeImageXMirrorRequestHttpCodeByTimeRes resp = service.describeImageXMirrorRequestHttpCodeByTime(body);
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

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

您可以调用 DescribeImageXMirrorRequestHttpCodeOverview 接口获取指定时间段的镜像回源请求次域名明细数据。详细的参数说明可参见 DescribeImageXMirrorRequestHttpCodeOverview 接口文档。

接口调用示例如下所示。

package com.volcengine.example.imagex.v2.api;


import com.volcengine.model.imagex.v2.*; 
import com.volcengine.service.imagex.v2.ImagexService;

public class DescribeImageXMirrorRequestHttpCodeOverviewExample {
    public static void main(String[] args) {
        ImagexService service = ImagexService.getInstance();
        service.setAccessKey("ak");
        service.setSecretKey("sk");

        DescribeImageXMirrorRequestHttpCodeOverviewBody body = new DescribeImageXMirrorRequestHttpCodeOverviewBody();

        try {
            DescribeImageXMirrorRequestHttpCodeOverviewRes resp = service.describeImageXMirrorRequestHttpCodeOverview(body);
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

查询边缘分发地区列表

您可以调用 DescribeImageXEdgeRequestRegions 接口获取指定时间段的边缘分发数据的地区列表。详细的参数说明可参见 DescribeImageXEdgeRequestRegions 接口文档。

接口调用示例如下所示。

package com.volcengine.example.imagex.v2.api;


import com.volcengine.model.imagex.v2.*; 
import com.volcengine.service.imagex.v2.ImagexService;

public class DescribeImageXEdgeRequestRegionsExample {
    public static void main(String[] args) {
        ImagexService service = ImagexService.getInstance();
        service.setAccessKey("ak");
        service.setSecretKey("sk");

        DescribeImageXEdgeRequestRegionsQuery query = new DescribeImageXEdgeRequestRegionsQuery();

        try {
            DescribeImageXEdgeRequestRegionsRes resp = service.describeImageXEdgeRequestRegions(query);
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

查询数据处理服务 QPS 用量

您可以调用 DescribeImageXServerQPSUsage 接口获取指定时间段的数据处理服务 QPS 用量。详细的参数说明可参见 DescribeImageXServerQPSUsage 接口文档。

接口调用示例如下所示。

package com.volcengine.example.imagex.v2.api;


import com.volcengine.model.imagex.v2.*; 
import com.volcengine.service.imagex.v2.ImagexService;

public class DescribeImageXServerQPSUsageExample {
    public static void main(String[] args) {
        ImagexService service = ImagexService.getInstance();
        service.setAccessKey("ak");
        service.setSecretKey("sk");

        DescribeImageXServerQPSUsageQuery query = new DescribeImageXServerQPSUsageQuery();

        try {
            DescribeImageXServerQPSUsageRes resp = service.describeImageXServerQPSUsage(query);
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}