You need to enable JavaScript to run this app.
导航

修改指定带宽包信息

最近更新时间2023.06.27 15:39:07

首次发布时间2023.06.27 15:39:07

本文介绍如何修改指定带宽包的信息。

示例代码

package cenexample

import (
	"fmt"

	"github.com/volcengine/volcengine-go-sdk/service/cen"
	"github.com/volcengine/volcengine-go-sdk/volcengine"
	"github.com/volcengine/volcengine-go-sdk/volcengine/credentials"
	"github.com/volcengine/volcengine-go-sdk/volcengine/session"
)

func ModifyCenBandwidthPackageAttributes() {
	//设置您的ak、sk和要访问的地域
	ak, sk, region := "Your AK", "Your SK", "Region"
	config := volcengine.NewConfig().
		WithRegion(region).
		WithCredentials(credentials.NewStaticCredentials(ak, sk, ""))
	sess, err := session.NewSession(config)
	if err != nil {
		panic(err)
	}
	svc := cen.New(sess)
	//修改指定带宽包的信息
	modifyCenBandwidthPackageAttributesInput := &cen.ModifyCenBandwidthPackageAttributesInput{
		Bandwidth:             volcengine.Int64(100), //带宽包的带宽上限
		CenBandwidthPackageId: volcengine.String("cbp-4c2zaavbvh5fx****"),  //带宽包的ID
	}

	//发起请求并处理返回或异常
	resp, err := svc.ModifyCenBandwidthPackageAttributes(modifyCenBandwidthPackageAttributesInput)
	if err != nil {
		panic(err)
	}
	fmt.Println(resp)
}

相关文档