@ucloud-sdks/ucloud-sdk-js 0.2.70 → 0.2.71

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.
@@ -19,6 +19,7 @@ export declare class Client extends BaseClient {
19
19
  uclickhouse(): any;
20
20
  udb(): any;
21
21
  udb_postgresql(): any;
22
+ udbproxy(): any;
22
23
  uddb(): any;
23
24
  udisk(): any;
24
25
  udns(): any;
@@ -15,6 +15,7 @@ const UCDNClient = require('./ucdn').default;
15
15
  const UClickhouseClient = require('./uclickhouse').default;
16
16
  const UDBClient = require('./udb').default;
17
17
  const UDBPostgreSQLClient = require('./udb_postgresql').default;
18
+ const UDBProxyClient = require('./udbproxy').default;
18
19
  const UDDBClient = require('./uddb').default;
19
20
  const UDiskClient = require('./udisk').default;
20
21
  const UDNSClient = require('./udns').default;
@@ -124,6 +125,12 @@ class Client extends BaseClient {
124
125
  credential: this.credential,
125
126
  });
126
127
  }
128
+ udbproxy() {
129
+ return new UDBProxyClient({
130
+ config: this.config,
131
+ credential: this.credential,
132
+ });
133
+ }
127
134
  uddb() {
128
135
  return new UDDBClient({
129
136
  config: this.config,
@@ -279,6 +279,12 @@ export default class UDBClient extends Client {
279
279
  * See also: https://docs.ucloud.cn/api/udb-api/fetch_udb_instance_earliest_recover_time
280
280
  */
281
281
  fetchUDBInstanceEarliestRecoverTime(request?: FetchUDBInstanceEarliestRecoverTimeRequest): Promise<FetchUDBInstanceEarliestRecoverTimeResponse>;
282
+ /**
283
+ * GetUDBAccessInfo - 查询 UDB 实例的内网与外网访问信息,包含外网地址端口、带宽、白名单,以及内网 VPC、子网、内网 IP、内网域名与端口1
284
+ *
285
+ * See also: https://docs.ucloud.cn/api/udb-api/get_udb_access_info
286
+ */
287
+ getUDBAccessInfo(request?: GetUDBAccessInfoRequest): Promise<GetUDBAccessInfoResponse>;
282
288
  /**
283
289
  * GetUDBClientConnNum - 输入一个DBID,能够获取客户端来源IP以及对应的连接数
284
290
  *
@@ -3123,6 +3129,82 @@ export interface FetchUDBInstanceEarliestRecoverTimeResponse {
3123
3129
  */
3124
3130
  EarliestTime?: number;
3125
3131
  }
3132
+ /**
3133
+ * GetUDBAccessInfo - 查询 UDB 实例的内网与外网访问信息,包含外网地址端口、带宽、白名单,以及内网 VPC、子网、内网 IP、内网域名与端口1
3134
+ */
3135
+ export interface GetUDBAccessInfoRequest {
3136
+ /**
3137
+ * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
3138
+ */
3139
+ Zone: string;
3140
+ /**
3141
+ * 实例ID
3142
+ */
3143
+ DBId: string;
3144
+ }
3145
+ /**
3146
+ * GetUDBAccessInfo - 查询 UDB 实例的内网与外网访问信息,包含外网地址端口、带宽、白名单,以及内网 VPC、子网、内网 IP、内网域名与端口1
3147
+ */
3148
+ export interface GetUDBAccessInfoResponse {
3149
+ /**
3150
+ * 实例外网访问信息,含状态、地址、端口、带宽与白名单
3151
+ */
3152
+ ExternalInfo: {
3153
+ /**
3154
+ * 外网访问状态,字符串枚举,取值见下表
3155
+ */
3156
+ Status?: string;
3157
+ /**
3158
+ * 外网访问地址;未开通外网访问时为空字符串
3159
+ */
3160
+ ExternalAddress?: string;
3161
+ /**
3162
+ * 外网访问端口;未开通时为 0
3163
+ */
3164
+ ExternalPort?: number;
3165
+ /**
3166
+ * 外网带宽,单位 Mbps,取自 EIP 带宽;无 EIP 时为 0
3167
+ */
3168
+ Bindwidth?: number;
3169
+ /**
3170
+ * 外网访问白名单,多个 IP 以逗号分隔,取自 NLB 白名单
3171
+ */
3172
+ WhiteList?: string;
3173
+ /**
3174
+ * 实例是否支持外网访问能力:1 支持;当前实现恒返回 1
3175
+ */
3176
+ Support?: number;
3177
+ }[];
3178
+ /**
3179
+ * 实例内网访问信息,含 VPC、子网、内网 IP、内网域名与端口
3180
+ */
3181
+ PrivateInfo: {
3182
+ /**
3183
+ * 实例内网所在的 VPC ID
3184
+ */
3185
+ VPCId?: string;
3186
+ /**
3187
+ * 实例内网所在的子网 ID
3188
+ */
3189
+ SubnetId?: string;
3190
+ /**
3191
+ * 实例内网服务地址(VIP)
3192
+ */
3193
+ PrivateIP?: string;
3194
+ /**
3195
+ * 实例的内网域名;未开通内网域名时为空字符串
3196
+ */
3197
+ PrivateDomain?: string;
3198
+ /**
3199
+ * 内网域名状态,字符串枚举,取值与 Status 同源;未开通内网域名时返回NetworkConnectionDisabled
3200
+ */
3201
+ PrivatePort?: number;
3202
+ /**
3203
+ * 实例内网服务端口
3204
+ */
3205
+ PrivateDomainStatus?: string;
3206
+ }[];
3207
+ }
3126
3208
  /**
3127
3209
  * GetUDBClientConnNum - 输入一个DBID,能够获取客户端来源IP以及对应的连接数
3128
3210
  */
@@ -417,6 +417,15 @@ class UDBClient extends client_1.default {
417
417
  const args = Object.assign({ Action: 'FetchUDBInstanceEarliestRecoverTime' }, (request || {}));
418
418
  return this.invoke(new request_1.default(args)).then((resp) => resp.toObject());
419
419
  }
420
+ /**
421
+ * GetUDBAccessInfo - 查询 UDB 实例的内网与外网访问信息,包含外网地址端口、带宽、白名单,以及内网 VPC、子网、内网 IP、内网域名与端口1
422
+ *
423
+ * See also: https://docs.ucloud.cn/api/udb-api/get_udb_access_info
424
+ */
425
+ getUDBAccessInfo(request) {
426
+ const args = Object.assign({ Action: 'GetUDBAccessInfo' }, (request || {}));
427
+ return this.invoke(new request_1.default(args)).then((resp) => resp.toObject());
428
+ }
420
429
  /**
421
430
  * GetUDBClientConnNum - 输入一个DBID,能够获取客户端来源IP以及对应的连接数
422
431
  *
@@ -0,0 +1,367 @@
1
+ import Client from '../../core/client';
2
+ import { ConfigOptions } from '../../core/config';
3
+ import { CredentialOptions } from '../../core/credential';
4
+ /**
5
+ * This client is used to call actions of **udbproxy** service
6
+ */
7
+ export default class UDBProxyClient extends Client {
8
+ constructor({ config, credential, }: {
9
+ config: ConfigOptions;
10
+ credential: CredentialOptions;
11
+ });
12
+ /**
13
+ * DescribeUDBProxy - 获取UDB代理服务详细信息
14
+ *
15
+ * See also: https://docs.ucloud.cn/api/udbproxy-api/describe_udb_proxy
16
+ */
17
+ describeUDBProxy(request?: DescribeUDBProxyRequest): Promise<DescribeUDBProxyResponse>;
18
+ /**
19
+ * ListUDBProxyClient - 查询代理客户端连接IP信息(实时)
20
+ *
21
+ * See also: https://docs.ucloud.cn/api/udbproxy-api/list_udb_proxy_client
22
+ */
23
+ listUDBProxyClient(request?: ListUDBProxyClientRequest): Promise<ListUDBProxyClientResponse>;
24
+ /**
25
+ * ListUDBProxyInstanceByDB - 查询DB启用代理数据
26
+ *
27
+ * See also: https://docs.ucloud.cn/api/udbproxy-api/list_udb_proxy_instance_by_db
28
+ */
29
+ listUDBProxyInstanceByDB(request?: ListUDBProxyInstanceByDBRequest): Promise<ListUDBProxyInstanceByDBResponse>;
30
+ }
31
+ /**
32
+ * DescribeUDBProxy - 获取UDB代理服务详细信息
33
+ */
34
+ export interface DescribeUDBProxyRequest {
35
+ /**
36
+ * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
37
+ */
38
+ Zone: string;
39
+ /**
40
+ * 读写分离ID
41
+ */
42
+ UDBProxyID: string;
43
+ }
44
+ /**
45
+ * DescribeUDBProxy - 获取UDB代理服务详细信息
46
+ */
47
+ export interface DescribeUDBProxyResponse {
48
+ /**
49
+ * UDBProxy实例ID
50
+ */
51
+ UDBProxyID: string;
52
+ /**
53
+ * UDB代理服务IP
54
+ */
55
+ UDBProxyIP: string;
56
+ /**
57
+ * UDB代理服务端口
58
+ */
59
+ UDBProxyPort: number;
60
+ /**
61
+ * 状态
62
+ */
63
+ State: string;
64
+ /**
65
+ * 创建时间
66
+ */
67
+ CreateTime: number;
68
+ /**
69
+ * 修改时间
70
+ */
71
+ ModifyTime: number;
72
+ /**
73
+ * 读权重模式:1-主节点模式;2-节点均衡模式;3-从节点均衡(排除主节点);5-用户自定义模式
74
+ */
75
+ ReadWeightMode: number;
76
+ /**
77
+ * cpu核数
78
+ */
79
+ CPUCores: number;
80
+ /**
81
+ * 内存
82
+ */
83
+ Memory: number;
84
+ /**
85
+ * 集群实例节点数
86
+ */
87
+ NodeCount: number;
88
+ /**
89
+ * 可用区id
90
+ */
91
+ ZoneId: number;
92
+ /**
93
+ * 名称
94
+ */
95
+ Name: string;
96
+ /**
97
+ * UDB代理服务最大连接数
98
+ */
99
+ MaxConnection: number;
100
+ /**
101
+ * 延迟阈值(单位s)
102
+ */
103
+ DelayThreshold: number;
104
+ /**
105
+ * UDB集群数据
106
+ */
107
+ UDBReplicas: {
108
+ /**
109
+ * 数据库ID
110
+ */
111
+ ID: string;
112
+ /**
113
+ * 数据库IP
114
+ */
115
+ IP: string;
116
+ /**
117
+ * 数据库服务端口
118
+ */
119
+ Port: number;
120
+ /**
121
+ * 读权重
122
+ */
123
+ ReadWeight: number;
124
+ /**
125
+ * 状态
126
+ */
127
+ State: string;
128
+ /**
129
+ * 角色[master-主库,slave-从库]
130
+ */
131
+ Role: string;
132
+ /**
133
+ * 创建时间
134
+ */
135
+ CreateTime: number;
136
+ /**
137
+ * 修改时间
138
+ */
139
+ ModifyTime: number;
140
+ /**
141
+ * 是否加入代理服务(true:加入,false:未加入)
142
+ */
143
+ JoinState: boolean;
144
+ /**
145
+ * 数据库名称
146
+ */
147
+ Name: string;
148
+ }[];
149
+ /**
150
+ * 集群实例服务节点数据
151
+ */
152
+ Nodes: {
153
+ /**
154
+ * 服务节点id
155
+ */
156
+ ID: string;
157
+ /**
158
+ * 服务节点状态
159
+ */
160
+ State: string;
161
+ }[];
162
+ /**
163
+ * sql限流数量
164
+ */
165
+ SQLLimitCount?: number;
166
+ /**
167
+ * sql路由数量
168
+ */
169
+ SQLRouterCount?: number;
170
+ /**
171
+ * 实例版本
172
+ */
173
+ InstanceVersion?: string;
174
+ /**
175
+ * 是否启用事务拆分(1:启用事务拆分,2:关闭事务拆分)
176
+ */
177
+ EnableTransSplit?: number;
178
+ /**
179
+ * 代理实例的内网域名及其开关状态,含域名地址、域名开关、域名数据源指向
180
+ */
181
+ PrivateDomainInfo?: {
182
+ /**
183
+ * 实例的内网域名地址,形如 xxx.ucloudcs.com;未开通内网域名时为空字符串
184
+ */
185
+ PrivateDomain?: string;
186
+ /**
187
+ * 内网域名是否已开启:1 已开启,2 已关闭;未开通内网域名时返回 2
188
+ */
189
+ EnablePrivateDomain?: number;
190
+ /**
191
+ * 内网域名指向的数据源:1 指向主库(可直连数据库),2 指向代理(经 UDBProxy访问);未开通时返回 2
192
+ */
193
+ EnableConnectToDB?: number;
194
+ };
195
+ }
196
+ /**
197
+ * ListUDBProxyClient - 查询代理客户端连接IP信息(实时)
198
+ */
199
+ export interface ListUDBProxyClientRequest {
200
+ /**
201
+ * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
202
+ */
203
+ Zone: string;
204
+ /**
205
+ * 代理ID
206
+ */
207
+ UDBProxyID: string;
208
+ }
209
+ /**
210
+ * ListUDBProxyClient - 查询代理客户端连接IP信息(实时)
211
+ */
212
+ export interface ListUDBProxyClientResponse {
213
+ /**
214
+ * 代理ID
215
+ */
216
+ UDBProxyID: string;
217
+ /**
218
+ * 代理节点客户端IP连接信息
219
+ */
220
+ NodeClientInfos: {
221
+ /**
222
+ * 客户端IP连接信息
223
+ */
224
+ Records?: {
225
+ /**
226
+ * 当前连接DB进程ID
227
+ */
228
+ ID?: number;
229
+ /**
230
+ * 启动这个线程的用户
231
+ */
232
+ User?: string;
233
+ /**
234
+ * 代理连接DB地址
235
+ */
236
+ Host?: string;
237
+ /**
238
+ * 当前执行的命令是在哪一个数据库上。如果没有指定数据库,则该值为 NULL
239
+ */
240
+ DB?: string;
241
+ /**
242
+ * 显示当前连接的执行的命令
243
+ */
244
+ Command?: string;
245
+ /**
246
+ * 表示该线程处于当前状态的时间
247
+ */
248
+ Time?: number;
249
+ /**
250
+ * 线程的状态,和 Command 对应
251
+ */
252
+ State?: string;
253
+ /**
254
+ * 一般记录的是线程执行的语句
255
+ */
256
+ Info?: string;
257
+ /**
258
+ * 客户端来源IP地址
259
+ */
260
+ ClientHost?: string;
261
+ /**
262
+ * 数据库资源ID
263
+ */
264
+ DBID?: string;
265
+ /**
266
+ * 数据库角色(主库/从库)
267
+ */
268
+ Role?: string;
269
+ }[];
270
+ /**
271
+ * 代理节点ID
272
+ */
273
+ ID?: string;
274
+ /**
275
+ * 代理节点IP
276
+ */
277
+ IP?: string;
278
+ }[];
279
+ }
280
+ /**
281
+ * ListUDBProxyInstanceByDB - 查询DB启用代理数据
282
+ */
283
+ export interface ListUDBProxyInstanceByDBRequest {
284
+ /**
285
+ * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
286
+ */
287
+ Zone: string;
288
+ /**
289
+ * 数据库DB资源ID
290
+ */
291
+ DBID: string;
292
+ }
293
+ /**
294
+ * ListUDBProxyInstanceByDB - 查询DB启用代理数据
295
+ */
296
+ export interface ListUDBProxyInstanceByDBResponse {
297
+ /**
298
+ * 代理列表数据
299
+ */
300
+ UDBProxyBaseItems: {
301
+ /**
302
+ * 读权重模式:1-主节点模式;2-节点均衡模式;3-从节点均衡(排除主节点);5-用户自定义模式
303
+ */
304
+ ReadWeightMode: number;
305
+ /**
306
+ * 创建时间
307
+ */
308
+ CreateTime: number;
309
+ /**
310
+ * 代理ID
311
+ */
312
+ ID?: string;
313
+ /**
314
+ * 代理IP
315
+ */
316
+ IP?: string;
317
+ /**
318
+ * 代理端口
319
+ */
320
+ Port?: number;
321
+ /**
322
+ * 状态
323
+ */
324
+ State?: string;
325
+ /**
326
+ * 可用区ID
327
+ */
328
+ ZoneID?: number;
329
+ /**
330
+ * 代理节点数
331
+ */
332
+ NodeCount?: number;
333
+ /**
334
+ * 单个代理节点CPU核数
335
+ */
336
+ CPUCores?: number;
337
+ /**
338
+ * 单个代理内存
339
+ */
340
+ Memory?: number;
341
+ /**
342
+ * 代理名称
343
+ */
344
+ Name?: string;
345
+ /**
346
+ * 实例版本
347
+ */
348
+ InstanceVersion?: string;
349
+ /**
350
+ * 加入代理DB信息
351
+ */
352
+ BaseDBDataArr?: {
353
+ /**
354
+ * 数据库ID
355
+ */
356
+ ID?: string;
357
+ /**
358
+ * 数据库名称
359
+ */
360
+ Name?: string;
361
+ /**
362
+ * 权重
363
+ */
364
+ ReadWeight?: number;
365
+ }[];
366
+ }[];
367
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const client_1 = __importDefault(require("../../core/client"));
7
+ const request_1 = __importDefault(require("../../core/request"));
8
+ /**
9
+ * This client is used to call actions of **udbproxy** service
10
+ */
11
+ class UDBProxyClient extends client_1.default {
12
+ constructor({ config, credential, }) {
13
+ super({ config, credential });
14
+ }
15
+ /**
16
+ * DescribeUDBProxy - 获取UDB代理服务详细信息
17
+ *
18
+ * See also: https://docs.ucloud.cn/api/udbproxy-api/describe_udb_proxy
19
+ */
20
+ describeUDBProxy(request) {
21
+ const args = Object.assign({ Action: 'DescribeUDBProxy' }, (request || {}));
22
+ return this.invoke(new request_1.default(args)).then((resp) => resp.toObject());
23
+ }
24
+ /**
25
+ * ListUDBProxyClient - 查询代理客户端连接IP信息(实时)
26
+ *
27
+ * See also: https://docs.ucloud.cn/api/udbproxy-api/list_udb_proxy_client
28
+ */
29
+ listUDBProxyClient(request) {
30
+ const args = Object.assign({ Action: 'ListUDBProxyClient' }, (request || {}));
31
+ return this.invoke(new request_1.default(args)).then((resp) => resp.toObject());
32
+ }
33
+ /**
34
+ * ListUDBProxyInstanceByDB - 查询DB启用代理数据
35
+ *
36
+ * See also: https://docs.ucloud.cn/api/udbproxy-api/list_udb_proxy_instance_by_db
37
+ */
38
+ listUDBProxyInstanceByDB(request) {
39
+ const args = Object.assign({ Action: 'ListUDBProxyInstanceByDB' }, (request || {}));
40
+ return this.invoke(new request_1.default(args)).then((resp) => resp.toObject());
41
+ }
42
+ }
43
+ exports.default = UDBProxyClient;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ucloud-sdks/ucloud-sdk-js",
3
3
  "description": "ucloud-sdk-js",
4
- "version": "0.2.70",
4
+ "version": "0.2.71",
5
5
  "author": "oas@ucloud.cn",
6
6
  "license": "MIT",
7
7
  "private": false,