tencentcloud-sdk-nodejs-clb 4.0.1015 → 4.0.1038
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -28
- package/package.json +1 -1
- package/src/services/clb/v20180317/clb_client.ts +69 -8
- package/src/services/clb/v20180317/clb_models.ts +401 -248
- package/tencentcloud/services/clb/v20180317/clb_client.d.ts +21 -1
- package/tencentcloud/services/clb/v20180317/clb_client.js +30 -0
- package/tencentcloud/services/clb/v20180317/clb_models.d.ts +390 -248
- package/products.md +0 -263
package/README.md
CHANGED
@@ -1,36 +1,66 @@
|
|
1
1
|
# 简介
|
2
2
|
|
3
|
-
欢迎使用腾讯云开发者工具套件(SDK),
|
4
|
-
为方便
|
3
|
+
欢迎使用腾讯云开发者工具套件(SDK),Node.js SDK 4.0 是云 API 3.0 平台的配套工具。
|
4
|
+
为方便 Node.js 开发者调试和接入腾讯云产品 API,这里向您介绍适用于 Node.js 的腾讯云开发工具包,并提供首次使用开发工具包的简单示例。让您快速获取腾讯云 Node.js SDK 并开始调用。
|
5
5
|
|
6
6
|
# 依赖环境
|
7
7
|
|
8
|
-
1.
|
9
|
-
2.
|
10
|
-
3. 获取 SecretID、SecretKey 以及调用地址(endpoint),endpoint 一般形式为\*.tencentcloudapi.com,如 CVM 的调用地址为 cvm.tencentcloudapi.com,具体参考各产品说明。
|
8
|
+
1. Node.js 10.0.0 版本及以上。
|
9
|
+
2. 注意:部分产品需在 [腾讯云控制台](https://console.cloud.tencent.com/) 开通服务后才能使用。
|
11
10
|
|
12
11
|
# 获取安装
|
13
12
|
|
14
|
-
|
13
|
+
使用 SDK 需要 API 密钥,可前往 [腾讯云控制台 - 访问密钥](https://console.cloud.tencent.com/cam/capi) 页面申请,API 密钥包括 SecretID 和 SecretKey,密钥须严格保管,避免泄露。
|
15
14
|
|
16
|
-
## 通过
|
15
|
+
## 通过 npm 安装
|
17
16
|
|
18
|
-
通过 npm 获取安装是使用
|
17
|
+
通过 npm 获取安装是使用 Node.js SDK 的推荐方法,关于 npm 详细可参考 [NPM 官网](https://www.npmjs.com/) 。
|
19
18
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
### 安装指定产品 SDK(推荐)
|
20
|
+
|
21
|
+
安装 CVM SDK:
|
22
|
+
|
23
|
+
```
|
24
|
+
npm install tencentcloud-sdk-nodejs-cvm --save
|
25
|
+
```
|
26
|
+
|
27
|
+
安装 VPC SDK:
|
28
|
+
|
29
|
+
```
|
30
|
+
npm install tencentcloud-sdk-nodejs-vpc --save
|
31
|
+
```
|
32
|
+
|
33
|
+
具体产品的缩写表请参考 [products.md](./products.md) 中的包名字段。
|
34
|
+
|
35
|
+
安装指定产品 SDK 后,注意修改引入的包名:
|
36
|
+
|
37
|
+
```diff
|
38
|
+
- const tencentcloud = require("tencentcloud-sdk-nodejs")
|
39
|
+
+ const { cvm } = require("tencentcloud-sdk-nodejs-cvm")
|
40
|
+
|
41
|
+
- const CvmClient = tencentcloud.cvm.v20170312.Client
|
42
|
+
+ const CvmClient = cvm.v20170312.Client
|
43
|
+
```
|
44
|
+
|
45
|
+
### 安装全产品 SDK
|
46
|
+
|
47
|
+
```
|
48
|
+
npm install tencentcloud-sdk-nodejs --save
|
49
|
+
```
|
50
|
+
|
51
|
+
全产品 SDK 包含了所有云产品的调用代码,体积偏大,对体积敏感的场景,推荐安装指定产品 SDK。
|
24
52
|
|
25
53
|
## 通过源码包安装
|
26
54
|
|
27
|
-
1. 前往 [
|
55
|
+
1. 前往 [GitHub 仓库](https://github.com/tencentcloud/tencentcloud-sdk-nodejs) 或者 [Gitee 仓库](https://gitee.com/tencentcloud/tencentcloud-sdk-nodejs) 下载源码压缩包。
|
28
56
|
2. 解压源码包到您项目合适的位置,例如 `sdk/tencentcloud-sdk-nodejs`。
|
29
57
|
3. 执行 `npm install ./sdk/tencentcloud-sdk-nodejs`。
|
30
|
-
4. 使用 `require("tencentcloud-sdk-nodejs")` 的方式引入
|
58
|
+
4. 使用 `require("tencentcloud-sdk-nodejs")` 的方式引入 SDK,具体可参考示例。
|
31
59
|
|
32
60
|
# 示例
|
33
61
|
|
62
|
+
以云服务器产品查询可用区列表接口为例。
|
63
|
+
|
34
64
|
```js
|
35
65
|
const tencentcloud = require("tencentcloud-sdk-nodejs")
|
36
66
|
|
@@ -73,7 +103,7 @@ client.DescribeZones().then(
|
|
73
103
|
)
|
74
104
|
```
|
75
105
|
|
76
|
-
在支持
|
106
|
+
在支持 TypeScript 项目中,采用如下方式调用
|
77
107
|
|
78
108
|
```js
|
79
109
|
import * as tencentcloud from "tencentcloud-sdk-nodejs"
|
@@ -83,10 +113,11 @@ const CvmClient = tencentcloud.cvm.v20170312.Client
|
|
83
113
|
// ...
|
84
114
|
```
|
85
115
|
|
86
|
-
|
116
|
+
实例化 `Client` 的入参支持 `clientConfig`,数据结构和说明详见 [ClientConfig](https://github.com/TencentCloud/tencentcloud-sdk-nodejs/blob/master/src/common/interface.ts)。
|
87
117
|
|
88
118
|
## Common Client
|
89
|
-
|
119
|
+
|
120
|
+
从 4.0.714 版本开始,腾讯云 Node.js SDK 支持使用泛用性的 API 调用方式(Common Client)进行请求。您只需要安装 tencentcloud-sdk-nodejs-common 包,即可向任何产品发起调用。
|
90
121
|
|
91
122
|
**注意,您必须明确知道您调用的接口所需参数,否则可能会调用失败。**
|
92
123
|
|
@@ -94,19 +125,19 @@ const CvmClient = tencentcloud.cvm.v20170312.Client
|
|
94
125
|
|
95
126
|
## 更多示例
|
96
127
|
|
97
|
-
|
128
|
+
请参考 [examples](https://github.com/TencentCloud/tencentcloud-sdk-nodejs/tree/master/examples) 目录。
|
98
129
|
|
99
130
|
# 相关配置
|
100
131
|
|
101
132
|
## 代理
|
102
133
|
|
103
|
-
如果是有代理的环境下,需要配置代理,请在创建Client时传入 [profile.httpProfile.proxy](https://github.com/TencentCloud/tencentcloud-sdk-nodejs/blob/master/src/common/interface.ts#L78) 参数,或设置系统环境变量 `http_proxy` ,否则可能无法正常调用,抛出连接超时的异常。
|
134
|
+
如果是有代理的环境下,需要配置代理,请在创建 Client 时传入 [profile.httpProfile.proxy](https://github.com/TencentCloud/tencentcloud-sdk-nodejs/blob/master/src/common/interface.ts#L78) 参数,或设置系统环境变量 `http_proxy` ,否则可能无法正常调用,抛出连接超时的异常。
|
104
135
|
|
105
136
|
# 凭证管理
|
106
137
|
|
107
138
|
除显式传入凭证外,从 `v4.0.506` 起支持 [腾讯云实例角色](https://cloud.tencent.com/document/product/213/47668)
|
108
139
|
|
109
|
-
在您为实例绑定角色后,您可以在实例中访问相关元数据接口获取临时凭证。用法可参考 [js示例代码](./examples/cvm_role.js) 或 [ts示例代码](./examples/cvm_role.ts)
|
140
|
+
在您为实例绑定角色后,您可以在实例中访问相关元数据接口获取临时凭证。用法可参考 [js 示例代码](./examples/cvm_role.js) 或 [ts 示例代码](./examples/cvm_role.ts)
|
110
141
|
```javascript
|
111
142
|
// ...
|
112
143
|
const CvmRoleCredential = require("tencentcloud-sdk-nodejs/tencentcloud/common/cvm_role_credential").default
|
@@ -118,20 +149,16 @@ new XxxClient({
|
|
118
149
|
})
|
119
150
|
```
|
120
151
|
|
121
|
-
# 旧版 SDK
|
122
|
-
|
123
|
-
我们推荐使用新版 NODEJS SDK,如果一定要用旧版 SDK,请前往[github 仓库](https://github.com/CFETeam/qcloudapi-sdk)下载。
|
124
|
-
|
125
152
|
# 常见问题
|
126
|
-
- webpack打包出错/浏览器报错
|
153
|
+
- webpack 打包出错/浏览器报错
|
127
154
|
|
128
|
-
请**务必不要**将此
|
155
|
+
请**务必不要**将此 SDK 直接用于 Web 前端(包括小程序等),暴露密钥在这些环境非常不安全。
|
129
156
|
|
130
|
-
正确的做法是在自己的服务端引用此
|
157
|
+
正确的做法是在自己的服务端引用此 SDK,并保存好密钥,做好请求鉴权,前端再调用服务端执行业务流程。
|
131
158
|
|
132
159
|
- `The "original" argument must be of type Function.`
|
133
160
|
|
134
|
-
通常是因为
|
161
|
+
通常是因为 Node.js 版本低于 `v10` ,或处于非 Node.js 环境,请再次确认执行环境。
|
135
162
|
|
136
163
|
- 请求不通
|
137
164
|
|
package/package.json
CHANGED
@@ -25,6 +25,7 @@ import {
|
|
25
25
|
SetLoadBalancerSecurityGroupsResponse,
|
26
26
|
RulesItems,
|
27
27
|
ExtraInfo,
|
28
|
+
ClassicalListener,
|
28
29
|
BatchModifyTargetWeightResponse,
|
29
30
|
SetSecurityGroupForLoadbalancersRequest,
|
30
31
|
CreateLoadBalancerRequest,
|
@@ -32,7 +33,7 @@ import {
|
|
32
33
|
DeleteRuleRequest,
|
33
34
|
CloneLoadBalancerRequest,
|
34
35
|
DisassociateTargetGroupsResponse,
|
35
|
-
|
36
|
+
ListenerBackend,
|
36
37
|
SetLoadBalancerClsLogResponse,
|
37
38
|
DescribeLoadBalancerTrafficResponse,
|
38
39
|
MultiCertInfo,
|
@@ -44,17 +45,20 @@ import {
|
|
44
45
|
ModifyLoadBalancerAttributesResponse,
|
45
46
|
DescribeTargetGroupInstancesRequest,
|
46
47
|
DescribeIdleLoadBalancersResponse,
|
47
|
-
|
48
|
+
BindItem,
|
48
49
|
DescribeLoadBalancersRequest,
|
50
|
+
AddCustomizedConfigRequest,
|
49
51
|
ClassicalTarget,
|
50
52
|
ListenerItem,
|
51
53
|
RsWeightRule,
|
52
54
|
RegisterFunctionTargetsRequest,
|
53
55
|
DeregisterTargetsFromClassicalLBRequest,
|
54
56
|
InquiryPriceModifyLoadBalancerRequest,
|
57
|
+
ModifyCustomizedConfigRequest,
|
55
58
|
BasicTargetGroupInfo,
|
56
59
|
ModifyTargetWeightResponse,
|
57
60
|
ZoneResource,
|
61
|
+
AssociateTargetGroupsRequest,
|
58
62
|
DescribeTaskStatusRequest,
|
59
63
|
TargetGroupInstance,
|
60
64
|
DescribeClassicalLBByInstanceIdResponse,
|
@@ -63,7 +67,7 @@ import {
|
|
63
67
|
RuleHealth,
|
64
68
|
DescribeExclusiveClustersResponse,
|
65
69
|
ModifyDomainRequest,
|
66
|
-
|
70
|
+
DisassociateCustomizedConfigResponse,
|
67
71
|
BatchModifyTargetTagRequest,
|
68
72
|
RegisterTargetGroupInstancesResponse,
|
69
73
|
ClassicalTargetInfo,
|
@@ -73,6 +77,7 @@ import {
|
|
73
77
|
DescribeTargetGroupsResponse,
|
74
78
|
LoadBalancerHealth,
|
75
79
|
InquiryPriceCreateLoadBalancerRequest,
|
80
|
+
ModifyFunctionTargetsResponse,
|
76
81
|
DeleteLoadBalancerListenersRequest,
|
77
82
|
BlockedIP,
|
78
83
|
ModifyRuleResponse,
|
@@ -81,9 +86,10 @@ import {
|
|
81
86
|
DeregisterFunctionTargetsResponse,
|
82
87
|
DescribeCustomizedConfigListRequest,
|
83
88
|
AutoRewriteRequest,
|
89
|
+
IdleLoadBalancer,
|
84
90
|
DescribeCrossTargetsResponse,
|
85
91
|
FunctionInfo,
|
86
|
-
|
92
|
+
ModifyCustomizedConfigResponse,
|
87
93
|
DescribeLoadBalancerListByCertIdResponse,
|
88
94
|
ModifyTargetGroupInstancesWeightResponse,
|
89
95
|
DescribeTargetGroupsRequest,
|
@@ -96,6 +102,7 @@ import {
|
|
96
102
|
Target,
|
97
103
|
DescribeLoadBalancerTrafficRequest,
|
98
104
|
DescribeBlockIPListRequest,
|
105
|
+
MigrateClassicalLoadBalancersResponse,
|
99
106
|
CertIdRelatedWithLoadBalancers,
|
100
107
|
ItemPrice,
|
101
108
|
DescribeClassicalLBHealthStatusResponse,
|
@@ -106,13 +113,14 @@ import {
|
|
106
113
|
SpecAvailability,
|
107
114
|
ConfigListItem,
|
108
115
|
RegisterTargetsWithClassicalLBRequest,
|
116
|
+
HealthCheck,
|
109
117
|
ModifyDomainAttributesResponse,
|
110
118
|
ReplaceCertForLoadBalancersResponse,
|
111
119
|
DescribeTargetsResponse,
|
112
120
|
ModifyListenerRequest,
|
113
121
|
DeregisterTargetGroupInstancesResponse,
|
114
122
|
RegisterTargetsRequest,
|
115
|
-
|
123
|
+
DisassociateCustomizedConfigRequest,
|
116
124
|
AssociateTargetGroupsResponse,
|
117
125
|
CreateTopicRequest,
|
118
126
|
DeleteListenerRequest,
|
@@ -139,9 +147,10 @@ import {
|
|
139
147
|
CreateClsLogSetResponse,
|
140
148
|
Backend,
|
141
149
|
LBChargePrepaid,
|
142
|
-
|
150
|
+
AddCustomizedConfigResponse,
|
143
151
|
DeleteLoadBalancerRequest,
|
144
152
|
ModifyLoadBalancersProjectRequest,
|
153
|
+
AssociateCustomizedConfigRequest,
|
145
154
|
CertificateInput,
|
146
155
|
ResourceAvailability,
|
147
156
|
SetLoadBalancerSecurityGroupsRequest,
|
@@ -149,7 +158,7 @@ import {
|
|
149
158
|
SetCustomizedConfigForLoadBalancerRequest,
|
150
159
|
CreateListenerResponse,
|
151
160
|
CreateTargetGroupResponse,
|
152
|
-
|
161
|
+
AssociateCustomizedConfigResponse,
|
153
162
|
CreateLoadBalancerSnatIpsResponse,
|
154
163
|
ClassicalLoadBalancerInfo,
|
155
164
|
DescribeListenersResponse,
|
@@ -215,7 +224,7 @@ import {
|
|
215
224
|
Price,
|
216
225
|
ModifyTargetGroupInstancesPortRequest,
|
217
226
|
BatchRegisterTargetsRequest,
|
218
|
-
|
227
|
+
DeleteCustomizedConfigResponse,
|
219
228
|
SetSecurityGroupForLoadbalancersResponse,
|
220
229
|
RuleInput,
|
221
230
|
TagInfo,
|
@@ -226,6 +235,7 @@ import {
|
|
226
235
|
DescribeClassicalLBListenersResponse,
|
227
236
|
DescribeExclusiveClustersRequest,
|
228
237
|
ModifyLoadBalancerSlaRequest,
|
238
|
+
SetLoadBalancerStartStatusResponse,
|
229
239
|
DescribeBlockIPTaskRequest,
|
230
240
|
Resource,
|
231
241
|
CreateLoadBalancerResponse,
|
@@ -234,6 +244,7 @@ import {
|
|
234
244
|
Quota,
|
235
245
|
SetLoadBalancerClsLogRequest,
|
236
246
|
LBItem,
|
247
|
+
DeleteCustomizedConfigRequest,
|
237
248
|
ModifyTargetGroupAttributeResponse,
|
238
249
|
DeleteLoadBalancerListenersResponse,
|
239
250
|
DescribeIdleLoadBalancersRequest,
|
@@ -333,6 +344,16 @@ export class Client extends TencentCloudCommon.AbstractClient {
|
|
333
344
|
return this.request("ModifyTargetGroupInstancesWeight", req, cb)
|
334
345
|
}
|
335
346
|
|
347
|
+
/**
|
348
|
+
* 关联配置到server或location,根据配置类型关联到server或location。准备下线,请使用SetCustomizedConfigForLoadBalancer。
|
349
|
+
*/
|
350
|
+
async AssociateCustomizedConfig(
|
351
|
+
req: AssociateCustomizedConfigRequest,
|
352
|
+
cb?: (error: string, rep: AssociateCustomizedConfigResponse) => void
|
353
|
+
): Promise<AssociateCustomizedConfigResponse> {
|
354
|
+
return this.request("AssociateCustomizedConfig", req, cb)
|
355
|
+
}
|
356
|
+
|
336
357
|
/**
|
337
358
|
* DeregisterTargetsFromClassicalLB 接口用于解绑负载均衡后端服务。本接口为异步接口,接口返回成功后,需以返回的 RequestId 为入参,调用 DescribeTaskStatus 接口查询本次任务是否成功。
|
338
359
|
*/
|
@@ -480,6 +501,16 @@ export class Client extends TencentCloudCommon.AbstractClient {
|
|
480
501
|
return this.request("DeleteRewrite", req, cb)
|
481
502
|
}
|
482
503
|
|
504
|
+
/**
|
505
|
+
* 去关联个性化配置,准备下线,请使用SetCustomizedConfigForLoadBalancer。
|
506
|
+
*/
|
507
|
+
async DisassociateCustomizedConfig(
|
508
|
+
req: DisassociateCustomizedConfigRequest,
|
509
|
+
cb?: (error: string, rep: DisassociateCustomizedConfigResponse) => void
|
510
|
+
): Promise<DisassociateCustomizedConfigResponse> {
|
511
|
+
return this.request("DisassociateCustomizedConfig", req, cb)
|
512
|
+
}
|
513
|
+
|
483
514
|
/**
|
484
515
|
* SetLoadBalancerSecurityGroups 接口支持对一个公网负载均衡实例执行设置(绑定、解绑)安全组操作。查询一个负载均衡实例目前已绑定的安全组,可使用 DescribeLoadBalancers 接口。本接口是set语义,
|
485
516
|
绑定操作时,入参需要传入负载均衡实例要绑定的所有安全组(已绑定的+新增绑定的)。
|
@@ -557,6 +588,16 @@ export class Client extends TencentCloudCommon.AbstractClient {
|
|
557
588
|
return this.request("ModifyListener", req, cb)
|
558
589
|
}
|
559
590
|
|
591
|
+
/**
|
592
|
+
* 删除个性化配置,准备下线,请使用SetCustomizedConfigForLoadBalancer。
|
593
|
+
*/
|
594
|
+
async DeleteCustomizedConfig(
|
595
|
+
req: DeleteCustomizedConfigRequest,
|
596
|
+
cb?: (error: string, rep: DeleteCustomizedConfigResponse) => void
|
597
|
+
): Promise<DeleteCustomizedConfigResponse> {
|
598
|
+
return this.request("DeleteCustomizedConfig", req, cb)
|
599
|
+
}
|
600
|
+
|
560
601
|
/**
|
561
602
|
* 查询用户在当前地域支持可用区列表和资源列表。
|
562
603
|
*/
|
@@ -818,6 +859,16 @@ export class Client extends TencentCloudCommon.AbstractClient {
|
|
818
859
|
return this.request("CreateRule", req, cb)
|
819
860
|
}
|
820
861
|
|
862
|
+
/**
|
863
|
+
* 新增个性化配置,准备下线,请使用SetCustomizedConfigForLoadBalancer。
|
864
|
+
*/
|
865
|
+
async AddCustomizedConfig(
|
866
|
+
req: AddCustomizedConfigRequest,
|
867
|
+
cb?: (error: string, rep: AddCustomizedConfigResponse) => void
|
868
|
+
): Promise<AddCustomizedConfigResponse> {
|
869
|
+
return this.request("AddCustomizedConfig", req, cb)
|
870
|
+
}
|
871
|
+
|
821
872
|
/**
|
822
873
|
* ModifyDomain接口用来修改负载均衡七层监听器下的域名。
|
823
874
|
本接口为异步接口,本接口返回成功后需以返回的RequestID为入参,调用DescribeTaskStatus接口查询本次任务是否成功。
|
@@ -881,6 +932,16 @@ export class Client extends TencentCloudCommon.AbstractClient {
|
|
881
932
|
return this.request("DeleteRule", req, cb)
|
882
933
|
}
|
883
934
|
|
935
|
+
/**
|
936
|
+
* 修改个性化配置。如果配置已经绑定clb、server或location,同时更新。准备下线,请使用SetCustomizedConfigForLoadBalancer。
|
937
|
+
*/
|
938
|
+
async ModifyCustomizedConfig(
|
939
|
+
req: ModifyCustomizedConfigRequest,
|
940
|
+
cb?: (error: string, rep: ModifyCustomizedConfigResponse) => void
|
941
|
+
): Promise<ModifyCustomizedConfigResponse> {
|
942
|
+
return this.request("ModifyCustomizedConfig", req, cb)
|
943
|
+
}
|
944
|
+
|
884
945
|
/**
|
885
946
|
* 本接口用于查询异步任务的执行状态,对于非查询类的接口(创建/删除负载均衡实例、监听器、规则以及绑定或解绑后端服务等),在接口调用成功后,都需要使用本接口查询任务最终是否执行成功。
|
886
947
|
*/
|