-
Notifications
You must be signed in to change notification settings - Fork 74
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
23 changed files
with
1,137 additions
and
245 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,27 @@ | ||
package bbc | ||
|
||
import ( | ||
"github.com/baidubce/bce-sdk-go/model" | ||
"github.com/baidubce/bce-sdk-go/services/bbc" | ||
) | ||
|
||
func BindReservedTagsDemo() { | ||
// 初始化AK/SK/Endpoint | ||
ak, sk, endpoint := "ak", "sk", "bbc.bj.baidubce.com" | ||
client, _ := bbc.NewClient(ak, sk, endpoint) // 创建BBC Client | ||
args := &bbc.ReservedTagsRequest{ | ||
ChangeTags: []model.TagModel{ | ||
{ | ||
TagKey: "TagKey-go", | ||
TagValue: "TagValue", | ||
}, | ||
}, | ||
ReservedInstanceIds: []string{ | ||
"r-oFpMXKhv", "r-HrztSVk0", | ||
}, | ||
} | ||
err := client.BindReservedInstanceToTags(args) | ||
if err != nil { | ||
panic(err) | ||
} | ||
} |
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,27 @@ | ||
package bbc | ||
|
||
import ( | ||
"github.com/baidubce/bce-sdk-go/model" | ||
"github.com/baidubce/bce-sdk-go/services/bbc" | ||
) | ||
|
||
func UnbindReservedTagsDemo() { | ||
// 初始化AK/SK/Endpoint | ||
ak, sk, endpoint := "ak", "sk", "bbc.bj.baidubce.com" | ||
client, _ := bbc.NewClient(ak, sk, endpoint) // 创建BBC Client | ||
args := &bbc.ReservedTagsRequest{ | ||
ChangeTags: []model.TagModel{ | ||
{ | ||
TagKey: "TagKey-go", | ||
TagValue: "TagValue", | ||
}, | ||
}, | ||
ReservedInstanceIds: []string{ | ||
"r-oFpMXKhv", "r-HrztSVk0", | ||
}, | ||
} | ||
err := client.UnbindReservedInstanceFromTags(args) | ||
if err != nil { | ||
panic(err) | ||
} | ||
} |
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,29 @@ | ||
package bcc | ||
|
||
import ( | ||
"github.com/baidubce/bce-sdk-go/model" | ||
"github.com/baidubce/bce-sdk-go/services/bcc/api" | ||
|
||
"github.com/baidubce/bce-sdk-go/services/bcc" | ||
) | ||
|
||
func BindBccReservedTagsDemo() { | ||
// 初始化AK/SK/Endpoint | ||
ak, sk, endpoint := "ak", "sk", "bcc.bj.baidubce.com" | ||
client, _ := bcc.NewClient(ak, sk, endpoint) // 创建BCC Client | ||
args := &api.ReservedTagsRequest{ | ||
ChangeTags: []model.TagModel{ | ||
{ | ||
TagKey: "TagKey-go", | ||
TagValue: "TagValue", | ||
}, | ||
}, | ||
ReservedInstanceIds: []string{ | ||
"r-oFpMXKhv", "r-HrztSVk0", | ||
}, | ||
} | ||
err := client.BindReservedInstanceToTags(args) | ||
if err != nil { | ||
panic(err) | ||
} | ||
} |
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,29 @@ | ||
package bcc | ||
|
||
import ( | ||
"github.com/baidubce/bce-sdk-go/model" | ||
"github.com/baidubce/bce-sdk-go/services/bcc/api" | ||
|
||
"github.com/baidubce/bce-sdk-go/services/bcc" | ||
) | ||
|
||
func UnbindBccReservedTagsDemo() { | ||
// 初始化AK/SK/Endpoint | ||
ak, sk, endpoint := "ak", "sk", "bcc.bj.baidubce.com" | ||
client, _ := bcc.NewClient(ak, sk, endpoint) // 创建BCC Client | ||
args := &api.ReservedTagsRequest{ | ||
ChangeTags: []model.TagModel{ | ||
{ | ||
TagKey: "TagKey-go", | ||
TagValue: "TagValue", | ||
}, | ||
}, | ||
ReservedInstanceIds: []string{ | ||
"r-oFpMXKhv", "r-HrztSVk0", | ||
}, | ||
} | ||
err := client.UnbindReservedInstanceFromTags(args) | ||
if err != nil { | ||
panic(err) | ||
} | ||
} |
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,31 @@ | ||
package tag | ||
|
||
import ( | ||
"github.com/baidubce/bce-sdk-go/model" | ||
"github.com/baidubce/bce-sdk-go/services/bcc/api" | ||
|
||
"github.com/baidubce/bce-sdk-go/services/bcc" | ||
) | ||
|
||
func BindTagsByResourceTypeDemo() { | ||
// 初始化AK/SK/Endpoint | ||
ak, sk, endpoint := "ak", "sk", "bcc.bj.baidubce.com" | ||
client, _ := bcc.NewClient(ak, sk, endpoint) // 创建BCC Client | ||
args := &api.TagsOperationRequest{ | ||
ResourceType: "bccri", | ||
ResourceIds: []string{ | ||
"r-oFpMXKhv", "r-HrztSVk0", | ||
}, | ||
Tags: []model.TagModel{ | ||
{ | ||
TagKey: "TagKey-go", | ||
TagValue: "TagValue", | ||
}, | ||
}, | ||
IsRelationTag: false, | ||
} | ||
err := client.BindInstanceToTagsByResourceType(args) | ||
if err != nil { | ||
panic(err) | ||
} | ||
} |
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,31 @@ | ||
package tag | ||
|
||
import ( | ||
"github.com/baidubce/bce-sdk-go/model" | ||
"github.com/baidubce/bce-sdk-go/services/bcc/api" | ||
|
||
"github.com/baidubce/bce-sdk-go/services/bcc" | ||
) | ||
|
||
func UnbindTagsByResourceTypeDemo() { | ||
// 初始化AK/SK/Endpoint | ||
ak, sk, endpoint := "ak", "sk", "bcc.bj.baidubce.com" | ||
client, _ := bcc.NewClient(ak, sk, endpoint) // 创建BCC Client | ||
args := &api.TagsOperationRequest{ | ||
ResourceType: "bccri", | ||
ResourceIds: []string{ | ||
"r-oFpMXKhv", "r-HrztSVk0", | ||
}, | ||
Tags: []model.TagModel{ | ||
{ | ||
TagKey: "TagKey-go", | ||
TagValue: "TagValue", | ||
}, | ||
}, | ||
IsRelationTag: false, | ||
} | ||
err := client.UnbindInstanceToTagsByResourceType(args) | ||
if err != nil { | ||
panic(err) | ||
} | ||
} |
Oops, something went wrong.