Skip to content

Commit 566bc91

Browse files
authored
auto codegen for PathX
1 parent fe79499 commit 566bc91

File tree

3 files changed

+153
-90
lines changed

3 files changed

+153
-90
lines changed

ucloud/services/pathx/client.py

Lines changed: 97 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,23 @@ def create_global_ssh_instance(
4646
4747
**Request**
4848
49-
- **ProjectId** (str) - (Config) 项目ID,如org-xxxx。请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
50-
- **Area** (str) - (Required) 填写支持SSH访问IP的地区名称,如“洛杉矶”,“新加坡”,“香港”,“东京”,“华盛顿”,“法兰克福”。Area和AreaCode两者必填一个
49+
- **ProjectId** (str) - (Config) 项目ID,如org-xxxx。请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
50+
- **Area** (str) - (Required) 填写支持SSH访问IP的地区名称,如“洛杉矶”,“新加坡”,“香港”,“东京”,“华盛顿”,“法兰克福”,“首尔”。Area和AreaCode两者必填一个
5151
- **AreaCode** (str) - (Required) AreaCode, 区域航空港国际通用代码。Area和AreaCode两者必填一个
5252
- **Port** (int) - (Required) 源站服务器监听的SSH端口,可取范围[1-65535],不能使用80,443, 65123端口。如果InstanceType=Free,取值范围缩小为[22,3389],linux系统选择22,windows系统自动选3389。
5353
- **TargetIP** (str) - (Required) 被SSH访问的源站IP,仅支持IPv4地址。
5454
- **BandwidthPackage** (int) - Ultimate版本带宽包大小,枚举值:[0,20,40]。单位MB
55-
- **ChargeType** (str) - 支付方式,如按月、按年、按时
55+
- **ChargeType** (str) - 支付方式,如按月:Month、 按年:Year、按时:Dynamic
5656
- **CouponId** (str) - 使用代金券可冲抵部分费用
5757
- **ForwardRegion** (str) - InstanceType等于Basic时可以在["cn-bj2","cn-sh2","cn-gd"]中选择1个作为转发机房,Free版本固定为cn-bj2,其他付费版默认配置三个转发机房
58-
- **InstanceType** (str) - 枚举值:["Enterprise","Basic","Free"], 分别代表企业版,基础版,免费版
59-
- **Quantity** (int) - 购买数量
58+
- **InstanceType** (str) - 枚举值:["Ultimate","Enterprise","Basic","Primary"], 分别代表旗舰版,企业版,基础版,入门版
59+
- **Quantity** (int) - 购买数量按月购买至月底请传0
6060
- **Remark** (str) - 备注信息
6161
6262
**Response**
6363
6464
- **AcceleratingDomain** (str) - 加速域名,访问该域名可就近接入
6565
- **InstanceId** (str) - 实例ID,资源唯一标识
66-
- **Message** (str) - 提示信息
6766
6867
"""
6968
# build request
@@ -119,22 +118,27 @@ def create_uga_forwarder(
119118
120119
**Request**
121120
122-
- **ProjectId** (str) - (Config) 项目ID。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
121+
- **ProjectId** (str) - (Config) 项目ID。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
123122
- **UGAId** (str) - (Required) 加速配置实例ID
124123
- **HTTPHTTP** (list) - HTTP接入HTTP回源转发,接入端口。禁用65123端口
125124
- **HTTPHTTPRS** (list) - HTTP接入HTTP回源转发,源站监听端口
126125
- **HTTPSHTTP** (list) - HTTPS接入HTTP回源转发,接入端口。禁用65123端口
127126
- **HTTPSHTTPRS** (list) - HTTPS接入HTTP回源转发,回源端口
128127
- **HTTPSHTTPS** (list) - HTTPS接入HTTPS回源转发,接入端口。禁用65123端口
129128
- **HTTPSHTTPSRS** (list) - HTTPS接入HTTPS回源转发,源站监听端口
130-
- **TCP** (list) - TCP接入端口
129+
- **TCP** (list) - TCP接入端口,禁用65123端口
131130
- **TCPRS** (list) - TCP回源端口
132-
- **UDP** (list) - UDP接入端口
131+
- **UDP** (list) - UDP接入端口,禁用65123端口
133132
- **UDPRS** (list) - UDP回源端口
133+
- **WSSWS** (list) - WebSocketS接入WebSocket回源转发,接入端口。禁用65123。
134+
- **WSSWSRS** (list) - WebSocketS接入WebSocket回源转发,源站监听端口。
135+
- **WSSWSS** (list) - WebSocketS接入WebSocketS回源转发,接入端口。禁用65123。
136+
- **WSSWSSRS** (list) - WebSocketS接入WebSocketS回源转发,源站监听端口。
137+
- **WSWS** (list) - WebSocket接入WebSocket回源转发,接入端口。禁用65123。
138+
- **WSWSRS** (list) - WebSocket接入WebSocket回源转发,源站监听端口
134139
135140
**Response**
136141
137-
- **Message** (str) - 返回信息 说明
138142
139143
"""
140144
# build request
@@ -219,16 +223,16 @@ def create_upath(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
219223
def delete_global_ssh_instance(
220224
self, req: typing.Optional[dict] = None, **kwargs
221225
) -> dict:
222-
"""DeleteGlobalSSHInstance -
226+
"""DeleteGlobalSSHInstance - 删除GlobalSSH实例
223227
224228
**Request**
225229
226-
- **ProjectId** (str) - (Config)
227-
- **InstanceId** (str) - (Required)
230+
- **ProjectId** (str) - (Config) 项目ID,如org-xxxx。请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
231+
- **InstanceId** (str) - (Required) 实例Id,资源的唯一标识
228232
229233
**Response**
230234
231-
- **Message** (str) -
235+
- **Message** (str) - 提示信息
232236
233237
"""
234238
# build request
@@ -238,9 +242,6 @@ def delete_global_ssh_instance(
238242
req and d.update(req)
239243
d = apis.DeleteGlobalSSHInstanceRequestSchema().dumps(d)
240244

241-
# build options
242-
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
243-
244245
resp = self.invoke("DeleteGlobalSSHInstance", d, **kwargs)
245246
return apis.DeleteGlobalSSHInstanceResponseSchema().loads(resp)
246247

@@ -275,17 +276,19 @@ def delete_uga_forwarder(
275276
276277
**Request**
277278
278-
- **ProjectId** (str) - (Config) 项目ID。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
279+
- **ProjectId** (str) - (Config) 项目ID。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
279280
- **UGAId** (str) - (Required) 加速配置实例ID
280281
- **HTTPHTTP** (list) - HTTP接入HTTP回源,接入端口。禁用65123端口
281282
- **HTTPSHTTP** (list) - HTTPS接入HTTP回源, 接入端口。禁用65123端口
282283
- **HTTPSHTTPS** (list) - HTTPS接入HTTPS回源, 接入端口。禁用65123端口
283284
- **TCP** (list) - TCP接入端口
284285
- **UDP** (list) - UDP接入端口
286+
- **WSSWS** (list) - WebSocketS接入WebSocket回源, 接入端口。禁用65123端口。
287+
- **WSSWSS** (list) - WebSocketS接入WebSocketS回源, 接入端口。禁用65123端口
288+
- **WSWS** (list) - WebSocket接入WebSocket回源, 接入端口。禁用65123端口
285289
286290
**Response**
287291
288-
- **Message** (str) - 返回信息 说明
289292
290293
"""
291294
# build request
@@ -442,22 +445,22 @@ def describe_path_x_line_config(
442445
443446
**Response Model**
444447
445-
**LineDetail**
448+
**UGAALine**
449+
- **LineDetail** (list) - 见 **LineDetail** 模型定义
446450
- **LineFrom** (str) - 线路源
447451
- **LineFromName** (str) - 线路源中文名称
448452
- **LineId** (str) - 线路计费Id
449453
- **LineTo** (str) - 线路目的
450454
- **LineToName** (str) - 线路目的中文名称
455+
- **MaxBandwidth** (int) - 线路可售最大带宽
451456
452457
453-
**UGAALine**
454-
- **LineDetail** (list) - 见 **LineDetail** 模型定义
458+
**LineDetail**
455459
- **LineFrom** (str) - 线路源
456460
- **LineFromName** (str) - 线路源中文名称
457461
- **LineId** (str) - 线路计费Id
458462
- **LineTo** (str) - 线路目的
459463
- **LineToName** (str) - 线路目的中文名称
460-
- **MaxBandwidth** (int) - 线路可售最大带宽
461464
462465
463466
"""
@@ -491,11 +494,6 @@ def describe_path_xssl(
491494
492495
**Response Model**
493496
494-
**SSLBindedTargetSet**
495-
- **ResourceId** (str) - SSL证书绑定到的实例ID
496-
- **ResourceName** (str) - SSL证书绑定到的实例名称
497-
498-
499497
**PathXSSLSet**
500498
- **CreateTime** (int) - SSL证书的创建时间 时间戳
501499
- **ExpireTime** (int) - 证书过期时间 时间戳
@@ -508,6 +506,11 @@ def describe_path_xssl(
508506
- **SubjectName** (str) - 证书域名
509507
510508
509+
**SSLBindedTargetSet**
510+
- **ResourceId** (str) - SSL证书绑定到的实例ID
511+
- **ResourceName** (str) - SSL证书绑定到的实例名称
512+
513+
511514
"""
512515
# build request
513516
d = {
@@ -538,28 +541,42 @@ def describe_uga_instance(
538541
539542
**Response Model**
540543
541-
**UGAL7Forwarder**
544+
**UGAAInfo**
545+
- **CName** (str) - 加速域名,请在加速区域配置您的业务域名的CName记录值为加速域名
546+
- **Domain** (str) - 源站域名
547+
- **IPList** (list) - 源站IP列表,多个值由半角英文逗号相隔
548+
- **L4ForwarderSet** (list) - 见 **UGAL4Forwarder** 模型定义
549+
- **L7ForwarderSet** (list) - 见 **UGAL7Forwarder** 模型定义
550+
- **Location** (str) - 源站所在区域,加速实例在绑定线路后会自动设置该值。console页面上通过该值过滤加速实例可以绑定的upath实例。注意:缺少该值会导致在console上无法修改线路
551+
- **OutPublicIpList** (list) - 见 **OutPublicIpInfo** 模型定义
552+
- **TaskSet** (list) - 见 **UGAATask** 模型定义
553+
- **UGAId** (str) - 加速配置实例ID
554+
- **UGAName** (str) - 加速配置名称
555+
- **UPathSet** (list) - 见 **UPathSet** 模型定义
556+
557+
558+
**UGAL4Forwarder**
542559
- **Port** (int) - 接入端口
543560
- **Protocol** (str) - 转发协议,枚举值["TCP","UDP","HTTPHTTP","HTTPSHTTP","HTTPSHTTPS"]。TCP和UDP代表四层转发,其余为七层转发
544561
- **RSPort** (int) - RSPort,源站监听端口
545-
- **SSLId** (str) - 证书ID
546-
- **SSLName** (str) - 证书名称
547562
548563
549-
**UGAATask**
564+
**UGAL7Forwarder**
550565
- **Port** (int) - 接入端口
551566
- **Protocol** (str) - 转发协议,枚举值["TCP","UDP","HTTPHTTP","HTTPSHTTP","HTTPSHTTPS"]。TCP和UDP代表四层转发,其余为七层转发
567+
- **RSPort** (int) - RSPort,源站监听端口
568+
- **SSLId** (str) - 证书ID
569+
- **SSLName** (str) - 证书名称
552570
553571
554572
**OutPublicIpInfo**
555573
- **Area** (str) - 线路出口机房代号
556574
- **IP** (str) - 线路出口EIP
557575
558576
559-
**UGAL4Forwarder**
577+
**UGAATask**
560578
- **Port** (int) - 接入端口
561579
- **Protocol** (str) - 转发协议,枚举值["TCP","UDP","HTTPHTTP","HTTPSHTTP","HTTPSHTTPS"]。TCP和UDP代表四层转发,其余为七层转发
562-
- **RSPort** (int) - RSPort,源站监听端口
563580
564581
565582
**UPathSet**
@@ -573,20 +590,6 @@ def describe_uga_instance(
573590
- **UPathName** (str) - UPath名字
574591
575592
576-
**UGAAInfo**
577-
- **CName** (str) - 加速域名,请在加速区域配置您的业务域名的CName记录值为加速域名
578-
- **Domain** (str) - 源站域名
579-
- **IPList** (list) - 源站IP列表,多个值由半角英文逗号相隔
580-
- **L4ForwarderSet** (list) - 见 **UGAL4Forwarder** 模型定义
581-
- **L7ForwarderSet** (list) - 见 **UGAL7Forwarder** 模型定义
582-
- **Location** (str) - 源站所在区域,加速实例在绑定线路后会自动设置该值。console页面上通过该值过滤加速实例可以绑定的upath实例。注意:缺少该值会导致在console上无法修改线路
583-
- **OutPublicIpList** (list) - 见 **OutPublicIpInfo** 模型定义
584-
- **TaskSet** (list) - 见 **UGAATask** 模型定义
585-
- **UGAId** (str) - 加速配置实例ID
586-
- **UGAName** (str) - 加速配置名称
587-
- **UPathSet** (list) - 见 **UPathSet** 模型定义
588-
589-
590593
"""
591594
# build request
592595
d = {
@@ -614,17 +617,6 @@ def describe_upath(
614617
615618
**Response Model**
616619
617-
**OutPublicIpInfo**
618-
- **Area** (str) - 线路出口机房代号
619-
- **IP** (str) - 线路出口EIP
620-
621-
622-
**PathXUGAInfo**
623-
- **Domain** (str) - 源站域名
624-
- **IPList** (list) - 源站IP列表,多个值由半角英文逗号相隔
625-
- **UGAId** (str) - 加速配置ID
626-
627-
628620
**UPathInfo**
629621
- **Bandwidth** (int) - 带宽,单位Mbps
630622
- **ChargeType** (str) - 计费模式,默认为Month 按月收费,可选范围['Month','Year','Dynamic']
@@ -640,6 +632,17 @@ def describe_upath(
640632
- **UPathId** (str) - UPath加速线路实例ID
641633
642634
635+
**OutPublicIpInfo**
636+
- **Area** (str) - 线路出口机房代号
637+
- **IP** (str) - 线路出口EIP
638+
639+
640+
**PathXUGAInfo**
641+
- **Domain** (str) - 源站域名
642+
- **IPList** (list) - 源站IP列表,多个值由半角英文逗号相隔
643+
- **UGAId** (str) - 加速配置ID
644+
645+
643646
"""
644647
# build request
645648
d = {
@@ -766,18 +769,18 @@ def get_path_x_metric(
766769
767770
**Response Model**
768771
769-
**MatricPoint**
770-
- **Timestamp** (int) - 时间戳
771-
- **Value** (int) - 监控点数值
772-
773-
774772
**MetricPeriod**
775773
- **NetworkIn** (list) - 见 **MatricPoint** 模型定义
776774
- **NetworkInUsage** (list) - 见 **MatricPoint** 模型定义
777775
- **NetworkOut** (list) - 见 **MatricPoint** 模型定义
778776
- **NetworkOutUsage** (list) - 见 **MatricPoint** 模型定义
779777
780778
779+
**MatricPoint**
780+
- **Timestamp** (int) - 时间戳
781+
- **Value** (int) - 监控点数值
782+
783+
781784
"""
782785
# build request
783786
d = {
@@ -792,17 +795,17 @@ def get_path_x_metric(
792795
def modify_global_ssh_port(
793796
self, req: typing.Optional[dict] = None, **kwargs
794797
) -> dict:
795-
"""ModifyGlobalSSHPort -
798+
"""ModifyGlobalSSHPort - 修改GlobalSSH端口
796799
797800
**Request**
798801
799-
- **ProjectId** (str) - (Config)
800-
- **InstanceId** (str) - (Required)
801-
- **Port** (int) - (Required)
802+
- **ProjectId** (str) - (Config) 项目ID,如org-xxxx。请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
803+
- **InstanceId** (str) - (Required) 实例ID,资源唯一标识。当前仅收费版GlobalSSH实例可以修改端口。
804+
- **Port** (int) - (Required) 源站服务器监听的SSH端口号。收费版本端口范围[1,65535]且不能为80,443,65123端口。免费版不支持修改端口。
802805
803806
**Response**
804807
805-
- **Message** (str) -
808+
- **Message** (str) - 提示信息
806809
807810
"""
808811
# build request
@@ -812,9 +815,6 @@ def modify_global_ssh_port(
812815
req and d.update(req)
813816
d = apis.ModifyGlobalSSHPortRequestSchema().dumps(d)
814817

815-
# build options
816-
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
817-
818818
resp = self.invoke("ModifyGlobalSSHPort", d, **kwargs)
819819
return apis.ModifyGlobalSSHPortResponseSchema().loads(resp)
820820

@@ -1008,3 +1008,28 @@ def un_bind_path_xssl(
10081008

10091009
resp = self.invoke("UnBindPathXSSL", d, **kwargs)
10101010
return apis.UnBindPathXSSLResponseSchema().loads(resp)
1011+
1012+
def update_path_x_whitelist(
1013+
self, req: typing.Optional[dict] = None, **kwargs
1014+
) -> dict:
1015+
"""UpdatePathXWhitelist - 更新入口白名单,仅限GlobalSSH 实例使用。其他uga-实例不生效
1016+
1017+
**Request**
1018+
1019+
- **ProjectId** (str) - (Config) 项目ID,如org-xxxx。请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
1020+
- **InstanceId** (str) - (Required) GlobalSSH实例ID,资源唯一标识
1021+
- **Whitelist** (list) - 白名单规则,例如 "Whitelist.0": "192.168.1.1/24|tcp|22","Whitelist.1": "192.168.1.2|tcp|8080:8090",第一个参数为ip或ip段,第二个参数代表协议(tcp/udp),第三个参数代表端口号或端口范围(使用 ':' 隔开);可以添加多条规则(递增Whitelist.n字段内的n值);此接口需要列出全部规则,例如不填则为清空白名单规则,如若需要增量添加,使用InsertPathXWhitelist接口,globalssh 没有端口范围:端口设置成加速端口,协议设置成tcp:ip|tcp|加速端口
1022+
1023+
**Response**
1024+
1025+
1026+
"""
1027+
# build request
1028+
d = {
1029+
"ProjectId": self.config.project_id,
1030+
}
1031+
req and d.update(req)
1032+
d = apis.UpdatePathXWhitelistRequestSchema().dumps(d)
1033+
1034+
resp = self.invoke("UpdatePathXWhitelist", d, **kwargs)
1035+
return apis.UpdatePathXWhitelistResponseSchema().loads(resp)

0 commit comments

Comments
 (0)