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 DescribeCenRouteEntries() {
	//设置您的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)
	//创建一个DescribeCenRouteEntries
	describeCenRouteEntriesInput := &cen.DescribeCenRouteEntriesInput{
		PageNumber: volcengine.Int64(1),  //列表的页码
		PageSize:   volcengine.Int64(20),  //分页查询时每页的行数
	}

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

相关文档