11package client
22
33import (
4+ cbs "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs/v20170312"
45 cdb "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdb/v20170320"
56 clb "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb/v20180317"
67 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
@@ -11,6 +12,7 @@ import (
1112 monitor "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/monitor/v20180724"
1213 redis "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/redis/v20180412"
1314 vpc "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312"
15+
1416 "github.com/tencentyun/tencentcloud-exporter/pkg/config"
1517)
1618
@@ -32,7 +34,6 @@ func NewMongodbClient(conf *config.TencentConfig) (*mongodb.Client, error) {
3234 cpf := profile .NewClientProfile ()
3335 cpf .HttpProfile .Endpoint = "mongodb.tencentcloudapi.com"
3436 return mongodb .NewClient (credential , conf .Credential .Region , cpf )
35-
3637}
3738
3839func NewCdbClient (conf * config.TencentConfig ) (* cdb.Client , error ) {
@@ -43,7 +44,6 @@ func NewCdbClient(conf *config.TencentConfig) (*cdb.Client, error) {
4344 cpf := profile .NewClientProfile ()
4445 cpf .HttpProfile .Endpoint = "cdb.tencentcloudapi.com"
4546 return cdb .NewClient (credential , conf .Credential .Region , cpf )
46-
4747}
4848
4949func NewCvmClient (conf * config.TencentConfig ) (* cvm.Client , error ) {
@@ -54,7 +54,6 @@ func NewCvmClient(conf *config.TencentConfig) (*cvm.Client, error) {
5454 cpf := profile .NewClientProfile ()
5555 cpf .HttpProfile .Endpoint = "cvm.tencentcloudapi.com"
5656 return cvm .NewClient (credential , conf .Credential .Region , cpf )
57-
5857}
5958
6059func NewRedisClient (conf * config.TencentConfig ) (* redis.Client , error ) {
@@ -75,7 +74,6 @@ func NewDcClient(conf *config.TencentConfig) (*dc.Client, error) {
7574 cpf := profile .NewClientProfile ()
7675 cpf .HttpProfile .Endpoint = "dc.tencentcloudapi.com"
7776 return dc .NewClient (credential , conf .Credential .Region , cpf )
78-
7977}
8078
8179func NewClbClient (conf * config.TencentConfig ) (* clb.Client , error ) {
@@ -86,7 +84,6 @@ func NewClbClient(conf *config.TencentConfig) (*clb.Client, error) {
8684 cpf := profile .NewClientProfile ()
8785 cpf .HttpProfile .Endpoint = "clb.tencentcloudapi.com"
8886 return clb .NewClient (credential , conf .Credential .Region , cpf )
89-
9087}
9188
9289func NewVpvClient (conf * config.TencentConfig ) (* vpc.Client , error ) {
@@ -97,5 +94,14 @@ func NewVpvClient(conf *config.TencentConfig) (*vpc.Client, error) {
9794 cpf := profile .NewClientProfile ()
9895 cpf .HttpProfile .Endpoint = "vpc.tencentcloudapi.com"
9996 return vpc .NewClient (credential , conf .Credential .Region , cpf )
97+ }
10098
99+ func NewCbsClient (conf * config.TencentConfig ) (* cbs.Client , error ) {
100+ credential := common .NewCredential (
101+ conf .Credential .AccessKey ,
102+ conf .Credential .SecretKey ,
103+ )
104+ cpf := profile .NewClientProfile ()
105+ cpf .HttpProfile .Endpoint = "cbs.tencentcloudapi.com"
106+ return cbs .NewClient (credential , conf .Credential .Region , cpf )
101107}
0 commit comments