-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
143 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package vpcexamples | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/baidubce/bce-sdk-go/services/vpc" | ||
) | ||
|
||
// 以下为示例代码,实际开发中请根据需要进行修改和补充 | ||
|
||
func EnhanceNatBindEip() { | ||
ak, sk, endpoint := "Your AK", "Your SK", "bcc.bj.baidubce.com" | ||
|
||
natClient, _ := vpc.NewClient(ak, sk, endpoint) // 初始化client | ||
|
||
NatID := "Your nat's id" | ||
|
||
args := &vpc.EnhanceNatBindEipsArgs{ | ||
// 设置要绑定的 EIP 列表 | ||
BindEips: []string{"180.76.186.174"}, // 替换为需要绑定的 EIP 列表 | ||
} | ||
if err := natClient.EnhanceNatBindEips(NatID, args); err != nil { | ||
fmt.Println("bind eips error: ", err) | ||
return | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package vpcexamples | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/baidubce/bce-sdk-go/services/vpc" | ||
) | ||
|
||
// 以下为示例代码,实际开发中请根据需要进行修改和补充 | ||
|
||
func EnhanceNatUnBindEip() { | ||
ak, sk, endpoint := "Your AK", "Your SK", "bcc.bj.baidubce.com" | ||
|
||
natClient, _ := vpc.NewClient(ak, sk, endpoint) // 初始化client | ||
|
||
NatID := "Your nat's id" | ||
|
||
args := &vpc.EnhanceNatUnBindEipsArgs{ | ||
// 设置要解绑的 EIP 列表 | ||
BindEips: []string{"180.76.186.174"}, // 替换为需要解绑的 EIP 列表 | ||
} | ||
if err := natClient.EnhanceNatUnBindEips(NatID, args); err != nil { | ||
fmt.Println("unbind eips error: ", err) | ||
return | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters