|
123456789101112131415161718192021222324252627282930313233 |
- 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())
- }
|