Elastic high-performance computing cluster
Updated at:2025-10-20
Create an EHC high-performance cluster
You can create an EHC high-performance cluster with the following code
Go
1package main
2import (
3 "fmt"
4 "github.com/baidubce/bce-sdk-go/services/bcc/api"
5 "github.com/baidubce/bce-sdk-go/services/bcc"
6)
7func main() {
8 // Initialize AK/SK/Endpoint
9 ak, sk, endpoint := "ak", "sk", "bcc.bj.baidubce.com"
10 // Create a BCC client
11 client, _ := bcc.NewClient(ak, sk, endpoint)
12 args := &api.CreateEhcClusterArg{
13 Name: "test-ehcCluster",
14 ZoneName: "cn-bj-a",
15 Description: "test description",
16 }
17 result, _ := BCC_CLIENT.CreateEhcCluster(args)
18 fmt.Println(result)
19}
Query the list of EHC high-performance clusters
You can query the list of EHC high-performance clusters with the following code
Go
1package main
2import (
3 "fmt"
4 "github.com/baidubce/bce-sdk-go/services/bcc/api"
5 "github.com/baidubce/bce-sdk-go/services/bcc"
6)
7func main() {
8 // Initialize AK/SK/Endpoint
9 ak, sk, endpoint := "ak", "sk", "bcc.bj.baidubce.com"
10 // Create a BCC client
11 client, _ := bcc.NewClient(ak, sk, endpoint)
12 args := &api.DescribeEhcClusterListArg{
13 EhcClusterIdList: []string{
14 "ehc-bk4hM1N3",
15 }, NameList: []string{
16 "test-modify",
17 },
18 ZoneName: "cn-bj-a",
19 SortKey: "name",
20 SortDir: "asc",
21 }
22 result, err := BCC_CLIENT.ListEhcCluster(args)
23 fmt.Println(result)
24 fmt.Println(err)
25}
Modify an EHC high-performance cluster
You can modify an EHC high-performance cluster with the following code
Go
1package main
2import (
3 "fmt"
4 "github.com/baidubce/bce-sdk-go/services/bcc"
5 "github.com/baidubce/bce-sdk-go/services/bcc/api"
6)
7func main() {
8 // Initialize AK/SK/Endpoint
9 ak, sk, endpoint := "ak", "sk", "bcc.bj.baidubce.com"
10 // Create a BCC client
11 client, _ := bcc.NewClient(ak, sk, endpoint)
12 descriptions := ""
13 args := &api.ModifyEhcClusterArg{
14 EhcClusterId: "ehc-bk4hM1N3",
15 Name: "test-modify",
16 Description: &descriptions,
17 }
18 err := BCC_CLIENT.ModifyEhcCluster(args)
19 fmt.Println(err)
20}
Delete an EHC high-performance cluster
You can delete an EHC high-performance cluster with the following code
Go
1package main
2import (
3 "github.com/baidubce/bce-sdk-go/model"
4 "github.com/baidubce/bce-sdk-go/services/bcc/api"
5 "github.com/baidubce/bce-sdk-go/services/bcc"
6)
7func main() {
8 // Initialize AK/SK/Endpoint
9 ak, sk, endpoint := "ak", "sk", "bcc.bj.baidubce.com"
10 client, _ := bcc.NewClient(ak, sk, endpoint) // Create a BCC Client
11 args := &api.DeleteEhcClusterArg{
12 EhcClusterIdList: []string{
13 "ehc-tBmphmZE",
14 },
15 }
16 err := BCC_CLIENT.DeleteEhcCluster(args)
17 fmt.Println(err)
18}
