阅读本文,您可以获取 Go SDK 数据监控的接口调用示例,实现快速开发。
调用接口前,请先完成 Go SDK 的安装及初始化操作。
本节为您介绍数据监控相关接口的功能和调用示例。
您可以调用 DescribeImageXEdgeRequest 接口获取指定时间段的边缘请求次数。详细的参数说明可参见 DescribeImageXEdgeRequest 接口文档。
接口调用示例如下所示。
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_DescribeImageXEdgeRequest(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXEdgeRequestQuery{} resp, err := instance.DescribeImageXEdgeRequest(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }
您可以调用 DescribeImageXEdgeRequestBandwidth 接口获取指定时间段的边缘分发带宽用量。详细的参数说明可参见 DescribeImageXEdgeRequestBandwidth 接口文档。
接口调用示例如下所示。
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_DescribeImageXEdgeRequestBandwidth(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXEdgeRequestBandwidthQuery{} resp, err := instance.DescribeImageXEdgeRequestBandwidth(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }
您可以调用 DescribeImageXEdgeRequestTraffic 接口获取指定时间段的边缘分发流量用量。详细的参数说明可参见 DescribeImageXEdgeRequestTraffic 接口文档。
接口调用示例如下所示。
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_DescribeImageXEdgeRequestTraffic(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXEdgeRequestTrafficQuery{} resp, err := instance.DescribeImageXEdgeRequestTraffic(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }
您可以调用 DescribeImageXMirrorRequestBandwidth 接口获取指定时间段的镜像回源带宽。详细的参数说明可参见 DescribeImageXMirrorRequestBandwidth 接口文档。
接口调用示例如下所示。
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_DescribeImageXMirrorRequestBandwidth(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXMirrorRequestBandwidthBody{} resp, err := instance.DescribeImageXMirrorRequestBandwidth(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }
您可以调用 DescribeImageXMirrorRequestTraffic 接口获取指定时间段的镜像回源流量。详细的参数说明可参见 DescribeImageXMirrorRequestTraffic 接口文档。
接口调用示例如下所示。
具体示例如下所示:
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_DescribeImageXMirrorRequestTraffic(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXMirrorRequestTrafficBody{} resp, err := instance.DescribeImageXMirrorRequestTraffic(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }
您可以调用 DescribeImageXMirrorRequestHttpCodeByTime 接口获取指定时间段的镜像回源请求次时序数据。详细的参数说明可参见 DescribeImageXMirrorRequestHttpCodeByTime 接口文档。
接口调用示例如下所示。
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_DescribeImageXMirrorRequestHTTPCodeByTime(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXMirrorRequestHTTPCodeByTimeBody{} resp, err := instance.DescribeImageXMirrorRequestHTTPCodeByTime(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }
您可以调用 DescribeImageXMirrorRequestHttpCodeOverview 接口获取指定时间段的镜像回源请求次域名明细数据。详细的参数说明可参见 DescribeImageXMirrorRequestHttpCodeOverview 接口文档。
接口调用示例如下所示。
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_DescribeImageXMirrorRequestHTTPCodeOverview(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXMirrorRequestHTTPCodeOverviewBody{} resp, err := instance.DescribeImageXMirrorRequestHTTPCodeOverview(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }
您可以调用 DescribeImageXEdgeRequestRegions 接口获取指定时间段的边缘分发数据的地区列表。详细的参数说明可参见 DescribeImageXEdgeRequestRegions 接口文档。
接口调用示例如下所示。
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_DescribeImageXEdgeRequestRegions(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXEdgeRequestRegionsQuery{} resp, err := instance.DescribeImageXEdgeRequestRegions(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }
您可以调用 DescribeImageXServerQPSUsage 接口获取指定时间段的数据处理服务 QPS 用量。详细的参数说明可参见 DescribeImageXServerQPSUsage 接口文档。
接口调用示例如下所示。
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_DescribeImageXServerQPSUsage(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXServerQPSUsageQuery{} resp, err := instance.DescribeImageXServerQPSUsage(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }