You need to enable JavaScript to run this app.
导航
HEIF 编码监控
最近更新时间:2024.12.05 16:20:25首次发布时间:2024.12.05 16:20:25

阅读本文,您可以获取 Go SDK HEIF 编码监控的接口调用示例,实现快速开发。

说明

本文的调用示例包含接口的部分参数。由于参数间可能存在互斥关系,在调用时,请您参考注释,进行调整。

调用说明

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

前提条件

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

调用示例

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

查询 HEIF 编码成功次数时序数据

您可以调用 DescribeImageXHeifEncodeSuccessCountByTime 接口查询 HEIF 编码成功次数时序数据。详细的参数说明可参见 DescribeImageXHeifEncodeSuccessCountByTime 接口文档。

接口调用示例如下所示。

package imagex_test

import (
	"context"
	"encoding/json"
	"fmt"
	"testing"

	"github.com/volcengine/volc-sdk-golang/base"
	imagex "github.com/volcengine/volc-sdk-golang/service/imagex/v2"
)

func Test_DescribeImageXHeifEncodeSuccessCountByTime(t *testing.T) {
	instance := imagex.NewInstance()

	instance.SetCredential(base.Credentials{
		AccessKeyID:     "ak",
		SecretAccessKey: "sk",
	})

	param := &imagex.DescribeImageXHeifEncodeSuccessCountByTimeReq{
		DescribeImageXHeifEncodeSuccessCountByTimeQuery: &imagex.DescribeImageXHeifEncodeSuccessCountByTimeQuery{},
		DescribeImageXHeifEncodeSuccessCountByTimeBody:  &imagex.DescribeImageXHeifEncodeSuccessCountByTimeBody{},
	}

	resp, err := instance.DescribeImageXHeifEncodeSuccessCountByTime(context.Background(), param)

	if err != nil {
		fmt.Printf("error %v", err)
	} else {
		t, _ := json.Marshal(resp)
		fmt.Printf("success %v", string(t))
	}
}

查询 HEIF 编码成功率时序数据

您可以调用 DescribeImageXHeifEncodeSuccessRateByTime 接口查询 HEIF 编码成功率时序数据。详细的参数说明可参见 DescribeImageXHeifEncodeSuccessRateByTime 接口文档。

接口调用示例如下所示。

package imagex_test

import (
	"context"
	"encoding/json"
	"fmt"
	"testing"

	"github.com/volcengine/volc-sdk-golang/base"
	imagex "github.com/volcengine/volc-sdk-golang/service/imagex/v2"
)

func Test_DescribeImageXHeifEncodeSuccessRateByTime(t *testing.T) {
	instance := imagex.NewInstance()

	instance.SetCredential(base.Credentials{
		AccessKeyID:     "ak",
		SecretAccessKey: "sk",
	})

	param := &imagex.DescribeImageXHeifEncodeSuccessRateByTimeReq{
		DescribeImageXHeifEncodeSuccessRateByTimeQuery: &imagex.DescribeImageXHeifEncodeSuccessRateByTimeQuery{},
		DescribeImageXHeifEncodeSuccessRateByTimeBody:  &imagex.DescribeImageXHeifEncodeSuccessRateByTimeBody{},
	}

	resp, err := instance.DescribeImageXHeifEncodeSuccessRateByTime(context.Background(), param)

	if err != nil {
		fmt.Printf("error %v", err)
	} else {
		t, _ := json.Marshal(resp)
		fmt.Printf("success %v", string(t))
	}
}

查询 HEIF 编码后文件大小时序数据

您可以调用 DescribeImageXHeifEncodeFileOutSizeByTime 接口查询 HEIF 编码后文件大小时序数据。详细的参数说明可参见 DescribeImageXHeifEncodeFileOutSizeByTime 接口文档。

接口调用示例如下所示。

package imagex_test

import (
	"context"
	"encoding/json"
	"fmt"
	"testing"

	"github.com/volcengine/volc-sdk-golang/base"
	imagex "github.com/volcengine/volc-sdk-golang/service/imagex/v2"
)

func Test_DescribeImageXHeifEncodeFileOutSizeByTime(t *testing.T) {
	instance := imagex.NewInstance()

	instance.SetCredential(base.Credentials{
		AccessKeyID:     "ak",
		SecretAccessKey: "sk",
	})

	param := &imagex.DescribeImageXHeifEncodeFileOutSizeByTimeReq{
		DescribeImageXHeifEncodeFileOutSizeByTimeQuery: &imagex.DescribeImageXHeifEncodeFileOutSizeByTimeQuery{},
		DescribeImageXHeifEncodeFileOutSizeByTimeBody:  &imagex.DescribeImageXHeifEncodeFileOutSizeByTimeBody{},
	}

	resp, err := instance.DescribeImageXHeifEncodeFileOutSizeByTime(context.Background(), param)

	if err != nil {
		fmt.Printf("error %v", err)
	} else {
		t, _ := json.Marshal(resp)
		fmt.Printf("success %v", string(t))
	}
}

