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

删除云企业网实例

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

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

本文介绍如何删除指定的CEN实例。

示例代码

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 DeleteCen() {
	//设置您的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)
	//删除指定的CEN实例
	deleteCenInput := &cen.DeleteCenInput{
		CenId: volcengine.String("cen-7qthudw0ll6jmc****"),  //CEN实例的ID
	}

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

相关文档