You need to enable JavaScript to run this app.
导航
数据统计
最近更新时间:2024.11.18 14:09:43首次发布时间:2022.04.28 18:02:35

本文为您提供了服务端 Java SDK 的数据统计模块的接口调用示例。

前提条件

调用接口前,请先完成 SDK 的安装初始化

调用示例

查询带宽用量

接口请求参数和返回参数说明详见查询带宽用量

package com.volcengine.example.vod.measure;

import com.volcengine.service.vod.IVodService;
import com.volcengine.service.vod.impl.VodServiceImpl;
public class VodDescribeVodDomainBandwidthDataDemo {

    public static void main(String[] args) throws Exception {
        // Create a VOD instance in the specified region.
        // IVodService vodService = VodServiceImpl.getInstance("cn-north-1");
        IVodService vodService = VodServiceImpl.getInstance();

        // Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65641.
        // The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed.
        // During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account.
        // vodService.setAccessKey("your ak");
        // vodService.setSecretKey("your sk");

        try {
            com.volcengine.service.vod.model.request.VodDescribeVodDomainBandwidthDataRequest.Builder reqBuilder = com.volcengine.service.vod.model.request.VodDescribeVodDomainBandwidthDataRequest.newBuilder();
                        reqBuilder.setDomainList("your DomainList");
                        reqBuilder.setDomainInSpaceList("your DomainInSpaceList");
                        reqBuilder.setStartTime("your StartTime");
                        reqBuilder.setEndTime("your EndTime");
                        reqBuilder.setAggregation(0);
                        reqBuilder.setBandwidthType("your BandwidthType");
                        reqBuilder.setArea("your Area");
                        reqBuilder.setRegionList("your RegionList"); //
                        
            com.volcengine.service.vod.model.response.VodDescribeVodDomainBandwidthDataResponse resp = vodService.describeVodDomainBandwidthData(reqBuilder.build());
            if (resp.getResponseMetadata().hasError()) {
                System.out.println(resp.getResponseMetadata().getError());
                System.exit(-1);
            }
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

查询流量用量

接口请求参数和返回参数说明详见查询流量用量

package com.volcengine.example.vod.measure;

import com.volcengine.service.vod.IVodService;
import com.volcengine.service.vod.impl.VodServiceImpl;
public class VodDescribeVodDomainTrafficDataDemo {

    public static void main(String[] args) throws Exception {
        // Create a VOD instance in the specified region.
        // IVodService vodService = VodServiceImpl.getInstance("cn-north-1");
        IVodService vodService = VodServiceImpl.getInstance();

        // Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65641.
        // The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed.
        // During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account.
        // vodService.setAccessKey("your ak");
        // vodService.setSecretKey("your sk");

        try {
            com.volcengine.service.vod.model.request.VodDescribeVodDomainTrafficDataRequest.Builder reqBuilder = com.volcengine.service.vod.model.request.VodDescribeVodDomainTrafficDataRequest.newBuilder();
                        reqBuilder.setDomainList("your DomainList");
                        reqBuilder.setDomainInSpaceList("your DomainInSpaceList");
                        reqBuilder.setStartTime("your StartTime");
                        reqBuilder.setEndTime("your EndTime");
                        reqBuilder.setAggregation(0);
                        reqBuilder.setTrafficType("your TrafficType");
                        reqBuilder.setArea("your Area");
                        reqBuilder.setRegionList("your RegionList");
                        
            com.volcengine.service.vod.model.response.VodDescribeVodDomainTrafficDataResponse resp = vodService.describeVodDomainTrafficData(reqBuilder.build());
            if (resp.getResponseMetadata().hasError()) {
                System.out.println(resp.getResponseMetadata().getError());
                System.exit(-1);
            }
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

查询存储用量

接口请求参数和返回参数说明详见查询存储用量

package com.volcengine.example.vod.measure;

import com.volcengine.service.vod.IVodService;
import com.volcengine.service.vod.impl.VodServiceImpl;
public class VodDescribeVodSpaceStorageDataDemo {

    public static void main(String[] args) throws Exception {
        // Create a VOD instance in the specified region.
        // IVodService vodService = VodServiceImpl.getInstance("cn-north-1");
        IVodService vodService = VodServiceImpl.getInstance();

        // Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65641.
        // The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed.
        // During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account.
        // vodService.setAccessKey("your ak");
        // vodService.setSecretKey("your sk");

        try {
            com.volcengine.service.vod.model.request.VodDescribeVodSpaceStorageDataRequest.Builder reqBuilder = com.volcengine.service.vod.model.request.VodDescribeVodSpaceStorageDataRequest.newBuilder();
                        reqBuilder.setSpaceList("your SpaceList");
                        reqBuilder.setStartTime("your StartTime");
                        reqBuilder.setEndTime("your EndTime");
                        reqBuilder.setAggregation(0);
                        reqBuilder.setType("your Type");
                        reqBuilder.setRegionList("your RegionList");
                        
            com.volcengine.service.vod.model.response.VodDescribeVodSpaceStorageDataResponse resp = vodService.describeVodSpaceStorageData(reqBuilder.build());
            if (resp.getResponseMetadata().hasError()) {
                System.out.println(resp.getResponseMetadata().getError());
                System.exit(-1);
            }
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

查询转码用量

接口请求参数和返回参数说明详见查询转码用量

package com.volcengine.example.vod.measure;

import com.volcengine.service.vod.IVodService;
import com.volcengine.service.vod.impl.VodServiceImpl;
public class VodDescribeVodSpaceTranscodeDataDemo {

    public static void main(String[] args) throws Exception {
        // Create a VOD instance in the specified region.
        // IVodService vodService = VodServiceImpl.getInstance("cn-north-1");
        IVodService vodService = VodServiceImpl.getInstance();

        // Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65641.
        // The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed.
        // During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account.
        // vodService.setAccessKey("your ak");
        // vodService.setSecretKey("your sk");

        try {
            com.volcengine.service.vod.model.request.DescribeVodSpaceTranscodeDataRequest.Builder reqBuilder = com.volcengine.service.vod.model.request.DescribeVodSpaceTranscodeDataRequest.newBuilder();
                        reqBuilder.setSpaceList("your SpaceList");
                        reqBuilder.setStartTime("your StartTime");
                        reqBuilder.setEndTime("your EndTime");
                        reqBuilder.setTranscodeType("your TranscodeType");
                        reqBuilder.setSpecification("your Specification");
                        reqBuilder.setTaskStageList("your TaskStageList");
                        reqBuilder.setAggregation(0);
                        reqBuilder.setDetailFieldList("your DetailFieldList");
                        reqBuilder.setRegionList("your RegionList");
                        
            com.volcengine.service.vod.model.response.DescribeVodSpaceTranscodeDataResponse resp = vodService.describeVodSpaceTranscodeData(reqBuilder.build());
            if (resp.getResponseMetadata().hasError()) {
                System.out.println(resp.getResponseMetadata().getError());
                System.exit(-1);
            }
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

查询截图用量

接口请求参数和返回参数说明详见查询截图用量

package com.volcengine.example.vod.measure;

import com.volcengine.service.vod.IVodService;
import com.volcengine.service.vod.impl.VodServiceImpl;
public class VodDescribeVodSnapshotDataDemo {

    public static void main(String[] args) throws Exception {
        // Create a VOD instance in the specified region.
        // IVodService vodService = VodServiceImpl.getInstance("cn-north-1");
        IVodService vodService = VodServiceImpl.getInstance();

        // Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65641.
        // The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed.
        // During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account.
        // vodService.setAccessKey("your ak");
        // vodService.setSecretKey("your sk");

        try {
            com.volcengine.service.vod.model.request.DescribeVodSnapshotDataRequest.Builder reqBuilder = com.volcengine.service.vod.model.request.DescribeVodSnapshotDataRequest.newBuilder();
                        reqBuilder.setSpaceList("your SpaceList");
                        reqBuilder.setStartTime("your StartTime");
                        reqBuilder.setEndTime("your EndTime");
                        reqBuilder.setSnapshotType("your SnapshotType");
                        reqBuilder.setTaskStageList("your TaskStageList");
                        reqBuilder.setAggregation(0);
                        reqBuilder.setDetailFieldList("your DetailFieldList");
                        reqBuilder.setRegionList("your RegionList");
                        
            com.volcengine.service.vod.model.response.DescribeVodSnapshotDataResponse resp = vodService.describeVodSnapshotData(reqBuilder.build());
            if (resp.getResponseMetadata().hasError()) {
                System.out.println(resp.getResponseMetadata().getError());
                System.exit(-1);
            }
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

查询画质增强用量

接口请求参数和返回参数说明详见查询画质增强用量

package com.volcengine.example.vod.measure;

import com.volcengine.service.vod.IVodService;
import com.volcengine.service.vod.impl.VodServiceImpl;
public class VodDescribeVodEnhanceImageDataDemo {

    public static void main(String[] args) throws Exception {
        // Create a VOD instance in the specified region.
        // IVodService vodService = VodServiceImpl.getInstance("cn-north-1");
        IVodService vodService = VodServiceImpl.getInstance();

        // Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65641.
        // The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed.
        // During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account.
        // vodService.setAccessKey("your ak");
        // vodService.setSecretKey("your sk");

        try {
            com.volcengine.service.vod.model.request.DescribeVodEnhanceImageDataRequest.Builder reqBuilder = com.volcengine.service.vod.model.request.DescribeVodEnhanceImageDataRequest.newBuilder();
                        reqBuilder.setSpaceList("your SpaceList");
                        reqBuilder.setStartTime("your StartTime");
                        reqBuilder.setEndTime("your EndTime");
                        reqBuilder.setTaskTypeList("your TaskTypeList");
                        reqBuilder.setTaskStageList("your TaskStageList");
                        reqBuilder.setAggregation(0);
 
                        
            com.volcengine.service.vod.model.response.DescribeVodEnhanceImageDataResponse resp = vodService.describeVodEnhanceImageData(reqBuilder.build());
            if (resp.getResponseMetadata().hasError()) {
                System.out.println(resp.getResponseMetadata().getError());
                System.exit(-1);
            }
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

查询检测修复用量

接口请求参数和返回参数说明详见查询检测修复用量

package com.volcengine.example.vod.measure;

import com.volcengine.service.vod.IVodService;
import com.volcengine.service.vod.impl.VodServiceImpl;
public class VodDescribeVodSpaceDetectStatisDataDemo {

    public static void main(String[] args) throws Exception {
        // Create a VOD instance in the specified region.
        // IVodService vodService = VodServiceImpl.getInstance("cn-north-1");
        IVodService vodService = VodServiceImpl.getInstance();

        // Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65641.
        // The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed.
        // During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account.
        // vodService.setAccessKey("your ak");
        // vodService.setSecretKey("your sk");

        try {
            com.volcengine.service.vod.model.request.DescribeVodSpaceDetectStatisDataRequest.Builder reqBuilder = com.volcengine.service.vod.model.request.DescribeVodSpaceDetectStatisDataRequest.newBuilder();
         reqBuilder.setSpaceList("your SpaceList");
         reqBuilder.setStartTime("your StartTime");
         reqBuilder.setEndTime("your EndTime");
         reqBuilder.setDetectType("your DetectType");
         reqBuilder.setTaskStageList("your TaskStageList");
         reqBuilder.setAggregation(0);
         reqBuilder.setDetailFieldList("your DetailFieldList");
         
            com.volcengine.service.vod.model.response.DescribeVodSpaceDetectStatisDataResponse resp = vodService.describeVodSpaceDetectStatisData(reqBuilder.build());
            if (resp.getResponseMetadata().hasError()) {
                System.out.println(resp.getResponseMetadata().getError());
                System.exit(-1);
            }
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

查询多媒体 AI 用量

接口请求参数和返回参数说明详见查询多媒体 AI 用量

package com.volcengine.example.vod.measure;

import com.volcengine.service.vod.IVodService;
import com.volcengine.service.vod.impl.VodServiceImpl;
public class VodDescribeVodSpaceAIStatisDataDemo {

    public static void main(String[] args) throws Exception {
        // Create a VOD instance in the specified region.
        // IVodService vodService = VodServiceImpl.getInstance("cn-north-1");
        IVodService vodService = VodServiceImpl.getInstance();

        // Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65641.
        // The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed.
        // During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account.
        // vodService.setAccessKey("your ak");
        // vodService.setSecretKey("your sk");

        try {
            com.volcengine.service.vod.model.request.DescribeVodSpaceAIStatisDataRequest.Builder reqBuilder = com.volcengine.service.vod.model.request.DescribeVodSpaceAIStatisDataRequest.newBuilder();
         reqBuilder.setSpaceList("your SpaceList");
         reqBuilder.setStartTime("your StartTime");
         reqBuilder.setEndTime("your EndTime");
         reqBuilder.setMediaAiType("your MediaAiType");
         reqBuilder.setTaskStageList("your TaskStageList");
         reqBuilder.setAggregation(0);
         reqBuilder.setDetailFieldList("your DetailFieldList");
         
            com.volcengine.service.vod.model.response.DescribeVodSpaceAIStatisDataResponse resp = vodService.describeVodSpaceAIStatisData(reqBuilder.build());
            if (resp.getResponseMetadata().hasError()) {
                System.out.println(resp.getResponseMetadata().getError());
                System.exit(-1);
            }
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

查询智能字幕用量

接口请求参数和返回参数说明详见查询智能字幕用量

package com.volcengine.example.vod.measure;

import com.volcengine.service.vod.IVodService;
import com.volcengine.service.vod.impl.VodServiceImpl;
public class VodDescribeVodSpaceSubtitleStatisDataDemo {

    public static void main(String[] args) throws Exception {
        // Create a VOD instance in the specified region.
        // IVodService vodService = VodServiceImpl.getInstance("cn-north-1");
        IVodService vodService = VodServiceImpl.getInstance();

        // Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65641.
        // The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed.
        // During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account.
        // vodService.setAccessKey("your ak");
        // vodService.setSecretKey("your sk");

        try {
            com.volcengine.service.vod.model.request.DescribeVodSpaceSubtitleStatisDataRequest.Builder reqBuilder = com.volcengine.service.vod.model.request.DescribeVodSpaceSubtitleStatisDataRequest.newBuilder();
         reqBuilder.setSpaceList("your SpaceList");
         reqBuilder.setStartTime("your StartTime");
         reqBuilder.setEndTime("your EndTime");
         reqBuilder.setSubtitleType("your SubtitleType");
         reqBuilder.setTaskStageList("your TaskStageList");
         reqBuilder.setAggregation(0);
         reqBuilder.setDetailFieldList("your DetailFieldList");
         
            com.volcengine.service.vod.model.response.DescribeVodSpaceSubtitleStatisDataResponse resp = vodService.describeVodSpaceSubtitleStatisData(reqBuilder.build());
            if (resp.getResponseMetadata().hasError()) {
                System.out.println(resp.getResponseMetadata().getError());
                System.exit(-1);
            }
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

查询视频剪辑用量

接口请求参数和返回参数说明详见查询视频剪辑用量

package com.volcengine.example.vod.measure;

import com.volcengine.service.vod.IVodService;
import com.volcengine.service.vod.impl.VodServiceImpl;
public class VodDescribeVodSpaceEditStatisDataDemo {

    public static void main(String[] args) throws Exception {
        // Create a VOD instance in the specified region.
        // IVodService vodService = VodServiceImpl.getInstance("cn-north-1");
        IVodService vodService = VodServiceImpl.getInstance();

        // Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65641.
        // The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed.
        // During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account.
        // vodService.setAccessKey("your ak");
        // vodService.setSecretKey("your sk");

        try {
            com.volcengine.service.vod.model.request.DescribeVodSpaceEditStatisDataRequest.Builder reqBuilder = com.volcengine.service.vod.model.request.DescribeVodSpaceEditStatisDataRequest.newBuilder();
                        reqBuilder.setSpaceList("your SpaceList");
                        reqBuilder.setStartTime("your StartTime");
                        reqBuilder.setEndTime("your EndTime");
                        reqBuilder.setSpecification("your Specification");
                        reqBuilder.setAggregation(0);
                        reqBuilder.setDetailFieldList("your DetailFieldList");
                        
            com.volcengine.service.vod.model.response.DescribeVodSpaceEditStatisDataResponse resp = vodService.describeVodSpaceEditStatisData(reqBuilder.build());
            if (resp.getResponseMetadata().hasError()) {
                System.out.println(resp.getResponseMetadata().getError());
                System.exit(-1);
            }
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

查询转码详细数据

接口请求参数和返回参数说明详见查询转码详细数据

package com.volcengine.example.vod.measure;

import com.volcengine.service.vod.IVodService;
import com.volcengine.service.vod.impl.VodServiceImpl;
public class VodDescribeVodSpaceWorkflowDetailDataDemo {

    public static void main(String[] args) throws Exception {
        // Create a VOD instance in the specified region.
        // IVodService vodService = VodServiceImpl.getInstance("cn-north-1");
        IVodService vodService = VodServiceImpl.getInstance();

        // Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65641.
        // The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed.
        // During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account.
        // vodService.setAccessKey("your ak");
        // vodService.setSecretKey("your sk");

        try {
            com.volcengine.service.vod.model.request.DescribeVodSpaceWorkflowDetailDataRequest.Builder reqBuilder = com.volcengine.service.vod.model.request.DescribeVodSpaceWorkflowDetailDataRequest.newBuilder();
                        reqBuilder.setRegion("your Region");
                        reqBuilder.setSpace("your Space");
                        reqBuilder.setStartTime("your StartTime");
                        reqBuilder.setEndTime("your EndTime");
                        reqBuilder.setPageSize(0);
                        reqBuilder.setPageNum(0);
                        
            com.volcengine.service.vod.model.response.DescribeVodSpaceWorkflowDetailDataResponse resp = vodService.describeVodSpaceWorkflowDetailData(reqBuilder.build());
            if (resp.getResponseMetadata().hasError()) {
                System.out.println(resp.getResponseMetadata().getError());
                System.exit(-1);
            }
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

查询视频剪辑详细数据

接口请求参数和返回参数说明详见查询视频剪辑详细数据

package com.volcengine.example.vod.measure;

import com.volcengine.service.vod.IVodService;
import com.volcengine.service.vod.impl.VodServiceImpl;
public class VodDescribeVodSpaceEditDetailDataDemo {

    public static void main(String[] args) throws Exception {
        // Create a VOD instance in the specified region.
        // IVodService vodService = VodServiceImpl.getInstance("cn-north-1");
        IVodService vodService = VodServiceImpl.getInstance();

        // Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65641.
        // The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed.
        // During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account.
        // vodService.setAccessKey("your ak");
        // vodService.setSecretKey("your sk");

        try {
            com.volcengine.service.vod.model.request.DescribeVodSpaceEditDetailDataRequest.Builder reqBuilder = com.volcengine.service.vod.model.request.DescribeVodSpaceEditDetailDataRequest.newBuilder();
                        reqBuilder.setRegion("your Region");
                        reqBuilder.setSpace("your Space");
                        reqBuilder.setStartTime("your StartTime");
                        reqBuilder.setEndTime("your EndTime");
                        reqBuilder.setPageSize(0);
                        reqBuilder.setPageNum(0);
                        
            com.volcengine.service.vod.model.response.DescribeVodSpaceEditDetailDataResponse resp = vodService.describeVodSpaceEditDetailData(reqBuilder.build());
            if (resp.getResponseMetadata().hasError()) {
                System.out.println(resp.getResponseMetadata().getError());
                System.exit(-1);
            }
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

获取带宽流量

接口请求参数和返回参数说明详见获取带宽流量

package com.volcengine.example.vod.cdn;

import com.volcengine.service.vod.IVodService;
import com.volcengine.service.vod.impl.VodServiceImpl;
public class VodListCdnUsageDataDemo {

    public static void main(String[] args) throws Exception {
        // Create a VOD instance in the specified region.
        // IVodService vodService = VodServiceImpl.getInstance("cn-north-1");
        IVodService vodService = VodServiceImpl.getInstance();

        // Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65641.
        // The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed.
        // During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account.
        // vodService.setAccessKey("your ak");
        // vodService.setSecretKey("your sk");

        try {
            com.volcengine.service.vod.model.request.VodListCdnUsageDataRequest.Builder reqBuilder = com.volcengine.service.vod.model.request.VodListCdnUsageDataRequest.newBuilder();
         reqBuilder.setDomains("your Domains");
         reqBuilder.setInterval("your Interval");
         reqBuilder.setStartTimestamp(0);
         reqBuilder.setEndTimestamp(0);
         reqBuilder.setDataType("your DataType");
         reqBuilder.setMetric("your Metric");
         
            com.volcengine.service.vod.model.response.VodCdnStatisticsCommonResponse resp = vodService.listCdnUsageData(reqBuilder.build());
            if (resp.getResponseMetadata().hasError()) {
                System.out.println(resp.getResponseMetadata().getError());
                System.exit(-1);
            }
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

获取请求数

接口请求参数和返回参数说明详见获取请求数

package com.volcengine.example.vod.cdn;

import com.volcengine.service.vod.IVodService;
import com.volcengine.service.vod.impl.VodServiceImpl;
public class VodListCdnPvDataDemo {

    public static void main(String[] args) throws Exception {
        // Create a VOD instance in the specified region.
        // IVodService vodService = VodServiceImpl.getInstance("cn-north-1");
        IVodService vodService = VodServiceImpl.getInstance();

        // Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65641.
        // The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed.
        // During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account.
        // vodService.setAccessKey("your ak");
        // vodService.setSecretKey("your sk");

        try {
            com.volcengine.service.vod.model.request.VodListCdnPvDataRequest.Builder reqBuilder = com.volcengine.service.vod.model.request.VodListCdnPvDataRequest.newBuilder();
         reqBuilder.setDomains("your Domains");
         reqBuilder.setInterval("your Interval");
         reqBuilder.setStartTimestamp(0);
         reqBuilder.setEndTimestamp(0);
         reqBuilder.setDataType("your DataType");
         
            com.volcengine.service.vod.model.response.VodCdnStatisticsCommonResponse resp = vodService.listCdnPvData(reqBuilder.build());
            if (resp.getResponseMetadata().hasError()) {
                System.out.println(resp.getResponseMetadata().getError());
                System.exit(-1);
            }
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

获取状态码

接口请求参数和返回参数说明详见获取状态码

package com.volcengine.example.vod.cdn;

import com.volcengine.service.vod.IVodService;
import com.volcengine.service.vod.impl.VodServiceImpl;
public class VodListCdnStatusDataDemo {

    public static void main(String[] args) throws Exception {
        // Create a VOD instance in the specified region.
        // IVodService vodService = VodServiceImpl.getInstance("cn-north-1");
        IVodService vodService = VodServiceImpl.getInstance();

        // Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65641.
        // The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed.
        // During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account.
        // vodService.setAccessKey("your ak");
        // vodService.setSecretKey("your sk");

        try {
            com.volcengine.service.vod.model.request.VodListCdnStatusDataRequest.Builder reqBuilder = com.volcengine.service.vod.model.request.VodListCdnStatusDataRequest.newBuilder();
         reqBuilder.setDomains("your Domains");
         reqBuilder.setInterval("your Interval");
         reqBuilder.setStartTimestamp(0);
         reqBuilder.setEndTimestamp(0);
         reqBuilder.setDataType("your DataType");
         reqBuilder.setMetric("your Metric");
         
            com.volcengine.service.vod.model.response.VodCdnStatisticsCommonResponse resp = vodService.listCdnStatusData(reqBuilder.build());
            if (resp.getResponseMetadata().hasError()) {
                System.out.println(resp.getResponseMetadata().getError());
                System.exit(-1);
            }
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

获取热点 URL 统计

接口请求参数和返回参数说明详见获取热点 URL 统计

package com.volcengine.example.vod.cdn;

import com.volcengine.service.vod.IVodService;
import com.volcengine.service.vod.impl.VodServiceImpl;
public class VodListCdnTopAccessUrlDemo {

    public static void main(String[] args) throws Exception {
        // Create a VOD instance in the specified region.
        // IVodService vodService = VodServiceImpl.getInstance("cn-north-1");
        IVodService vodService = VodServiceImpl.getInstance();

        // Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65641.
        // The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed.
        // During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account.
        // vodService.setAccessKey("your ak");
        // vodService.setSecretKey("your sk");

        try {
            com.volcengine.service.vod.model.request.VodListCdnTopAccessUrlRequest.Builder reqBuilder = com.volcengine.service.vod.model.request.VodListCdnTopAccessUrlRequest.newBuilder();
         reqBuilder.setDomains("your Domains");
         reqBuilder.setStartTimestamp(0);
         reqBuilder.setEndTimestamp(0);
         reqBuilder.setSortType("your SortType");
         
            com.volcengine.service.vod.model.response.VodListCdnTopAccessUrlResponse resp = vodService.listCdnTopAccessUrl(reqBuilder.build());
            if (resp.getResponseMetadata().hasError()) {
                System.out.println(resp.getResponseMetadata().getError());
                System.exit(-1);
            }
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

获取热点统计数据

接口请求参数和返回参数说明详见获取热点统计数据

package com.volcengine.example.vod.cdn;

import com.volcengine.service.vod.IVodService;
import com.volcengine.service.vod.impl.VodServiceImpl;
public class VodListCdnTopAccessDemo {

    public static void main(String[] args) throws Exception {
        // Create a VOD instance in the specified region.
        // IVodService vodService = VodServiceImpl.getInstance("cn-north-1");
        IVodService vodService = VodServiceImpl.getInstance();

        // Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65641.
        // The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed.
        // During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account.
        // vodService.setAccessKey("your ak");
        // vodService.setSecretKey("your sk");

        try {
            com.volcengine.service.vod.model.request.VodListCdnTopAccessRequest.Builder reqBuilder = com.volcengine.service.vod.model.request.VodListCdnTopAccessRequest.newBuilder();
         reqBuilder.setDomains("your Domains");
         reqBuilder.setStartTimestamp(0);
         reqBuilder.setEndTimestamp(0);
         reqBuilder.setSortType("your SortType");
         reqBuilder.setItem("your Item");
         
            com.volcengine.service.vod.model.response.VodListCdnTopAccessResponse resp = vodService.listCdnTopAccess(reqBuilder.build());
            if (resp.getResponseMetadata().hasError()) {
                System.out.println(resp.getResponseMetadata().getError());
                System.exit(-1);
            }
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

查询视频播放信息

接口请求参数和返回参数说明详见查询视频播放信息

package com.volcengine.example.vod.measure;

import com.volcengine.service.vod.IVodService;
import com.volcengine.service.vod.impl.VodServiceImpl;
public class VodDescribeVodPlayedStatisDataDemo {

    public static void main(String[] args) throws Exception {
        // Create a VOD instance in the specified region.
        // IVodService vodService = VodServiceImpl.getInstance("cn-north-1");
        IVodService vodService = VodServiceImpl.getInstance();

        // Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65641.
        // The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed.
        // During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account.
        // vodService.setAccessKey("your ak");
        // vodService.setSecretKey("your sk");

        try {
            com.volcengine.service.vod.model.request.DescribeVodPlayedStatisDataRequest.Builder reqBuilder = com.volcengine.service.vod.model.request.DescribeVodPlayedStatisDataRequest.newBuilder();
                        reqBuilder.setSpace("your Space");
                        reqBuilder.setStartTime("your StartTime");
                        reqBuilder.setEndTime("your EndTime");
                        reqBuilder.setVidList("your VidList");
                        reqBuilder.setOrderType("your OrderType");
                        
            com.volcengine.service.vod.model.response.DescribeVodPlayedStatisDataResponse resp = vodService.describeVodPlayedStatisData(reqBuilder.build());
            if (resp.getResponseMetadata().hasError()) {
                System.out.println(resp.getResponseMetadata().getError());
                System.exit(-1);
            }
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

查询播放 TopN 的视频

接口请求参数和返回参数说明详见查询播放 TopN 的视频

package com.volcengine.example.vod.measure;

import com.volcengine.service.vod.IVodService;
import com.volcengine.service.vod.impl.VodServiceImpl;
public class VodDescribeVodMostPlayedStatisDataDemo {

    public static void main(String[] args) throws Exception {
        // Create a VOD instance in the specified region.
        // IVodService vodService = VodServiceImpl.getInstance("cn-north-1");
        IVodService vodService = VodServiceImpl.getInstance();

        // Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65641.
        // The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed.
        // During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account.
        // vodService.setAccessKey("your ak");
        // vodService.setSecretKey("your sk");

        try {
            com.volcengine.service.vod.model.request.DescribeVodMostPlayedStatisDataRequest.Builder reqBuilder = com.volcengine.service.vod.model.request.DescribeVodMostPlayedStatisDataRequest.newBuilder();
                        reqBuilder.setSpace("your Space");
                        reqBuilder.setStartTime("your StartTime");
                        reqBuilder.setEndTime("your EndTime");
                        reqBuilder.setOrderType("your OrderType");
                        reqBuilder.setTopN(0);
                        
            com.volcengine.service.vod.model.response.DescribeVodMostPlayedStatisDataResponse resp = vodService.describeVodMostPlayedStatisData(reqBuilder.build());
            if (resp.getResponseMetadata().hasError()) {
                System.out.println(resp.getResponseMetadata().getError());
                System.exit(-1);
            }
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

查询播放统计文件下载地址

接口请求参数和返回参数说明详见 DescribeVodVidTrafficFileLog

// Code generated by protoc-gen-volcengine-sdk
// source: describeVodVidTrafficFileLog
// DO NOT EDIT!

package com.volcengine.example.vod.measure;

import com.volcengine.service.vod.IVodService;
import com.volcengine.service.vod.impl.VodServiceImpl;
public class VodDescribeVodVidTrafficFileLogDemo {

    public static void main(String[] args) throws Exception {
        // Create a VOD instance in the specified region.
        // IVodService vodService = VodServiceImpl.getInstance("cn-north-1");
        IVodService vodService = VodServiceImpl.getInstance();

        // Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65641.
        // The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed.
        // During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account.
        // vodService.setAccessKey("your ak");
        // vodService.setSecretKey("your sk");

        try {
            com.volcengine.service.vod.model.request.DescribeVodVidTrafficFileLogRequest.Builder reqBuilder = com.volcengine.service.vod.model.request.DescribeVodVidTrafficFileLogRequest.newBuilder();
                        reqBuilder.setSpaceList("your SpaceList");
                        reqBuilder.setStartTime("your StartTime");
                        reqBuilder.setEndTime("your EndTime");
                        
            com.volcengine.service.vod.model.response.DescribeVodVidTrafficFileLogResponse resp = vodService.describeVodVidTrafficFileLog(reqBuilder.build());
            if (resp.getResponseMetadata().hasError()) {
                System.out.println(resp.getResponseMetadata().getError());
                System.exit(-1);
            }
            System.out.println(resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}