查询 HEIF 编码错误码时序数据

您可以调用 DescribeImageXHeifEncodeErrorCodeByTime 接口查询 HEIF 编码错误码时序数据。详细的参数说明可参见 DescribeImageXHeifEncodeErrorCodeByTime 接口文档。

接口调用示例如下所示。

package imagex_test

import (
	"context"
	"encoding/json"
	"fmt"
	"testing"

	"github.com/volcengine/volc-sdk-golang/base"
	imagex "github.com/volcengine/volc-sdk-golang/service/imagex/v2"
)

func Test_DescribeImageXHeifEncodeErrorCodeByTime(t *testing.T) {
	instance := imagex.NewInstance()

	instance.SetCredential(base.Credentials{
		AccessKeyID:     "ak",
		SecretAccessKey: "sk",
	})

	param := &imagex.DescribeImageXHeifEncodeErrorCodeByTimeReq{
		DescribeImageXHeifEncodeErrorCodeByTimeQuery: &imagex.DescribeImageXHeifEncodeErrorCodeByTimeQuery{},
		DescribeImageXHeifEncodeErrorCodeByTimeBody:  &imagex.DescribeImageXHeifEncodeErrorCodeByTimeBody{},
	}

	resp, err := instance.DescribeImageXHeifEncodeErrorCodeByTime(context.Background(), param)

	if err != nil {
		fmt.Printf("error %v", err)
	} else {
		t, _ := json.Marshal(resp)
		fmt.Printf("success %v", string(t))
	}
}

查询 HEIF 编码前文件大小时序数据

您可以调用 DescribeImageXHeifEncodeFileInSizeByTime 接口查询 HEIF 编码前文件大小时序数据。详细的参数说明可参见 DescribeImageXHeifEncodeFileInSizeByTime 接口文档。

接口调用示例如下所示。

package imagex_test

import (
	"context"
	"encoding/json"
	"fmt"
	"testing"

	"github.com/volcengine/volc-sdk-golang/base"
	imagex "github.com/volcengine/volc-sdk-golang/service/imagex/v2"
)

func Test_DescribeImageXHeifEncodeFileInSizeByTime(t *testing.T) {
	instance := imagex.NewInstance()

	instance.SetCredential(base.Credentials{
		AccessKeyID:     "ak",
		SecretAccessKey: "sk",
	})

	param := &imagex.DescribeImageXHeifEncodeFileInSizeByTimeReq{
		DescribeImageXHeifEncodeFileInSizeByTimeQuery: &imagex.DescribeImageXHeifEncodeFileInSizeByTimeQuery{},
		DescribeImageXHeifEncodeFileInSizeByTimeBody:  &imagex.DescribeImageXHeifEncodeFileInSizeByTimeBody{},
	}

	resp, err := instance.DescribeImageXHeifEncodeFileInSizeByTime(context.Background(), param)

	if err != nil {
		fmt.Printf("error %v", err)
	} else {
		t, _ := json.Marshal(resp)
		fmt.Printf("success %v", string(t))
	}
}

查询 HEIF 编码耗时时序数据

您可以调用 DescribeImageXHeifEncodeDurationByTime 接口查询 HEIF 编码耗时时序数据。详细的参数说明可参见 DescribeImageXHeifEncodeDurationByTime 接口文档。

接口调用示例如下所示。

package imagex_test

import (
	"context"
	"encoding/json"
	"fmt"
	"testing"

	"github.com/volcengine/volc-sdk-golang/base"
	imagex "github.com/volcengine/volc-sdk-golang/service/imagex/v2"
)

func Test_DescribeImageXHeifEncodeDurationByTime(t *testing.T) {
	instance := imagex.NewInstance()

	instance.SetCredential(base.Credentials{
		AccessKeyID:     "ak",
		SecretAccessKey: "sk",
	})

	param := &imagex.DescribeImageXHeifEncodeDurationByTimeReq{
		DescribeImageXHeifEncodeDurationByTimeQuery: &imagex.DescribeImageXHeifEncodeDurationByTimeQuery{},
		DescribeImageXHeifEncodeDurationByTimeBody:  &imagex.DescribeImageXHeifEncodeDurationByTimeBody{},
	}

	resp, err := instance.DescribeImageXHeifEncodeDurationByTime(context.Background(), param)

	if err != nil {
		fmt.Printf("error %v", err)
	} else {
		t, _ := json.Marshal(resp)
		fmt.Printf("success %v", string(t))
	}
}