forked from JointCloud/pcm-coordinator
34 lines
930 B
Go
34 lines
930 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
|
|
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors"
|
|
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile"
|
|
tke "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke/v20180525"
|
|
)
|
|
|
|
func main() {
|
|
|
|
credential := common.NewCredential(
|
|
"AKIDRefQxnhmuqTU1KRWFl58wQeCE0XoAeEZ",
|
|
"LUMVRmGj2kFrEahhZzA5pKvHNSMASntj",
|
|
)
|
|
cpf := profile.NewClientProfile()
|
|
cpf.HttpProfile.Endpoint = "tke.tencentcloudapi.com"
|
|
client, _ := tke.NewClient(credential, "ap-beijing", cpf)
|
|
|
|
request := tke.NewDescribeEKSContainerInstancesRequest()
|
|
|
|
response, err := client.DescribeEKSContainerInstances(request)
|
|
if _, ok := err.(*errors.TencentCloudSDKError); ok {
|
|
fmt.Printf("An API error has returned: %s", err)
|
|
return
|
|
}
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
fmt.Printf("%s", response.ToJsonString())
|
|
}
|