阅读本文,您可以获取 Go SDK 下行网络监控的接口调用示例,实现快速开发。
调用接口前,请先完成 Go SDK 的安装及初始化操作。
本节为您介绍下行网络监控相关接口的功能和调用示例。
您可以调用 DescribeImageXCdnSuccessRateByTime 接口指定查询维度获取下行网络监控的网络成功率时序数据。详细的参数说明可参见 DescribeImageXCdnSuccessRateByTime 接口文档。
接口调用示例如下所示。
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_DescribeImageXCdnSuccessRateByTime(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXCdnSuccessRateByTimeBody{} resp, err := instance.DescribeImageXCdnSuccessRateByTime(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }
您可以调用 DescribeImageXCdnSuccessRateAll 接口指定查询维度获取下行网络监控的网络成功率分布数据。详细的参数说明可参见 DescribeImageXCdnSuccessRateAll 接口文档。
接口调用示例如下所示。
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_DescribeImageXCdnSuccessRateAll(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXCdnSuccessRateAllBody{} resp, err := instance.DescribeImageXCdnSuccessRateAll(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }
您可以调用 DescribeImageXCdnErrorCodeByTime 接口指定查询维度获取下行网络监控的错误码时序数据。详细的参数说明可参见 DescribeImageXCdnErrorCodeByTime 接口文档。
接口调用示例如下所示。
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_DescribeImageXCdnErrorCodeByTime(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXCdnErrorCodeByTimeBody{} resp, err := instance.DescribeImageXCdnErrorCodeByTime(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }
您可以调用 DescribeImageXCdnErrorCodeAll 接口指定查询维度来获取下行网络监控的错误码分布数据。详细的参数说明可参见 DescribeImageXCdnErrorCodeAll 接口文档。
接口调用示例如下所示。
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_DescribeImageXCdnErrorCodeAll(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXCdnErrorCodeAllBody{} resp, err := instance.DescribeImageXCdnErrorCodeAll(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }
您可以调用 DescribeImageXCdnDurationDetailByTime 接口指定查询维度获取下行网络监控的网络耗时时序数据。详细的参数说明可参见 DescribeImageXCdnDurationDetailByTime 接口文档。
接口调用示例如下所示。
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_DescribeImageXCdnDurationDetailByTime(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXCdnDurationDetailByTimeBody{} resp, err := instance.DescribeImageXCdnDurationDetailByTime(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }
您可以调用 DescribeImageXCdnDurationAll 接口指定查询维度获取下行网络监控的网络耗时分布数据。详细的参数说明可参见 DescribeImageXCdnDurationAll 接口文档。
接口调用示例如下所示。
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_DescribeImageXCdnDurationAll(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXCdnDurationAllBody{} resp, err := instance.DescribeImageXCdnDurationAll(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }
您可以调用 DescribeImageXCdnReuseRateByTime 接口指定查询维度获取下行网络监控的网络连接复用率时序数据。详细的参数说明可参见 DescribeImageXCdnReuseRateByTime 接口文档。
接口调用示例如下所示。
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_DescribeImageXCdnReuseRateByTime(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXCdnReuseRateByTimeBody{} resp, err := instance.DescribeImageXCdnReuseRateByTime(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }
您可以调用 DescribeImageXCdnReuseRateAll 接口指定查询维度获取下行网络监控的网络连接复用率分布数据。详细的参数说明可参见 DescribeImageXCdnReuseRateAll 接口文档。
接口调用示例如下所示。
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_DescribeImageXCdnReuseRateAll(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXCdnReuseRateAllBody{} resp, err := instance.DescribeImageXCdnReuseRateAll(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }
您可以调用 DescribeImageXCdnProtocolRateByTime 接口指定查询维度获取下行网络监控的网络协议占比数据。详细的参数说明可参见 DescribeImageXCdnProtocolRateByTime 接口文档。
接口调用示例如下所示。
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_DescribeImageXCdnProtocolRateByTime(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXCdnProtocolRateByTimeBody{} resp, err := instance.DescribeImageXCdnProtocolRateByTime(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }