本文介绍如何修改IPsec连接信息。
package vpnexample import ( "fmt" "github.com/volcengine/volcengine-go-sdk/service/vpn" "github.com/volcengine/volcengine-go-sdk/volcengine" "github.com/volcengine/volcengine-go-sdk/volcengine/credentials" "github.com/volcengine/volcengine-go-sdk/volcengine/session" ) func ModifyVpnConnectionAttributes() { // 设置您的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 := vpn.New(sess) // 配置待修改IPsec连接的信息。 modifyVpnConnectionAttributesInput := &vpn.ModifyVpnConnectionAttributesInput{ VpnConnectionId: volcengine.String("vgc-2bzvqi8kerd342dx0eg2f****"), // 待修改IPsec连接的ID。 } // 发起请求并处理返回或异常。 resp, err := svc.ModifyVpnConnectionAttributes(modifyVpnConnectionAttributesInput) if err != nil { panic(err) } fmt.Println(resp) }