ucloud-sdk-python3 0.11.81__py3-none-any.whl
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.
- ucloud/__init__.py +0 -0
- ucloud/client.py +469 -0
- ucloud/core/__init__.py +0 -0
- ucloud/core/auth/__init__.py +3 -0
- ucloud/core/auth/_cfg.py +72 -0
- ucloud/core/client/__init__.py +8 -0
- ucloud/core/client/_cfg.py +96 -0
- ucloud/core/client/_client.py +176 -0
- ucloud/core/exc/__init__.py +9 -0
- ucloud/core/exc/_exc.py +94 -0
- ucloud/core/transport/__init__.py +4 -0
- ucloud/core/transport/_requests.py +135 -0
- ucloud/core/transport/http.py +120 -0
- ucloud/core/transport/utils.py +40 -0
- ucloud/core/typesystem/__init__.py +0 -0
- ucloud/core/typesystem/abstract.py +60 -0
- ucloud/core/typesystem/encoder.py +33 -0
- ucloud/core/typesystem/fields.py +149 -0
- ucloud/core/typesystem/schema.py +97 -0
- ucloud/core/utils/__init__.py +0 -0
- ucloud/core/utils/compat.py +15 -0
- ucloud/core/utils/deco.py +31 -0
- ucloud/core/utils/log.py +29 -0
- ucloud/core/utils/middleware.py +63 -0
- ucloud/helpers/__init__.py +0 -0
- ucloud/helpers/utils.py +90 -0
- ucloud/helpers/wait.py +108 -0
- ucloud/services/__init__.py +0 -0
- ucloud/services/cube/__init__.py +0 -0
- ucloud/services/cube/client.py +618 -0
- ucloud/services/cube/schemas/__init__.py +0 -0
- ucloud/services/cube/schemas/apis.py +548 -0
- ucloud/services/cube/schemas/models.py +58 -0
- ucloud/services/iam/__init__.py +0 -0
- ucloud/services/iam/client.py +1078 -0
- ucloud/services/iam/schemas/__init__.py +0 -0
- ucloud/services/iam/schemas/apis.py +973 -0
- ucloud/services/iam/schemas/models.py +127 -0
- ucloud/services/ipsecvpn/__init__.py +0 -0
- ucloud/services/ipsecvpn/client.py +522 -0
- ucloud/services/ipsecvpn/schemas/__init__.py +0 -0
- ucloud/services/ipsecvpn/schemas/apis.py +455 -0
- ucloud/services/ipsecvpn/schemas/models.py +134 -0
- ucloud/services/ipv6gw/__init__.py +0 -0
- ucloud/services/ipv6gw/client.py +44 -0
- ucloud/services/ipv6gw/schemas/__init__.py +0 -0
- ucloud/services/ipv6gw/schemas/apis.py +34 -0
- ucloud/services/ipv6gw/schemas/models.py +3 -0
- ucloud/services/isms/__init__.py +0 -0
- ucloud/services/isms/client.py +330 -0
- ucloud/services/isms/schemas/__init__.py +0 -0
- ucloud/services/isms/schemas/apis.py +272 -0
- ucloud/services/isms/schemas/models.py +50 -0
- ucloud/services/pathx/__init__.py +0 -0
- ucloud/services/pathx/client.py +1656 -0
- ucloud/services/pathx/schemas/__init__.py +0 -0
- ucloud/services/pathx/schemas/apis.py +1289 -0
- ucloud/services/pathx/schemas/models.py +420 -0
- ucloud/services/stepflow/__init__.py +0 -0
- ucloud/services/stepflow/client.py +98 -0
- ucloud/services/stepflow/schemas/__init__.py +0 -0
- ucloud/services/stepflow/schemas/apis.py +67 -0
- ucloud/services/stepflow/schemas/models.py +37 -0
- ucloud/services/sts/__init__.py +0 -0
- ucloud/services/sts/client.py +46 -0
- ucloud/services/sts/schemas/__init__.py +0 -0
- ucloud/services/sts/schemas/apis.py +35 -0
- ucloud/services/sts/schemas/models.py +16 -0
- ucloud/services/tidb/__init__.py +0 -0
- ucloud/services/tidb/client.py +120 -0
- ucloud/services/tidb/schemas/__init__.py +0 -0
- ucloud/services/tidb/schemas/apis.py +103 -0
- ucloud/services/tidb/schemas/models.py +11 -0
- ucloud/services/uaaa/__init__.py +0 -0
- ucloud/services/uaaa/client.py +311 -0
- ucloud/services/uaaa/schemas/__init__.py +0 -0
- ucloud/services/uaaa/schemas/apis.py +252 -0
- ucloud/services/uaaa/schemas/models.py +47 -0
- ucloud/services/uaccount/__init__.py +0 -0
- ucloud/services/uaccount/client.py +547 -0
- ucloud/services/uaccount/schemas/__init__.py +0 -0
- ucloud/services/uaccount/schemas/apis.py +442 -0
- ucloud/services/uaccount/schemas/models.py +128 -0
- ucloud/services/uads/__init__.py +0 -0
- ucloud/services/uads/client.py +1148 -0
- ucloud/services/uads/schemas/__init__.py +0 -0
- ucloud/services/uads/schemas/apis.py +983 -0
- ucloud/services/uads/schemas/models.py +199 -0
- ucloud/services/ubill/__init__.py +0 -0
- ucloud/services/ubill/client.py +248 -0
- ucloud/services/ubill/schemas/__init__.py +0 -0
- ucloud/services/ubill/schemas/apis.py +183 -0
- ucloud/services/ubill/schemas/models.py +107 -0
- ucloud/services/ucdn/__init__.py +0 -0
- ucloud/services/ucdn/client.py +1964 -0
- ucloud/services/ucdn/schemas/__init__.py +0 -0
- ucloud/services/ucdn/schemas/apis.py +1395 -0
- ucloud/services/ucdn/schemas/models.py +576 -0
- ucloud/services/ucloudstack/__init__.py +0 -0
- ucloud/services/ucloudstack/client.py +3352 -0
- ucloud/services/ucloudstack/schemas/__init__.py +0 -0
- ucloud/services/ucloudstack/schemas/apis.py +2887 -0
- ucloud/services/ucloudstack/schemas/models.py +560 -0
- ucloud/services/ucompshare/__init__.py +0 -0
- ucloud/services/ucompshare/client.py +820 -0
- ucloud/services/ucompshare/schemas/__init__.py +0 -0
- ucloud/services/ucompshare/schemas/apis.py +623 -0
- ucloud/services/ucompshare/schemas/models.py +241 -0
- ucloud/services/udb/__init__.py +0 -0
- ucloud/services/udb/client.py +2463 -0
- ucloud/services/udb/schemas/__init__.py +0 -0
- ucloud/services/udb/schemas/apis.py +2053 -0
- ucloud/services/udb/schemas/models.py +319 -0
- ucloud/services/udbproxy/__init__.py +0 -0
- ucloud/services/udbproxy/client.py +67 -0
- ucloud/services/udbproxy/schemas/__init__.py +0 -0
- ucloud/services/udbproxy/schemas/apis.py +38 -0
- ucloud/services/udbproxy/schemas/models.py +31 -0
- ucloud/services/uddb/__init__.py +0 -0
- ucloud/services/uddb/client.py +456 -0
- ucloud/services/uddb/schemas/__init__.py +0 -0
- ucloud/services/uddb/schemas/apis.py +520 -0
- ucloud/services/uddb/schemas/models.py +96 -0
- ucloud/services/udi/__init__.py +0 -0
- ucloud/services/udi/client.py +250 -0
- ucloud/services/udi/schemas/__init__.py +0 -0
- ucloud/services/udi/schemas/apis.py +205 -0
- ucloud/services/udi/schemas/models.py +58 -0
- ucloud/services/udisk/__init__.py +0 -0
- ucloud/services/udisk/client.py +832 -0
- ucloud/services/udisk/schemas/__init__.py +0 -0
- ucloud/services/udisk/schemas/apis.py +741 -0
- ucloud/services/udisk/schemas/models.py +100 -0
- ucloud/services/udns/__init__.py +0 -0
- ucloud/services/udns/client.py +380 -0
- ucloud/services/udns/schemas/__init__.py +0 -0
- ucloud/services/udns/schemas/apis.py +293 -0
- ucloud/services/udns/schemas/models.py +58 -0
- ucloud/services/udpn/__init__.py +0 -0
- ucloud/services/udpn/client.py +240 -0
- ucloud/services/udpn/schemas/__init__.py +0 -0
- ucloud/services/udpn/schemas/apis.py +203 -0
- ucloud/services/udpn/schemas/models.py +29 -0
- ucloud/services/udts/__init__.py +0 -0
- ucloud/services/udts/client.py +410 -0
- ucloud/services/udts/schemas/__init__.py +0 -0
- ucloud/services/udts/schemas/apis.py +403 -0
- ucloud/services/udts/schemas/models.py +93 -0
- ucloud/services/uec/__init__.py +0 -0
- ucloud/services/uec/client.py +1510 -0
- ucloud/services/uec/schemas/__init__.py +0 -0
- ucloud/services/uec/schemas/apis.py +1195 -0
- ucloud/services/uec/schemas/models.py +316 -0
- ucloud/services/ufile/__init__.py +0 -0
- ucloud/services/ufile/client.py +698 -0
- ucloud/services/ufile/schemas/__init__.py +0 -0
- ucloud/services/ufile/schemas/apis.py +542 -0
- ucloud/services/ufile/schemas/models.py +139 -0
- ucloud/services/ufs/__init__.py +0 -0
- ucloud/services/ufs/client.py +328 -0
- ucloud/services/ufs/schemas/__init__.py +0 -0
- ucloud/services/ufs/schemas/apis.py +265 -0
- ucloud/services/ufs/schemas/models.py +52 -0
- ucloud/services/ugn/__init__.py +0 -0
- ucloud/services/ugn/client.py +857 -0
- ucloud/services/ugn/schemas/__init__.py +0 -0
- ucloud/services/ugn/schemas/apis.py +678 -0
- ucloud/services/ugn/schemas/models.py +191 -0
- ucloud/services/uhost/__init__.py +0 -0
- ucloud/services/uhost/client.py +1647 -0
- ucloud/services/uhost/schemas/__init__.py +0 -0
- ucloud/services/uhost/schemas/apis.py +1483 -0
- ucloud/services/uhost/schemas/models.py +427 -0
- ucloud/services/uhub/__init__.py +0 -0
- ucloud/services/uhub/client.py +229 -0
- ucloud/services/uhub/schemas/__init__.py +0 -0
- ucloud/services/uhub/schemas/apis.py +194 -0
- ucloud/services/uhub/schemas/models.py +39 -0
- ucloud/services/uk8s/__init__.py +0 -0
- ucloud/services/uk8s/client.py +729 -0
- ucloud/services/uk8s/schemas/__init__.py +0 -0
- ucloud/services/uk8s/schemas/apis.py +639 -0
- ucloud/services/uk8s/schemas/models.py +179 -0
- ucloud/services/ulb/__init__.py +0 -0
- ucloud/services/ulb/client.py +2285 -0
- ucloud/services/ulb/schemas/__init__.py +0 -0
- ucloud/services/ulb/schemas/apis.py +1678 -0
- ucloud/services/ulb/schemas/models.py +591 -0
- ucloud/services/ulighthost/__init__.py +0 -0
- ucloud/services/ulighthost/client.py +576 -0
- ucloud/services/ulighthost/schemas/__init__.py +0 -0
- ucloud/services/ulighthost/schemas/apis.py +445 -0
- ucloud/services/ulighthost/schemas/models.py +133 -0
- ucloud/services/umem/__init__.py +0 -0
- ucloud/services/umem/client.py +1829 -0
- ucloud/services/umem/schemas/__init__.py +0 -0
- ucloud/services/umem/schemas/apis.py +1477 -0
- ucloud/services/umem/schemas/models.py +327 -0
- ucloud/services/umongodb/__init__.py +0 -0
- ucloud/services/umongodb/client.py +752 -0
- ucloud/services/umongodb/schemas/__init__.py +0 -0
- ucloud/services/umongodb/schemas/apis.py +567 -0
- ucloud/services/umongodb/schemas/models.py +220 -0
- ucloud/services/unet/__init__.py +0 -0
- ucloud/services/unet/client.py +1278 -0
- ucloud/services/unet/schemas/__init__.py +0 -0
- ucloud/services/unet/schemas/apis.py +1006 -0
- ucloud/services/unet/schemas/models.py +275 -0
- ucloud/services/unvs/__init__.py +0 -0
- ucloud/services/unvs/client.py +87 -0
- ucloud/services/unvs/schemas/__init__.py +0 -0
- ucloud/services/unvs/schemas/apis.py +66 -0
- ucloud/services/unvs/schemas/models.py +19 -0
- ucloud/services/upfs/__init__.py +0 -0
- ucloud/services/upfs/client.py +252 -0
- ucloud/services/upfs/schemas/__init__.py +0 -0
- ucloud/services/upfs/schemas/apis.py +204 -0
- ucloud/services/upfs/schemas/models.py +36 -0
- ucloud/services/upgsql/__init__.py +0 -0
- ucloud/services/upgsql/client.py +1007 -0
- ucloud/services/upgsql/schemas/__init__.py +0 -0
- ucloud/services/upgsql/schemas/apis.py +827 -0
- ucloud/services/upgsql/schemas/models.py +158 -0
- ucloud/services/uphone/__init__.py +0 -0
- ucloud/services/uphone/client.py +2122 -0
- ucloud/services/uphone/schemas/__init__.py +0 -0
- ucloud/services/uphone/schemas/apis.py +1799 -0
- ucloud/services/uphone/schemas/models.py +357 -0
- ucloud/services/uphost/__init__.py +0 -0
- ucloud/services/uphost/client.py +847 -0
- ucloud/services/uphost/schemas/__init__.py +0 -0
- ucloud/services/uphost/schemas/apis.py +689 -0
- ucloud/services/uphost/schemas/models.py +175 -0
- ucloud/services/urocketmq/__init__.py +0 -0
- ucloud/services/urocketmq/client.py +117 -0
- ucloud/services/urocketmq/schemas/__init__.py +0 -0
- ucloud/services/urocketmq/schemas/apis.py +92 -0
- ucloud/services/urocketmq/schemas/models.py +14 -0
- ucloud/services/uslk/__init__.py +0 -0
- ucloud/services/uslk/client.py +249 -0
- ucloud/services/uslk/schemas/__init__.py +0 -0
- ucloud/services/uslk/schemas/apis.py +191 -0
- ucloud/services/uslk/schemas/models.py +74 -0
- ucloud/services/usms/__init__.py +0 -0
- ucloud/services/usms/client.py +759 -0
- ucloud/services/usms/schemas/__init__.py +0 -0
- ucloud/services/usms/schemas/apis.py +653 -0
- ucloud/services/usms/schemas/models.py +215 -0
- ucloud/services/utsdb/__init__.py +0 -0
- ucloud/services/utsdb/client.py +604 -0
- ucloud/services/utsdb/schemas/__init__.py +0 -0
- ucloud/services/utsdb/schemas/apis.py +515 -0
- ucloud/services/utsdb/schemas/models.py +61 -0
- ucloud/services/uvms/__init__.py +0 -0
- ucloud/services/uvms/client.py +119 -0
- ucloud/services/uvms/schemas/__init__.py +0 -0
- ucloud/services/uvms/schemas/apis.py +88 -0
- ucloud/services/uvms/schemas/models.py +40 -0
- ucloud/services/vpc/__init__.py +0 -0
- ucloud/services/vpc/client.py +3233 -0
- ucloud/services/vpc/schemas/__init__.py +0 -0
- ucloud/services/vpc/schemas/apis.py +2529 -0
- ucloud/services/vpc/schemas/models.py +651 -0
- ucloud/testing/__init__.py +0 -0
- ucloud/testing/driver/__init__.py +5 -0
- ucloud/testing/driver/_scenario.py +93 -0
- ucloud/testing/driver/_specification.py +57 -0
- ucloud/testing/driver/_step.py +166 -0
- ucloud/testing/env.py +28 -0
- ucloud/testing/exc.py +18 -0
- ucloud/testing/funcs.py +68 -0
- ucloud/testing/mock.py +28 -0
- ucloud/testing/op.py +177 -0
- ucloud/testing/utest.py +195 -0
- ucloud/version.py +1 -0
- ucloud_sdk_python3-0.11.81.dist-info/LICENSE +202 -0
- ucloud_sdk_python3-0.11.81.dist-info/METADATA +71 -0
- ucloud_sdk_python3-0.11.81.dist-info/RECORD +280 -0
- ucloud_sdk_python3-0.11.81.dist-info/WHEEL +5 -0
- ucloud_sdk_python3-0.11.81.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,2285 @@
|
|
|
1
|
+
""" Code is generated by ucloud-model, DO NOT EDIT IT. """
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
from ucloud.core.client import Client
|
|
7
|
+
from ucloud.services.ulb.schemas import apis
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ULBClient(Client):
|
|
11
|
+
def __init__(
|
|
12
|
+
self, config: dict, transport=None, middleware=None, logger=None
|
|
13
|
+
):
|
|
14
|
+
super(ULBClient, self).__init__(config, transport, middleware, logger)
|
|
15
|
+
|
|
16
|
+
def add_targets(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
|
|
17
|
+
"""AddTargets - 给应用型负载均衡监听器添加后端服务节点
|
|
18
|
+
|
|
19
|
+
**Request**
|
|
20
|
+
|
|
21
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
22
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
23
|
+
- **ListenerId** (str) - (Required) 监听器的ID
|
|
24
|
+
- **LoadBalancerId** (str) - (Required) 负载均衡实例的ID
|
|
25
|
+
- **Targets** (list) - 见 **AddTargetsParamTargets** 模型定义
|
|
26
|
+
|
|
27
|
+
**Response**
|
|
28
|
+
|
|
29
|
+
- **Targets** (list) - 见 **TargetSet** 模型定义
|
|
30
|
+
|
|
31
|
+
**Request Model**
|
|
32
|
+
|
|
33
|
+
**AddTargetsParamTargets**
|
|
34
|
+
- **Enabled** (bool) - 服务节点是否启用。默认值true
|
|
35
|
+
- **IsBackup** (bool) - 服务节点是否为备节点。默认值false
|
|
36
|
+
- **Port** (int) - 服务节点的端口。限定取值:[1-65535],默认值80
|
|
37
|
+
- **ResourceIP** (str) - 服务节点的IP。在IP类型时,必传
|
|
38
|
+
- **ResourceId** (str) - 服务节点的资源ID。在非IP类型时,必传
|
|
39
|
+
- **ResourceType** (str) - 服务节点的类型。限定枚举值:"UHost" / "UNI"/"UPM"/"IP",默认值:"UHost";非IP类型,如果该资源有多个IP,将只能添加主IP;非IP类型,展示时,会显示相关资源信息,IP类型只展示IP信息。在相关资源被删除时,非IP类型会把相关资源从lb中剔除,IP类型不保证这个逻辑
|
|
40
|
+
- **SubnetId** (str) - 服务节点的子网资源ID。在IP类型时,必传
|
|
41
|
+
- **VPCId** (str) - 服务节点的VPC资源ID。在IP类型时,必传
|
|
42
|
+
- **Weight** (int) - 服务节点的权重。限定取值:[1-100],默认值1;仅在加权轮询算法时有效
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
**Response Model**
|
|
46
|
+
|
|
47
|
+
**TargetSet**
|
|
48
|
+
- **Enabled** (bool) - 服务节点是否启用。 默认值:true
|
|
49
|
+
- **Id** (str) - 服务节点的标识ID。
|
|
50
|
+
- **IsBackup** (bool) - 服务节点是否为备节点。 默认值:false
|
|
51
|
+
- **Port** (int) - 服务节点的端口。限定取值:[1-65535]; 默认值:80
|
|
52
|
+
- **ResourceIP** (str) - 服务节点的IP。在IP类型时,必传
|
|
53
|
+
- **ResourceId** (str) - 服务节点的资源ID。在非IP类型时,必传
|
|
54
|
+
- **ResourceType** (str) - 服务节点的类型。限定枚举值:UHost -> 云主机,UNI -> 虚拟网卡,UPM -> 物理云主机,IP -> IP类型; 默认值:"UHost"; 非IP类型,如果该资源有多个IP,将只能添加主IP; 非IP类型,展示时,会显示相关资源信息,IP类型只展示IP信息。 在相关资源被删除时,非IP类型会把相关资源从lb中剔除,IP类型不保证这个逻辑
|
|
55
|
+
- **State** (str) - 服务节点的健康检查状态。限定枚举值:Healthy -> 健康,Unhealthy -> 不健康
|
|
56
|
+
- **SubnetId** (str) - 服务节点的子网资源ID。在IP类型时,必传
|
|
57
|
+
- **VPCId** (str) - 服务节点的VPC资源ID。在IP类型时,必传
|
|
58
|
+
- **Weight** (int) - 服务节点的权重。限定取值:[1-100]; 仅在加权轮询算法时有效; 默认值:1
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
"""
|
|
62
|
+
# build request
|
|
63
|
+
d = {
|
|
64
|
+
"ProjectId": self.config.project_id,
|
|
65
|
+
"Region": self.config.region,
|
|
66
|
+
}
|
|
67
|
+
req and d.update(req)
|
|
68
|
+
d = apis.AddTargetsRequestSchema().dumps(d)
|
|
69
|
+
|
|
70
|
+
# build options
|
|
71
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
72
|
+
|
|
73
|
+
resp = self.invoke("AddTargets", d, **kwargs)
|
|
74
|
+
return apis.AddTargetsResponseSchema().loads(resp)
|
|
75
|
+
|
|
76
|
+
def allocate_backend(
|
|
77
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
78
|
+
) -> dict:
|
|
79
|
+
"""AllocateBackend - 添加CLB后端资源实例
|
|
80
|
+
|
|
81
|
+
**Request**
|
|
82
|
+
|
|
83
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
84
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
85
|
+
- **ResourceType** (str) - (Required) 所添加的后端资源的类型,枚举值:UHost -> 云主机;UNI -> 虚拟网卡;UPM -> 物理云主机;UHybrid->混合云主机;CUBE->Cube, IP->IP类型;默认值为UHost。报文转发模式不支持UHybrid、CUBE、IP
|
|
86
|
+
- **ULBId** (str) - (Required) 传统型负载均衡实例的ID
|
|
87
|
+
- **VServerId** (str) - (Required) VServer实例的ID
|
|
88
|
+
- **Enabled** (int) - 后端实例状态开关,枚举值: 1:启用; 0:禁用 默认为启用
|
|
89
|
+
- **IsBackup** (int) - rs是否为backup,默认为00:普通rs1:backup的rs
|
|
90
|
+
- **Port** (int) - 所添加的后端资源服务端口,取值范围[1-65535],默认80
|
|
91
|
+
- **ResourceIP** (str) - 所添加的后端服务器的资源实例IP,当ResourceType 为 UHybrid 或 IP时有效,且必填;与ResourceId二选一必填
|
|
92
|
+
- **ResourceId** (str) - 所添加的后端资源的资源ID;与ResourceIP二选一必填
|
|
93
|
+
- **SubnetId** (str) - 所添加的后端服务器所在的子网,当ResourceType 为 UHybrid 或 IP 时有效,且必填
|
|
94
|
+
- **VPCId** (str) - 所添加的后端服务器所在的vpc,当ResourceType 为 UHybrid 或 IP 时有效,且必填
|
|
95
|
+
- **Weight** (int) - 所添加的后端RS权重(在加权轮询算法下有效),取值范围[1-100],默认为1
|
|
96
|
+
|
|
97
|
+
**Response**
|
|
98
|
+
|
|
99
|
+
- **BackendId** (str) - 所添加的后端资源在CLB中的对象ID,(为CLB系统中使用,与资源自身ID无关),可用于 UpdateBackendAttribute/UpdateBackendAttributeBatch/ReleaseBackend
|
|
100
|
+
|
|
101
|
+
"""
|
|
102
|
+
# build request
|
|
103
|
+
d = {
|
|
104
|
+
"ProjectId": self.config.project_id,
|
|
105
|
+
"Region": self.config.region,
|
|
106
|
+
}
|
|
107
|
+
req and d.update(req)
|
|
108
|
+
d = apis.AllocateBackendRequestSchema().dumps(d)
|
|
109
|
+
|
|
110
|
+
# build options
|
|
111
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
112
|
+
|
|
113
|
+
resp = self.invoke("AllocateBackend", d, **kwargs)
|
|
114
|
+
return apis.AllocateBackendResponseSchema().loads(resp)
|
|
115
|
+
|
|
116
|
+
def allocate_backend_batch(
|
|
117
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
118
|
+
) -> dict:
|
|
119
|
+
"""AllocateBackendBatch -
|
|
120
|
+
|
|
121
|
+
**Request**
|
|
122
|
+
|
|
123
|
+
- **ProjectId** (str) - (Config)
|
|
124
|
+
- **Region** (str) - (Config)
|
|
125
|
+
- **ULBId** (str) - (Required)
|
|
126
|
+
- **VServerId** (str) - (Required)
|
|
127
|
+
- **ApiVersion** (int) -
|
|
128
|
+
- **Backends** (list) -
|
|
129
|
+
|
|
130
|
+
**Response**
|
|
131
|
+
|
|
132
|
+
- **BackendSet** (list) - 见 **BackendSet** 模型定义
|
|
133
|
+
|
|
134
|
+
**Response Model**
|
|
135
|
+
|
|
136
|
+
**BackendSet**
|
|
137
|
+
- **BackendId** (str) -
|
|
138
|
+
- **ResourceId** (str) -
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
"""
|
|
142
|
+
# build request
|
|
143
|
+
d = {
|
|
144
|
+
"ProjectId": self.config.project_id,
|
|
145
|
+
"Region": self.config.region,
|
|
146
|
+
}
|
|
147
|
+
req and d.update(req)
|
|
148
|
+
d = apis.AllocateBackendBatchRequestSchema().dumps(d)
|
|
149
|
+
|
|
150
|
+
# build options
|
|
151
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
152
|
+
|
|
153
|
+
resp = self.invoke("AllocateBackendBatch", d, **kwargs)
|
|
154
|
+
return apis.AllocateBackendBatchResponseSchema().loads(resp)
|
|
155
|
+
|
|
156
|
+
def bind_ssl(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
|
|
157
|
+
"""BindSSL - 将SSL证书绑定到传统型负载均衡VServer
|
|
158
|
+
|
|
159
|
+
**Request**
|
|
160
|
+
|
|
161
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
162
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
163
|
+
- **SSLId** (str) - (Required) SSL证书的Id
|
|
164
|
+
- **ULBId** (str) - (Required) 所绑定CLB实例ID
|
|
165
|
+
- **VServerId** (str) - (Required) 所绑定VServer实例ID
|
|
166
|
+
|
|
167
|
+
**Response**
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
"""
|
|
171
|
+
# build request
|
|
172
|
+
d = {
|
|
173
|
+
"ProjectId": self.config.project_id,
|
|
174
|
+
"Region": self.config.region,
|
|
175
|
+
}
|
|
176
|
+
req and d.update(req)
|
|
177
|
+
d = apis.BindSSLRequestSchema().dumps(d)
|
|
178
|
+
|
|
179
|
+
resp = self.invoke("BindSSL", d, **kwargs)
|
|
180
|
+
return apis.BindSSLResponseSchema().loads(resp)
|
|
181
|
+
|
|
182
|
+
def create_listener(
|
|
183
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
184
|
+
) -> dict:
|
|
185
|
+
"""CreateListener - 创建一个应用型负载均衡的监听器
|
|
186
|
+
|
|
187
|
+
**Request**
|
|
188
|
+
|
|
189
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
190
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
191
|
+
- **LoadBalancerId** (str) - (Required) 负载均衡实例的ID
|
|
192
|
+
- **Certificates** (list) - (应用型专用)服务器默认证书ID。仅HTTPS监听支持,且必填;暂时只支持最大长度为1
|
|
193
|
+
- **CompressionEnabled** (bool) - (应用型专用)是否开启数据压缩功能。目前只支持使用gzip对特定文件类型进行压缩。默认值为:false
|
|
194
|
+
- **HTTP2Enabled** (bool) - (应用型专用)是否开启HTTP/2特性。仅HTTPS监听支持开启;默认值为:false
|
|
195
|
+
- **HealthCheckConfig** (dict) - 见 **CreateListenerParamHealthCheckConfig** 模型定义
|
|
196
|
+
- **IdleTimeout** (int) - 连接空闲超时时间。单位:秒。应用型限定取值:[1-86400];默认值60
|
|
197
|
+
- **ListenerPort** (int) - 监听器的监听端口。应用型限定取值:[1-65535],默认值80
|
|
198
|
+
- **ListenerProtocol** (str) - 监听协议。应用型限定取值:“HTTP”/"HTTPS",默认值“HTTP”
|
|
199
|
+
- **Name** (str) - 监听器的名称。限定字符长度:[1-255];限定特殊字符,仅支持:“-”,“_”,“.”;默认值:listener
|
|
200
|
+
- **RedirectEnabled** (bool) - (应用型专用)是否开启HTTP重定向到HTTPS。仅HTTP监听支持开启;默认值为:false
|
|
201
|
+
- **RedirectPort** (int) - (应用型专用)重定向端口。限定取值:[1-65535],默认值443
|
|
202
|
+
- **Remark** (str) - 监听器的备注信息。限定字符长度:[0-255]
|
|
203
|
+
- **Scheduler** (str) - 负载均衡算法。应用型限定取值:"Roundrobin"/"Source"/"WeightRoundrobin"/" Leastconn"/"Backup",默认值"Roundrobin"
|
|
204
|
+
- **SecurityPolicyId** (str) - (应用型专用)安全策略组ID。仅HTTPS监听支持绑定;默认值“Default”,表示绑定原生策略
|
|
205
|
+
- **StickinessConfig** (dict) - 见 **CreateListenerParamStickinessConfig** 模型定义
|
|
206
|
+
|
|
207
|
+
**Response**
|
|
208
|
+
|
|
209
|
+
- **ListenerId** (str) - 监听器的ID
|
|
210
|
+
|
|
211
|
+
**Request Model**
|
|
212
|
+
|
|
213
|
+
**CreateListenerParamStickinessConfig**
|
|
214
|
+
- **CookieName** (str) - (应用型专用)自定义Cookie。当StickinessType取值"UserDefined"时有效;限定字符长度:[0-255]
|
|
215
|
+
- **Enabled** (bool) - 是否开启会话保持功能。应用型负载均衡实例基于Cookie实现;默认值为:false
|
|
216
|
+
- **Type** (str) - (应用型专用)Cookie处理方式。限定枚举值:"ServerInsert" / "UserDefined";默认值为:“ServerInsert”
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
**CreateListenerParamHealthCheckConfig**
|
|
220
|
+
- **Domain** (str) - (应用型专用)HTTP检查域名
|
|
221
|
+
- **Enabled** (bool) - 是否开启健康检查功能。暂时不支持关闭。默认值为:true
|
|
222
|
+
- **Path** (str) - (应用型专用)HTTP检查路径
|
|
223
|
+
- **Type** (str) - 健康检查方式。应用型限定取值:“Port”/"HTTP",默认值:“Port”
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
"""
|
|
227
|
+
# build request
|
|
228
|
+
d = {
|
|
229
|
+
"ProjectId": self.config.project_id,
|
|
230
|
+
"Region": self.config.region,
|
|
231
|
+
}
|
|
232
|
+
req and d.update(req)
|
|
233
|
+
d = apis.CreateListenerRequestSchema().dumps(d)
|
|
234
|
+
|
|
235
|
+
# build options
|
|
236
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
237
|
+
|
|
238
|
+
resp = self.invoke("CreateListener", d, **kwargs)
|
|
239
|
+
return apis.CreateListenerResponseSchema().loads(resp)
|
|
240
|
+
|
|
241
|
+
def create_load_balancer(
|
|
242
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
243
|
+
) -> dict:
|
|
244
|
+
"""CreateLoadBalancer - 创建一个应用型负载均衡实例
|
|
245
|
+
|
|
246
|
+
**Request**
|
|
247
|
+
|
|
248
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
249
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
250
|
+
- **SubnetId** (str) - (Required) 负载均衡实例所属的子网资源ID。负载均衡实例的内网VIP和SNAT场景的源IP限定在该子网内;指定子网不影响添加后端服务节点时的范围,依旧是整个VPC下支持的资源
|
|
251
|
+
- **VPCId** (str) - (Required) 负载均衡实例所属的VPC资源ID
|
|
252
|
+
- **ChargeType** (str) - 付费模式。限定枚举值:"Year" / "Month"/"Day"/"Dynamic",默认值为:“Month”
|
|
253
|
+
- **CouponId** (str) - 代金券code
|
|
254
|
+
- **IPVersion** (str) - 负载均衡实例的IP协议。限定枚举值:"IPv4" / "IPv6"/"DualStack",默认值为:“IPv4”
|
|
255
|
+
- **Name** (str) - 负载均衡实例的名称。默认值:lb;特殊字符仅支持:“-”,“_”,“.”;限定字符长度:[1-255]
|
|
256
|
+
- **Quantity** (int) - 购买的时长, 默认: 1; 0-> 购买至月末(0只在月付费有效,其余付费模式传0,实际收费按一个周期计费)
|
|
257
|
+
- **Remark** (str) - 负载均衡实例的备注信息。限定字符长度:[0-255]
|
|
258
|
+
- **Tag** (str) - 负载均衡实例所属的业务组ID。默认值为“Default”; 传空则为Default业务组
|
|
259
|
+
- **Type** (str) - 负载均衡实例的类型。限定枚举值:"Application" / "Network",默认值:"Application"
|
|
260
|
+
|
|
261
|
+
**Response**
|
|
262
|
+
|
|
263
|
+
- **LoadBalancerId** (str) - 负载均衡实例的ID
|
|
264
|
+
|
|
265
|
+
"""
|
|
266
|
+
# build request
|
|
267
|
+
d = {
|
|
268
|
+
"ProjectId": self.config.project_id,
|
|
269
|
+
"Region": self.config.region,
|
|
270
|
+
}
|
|
271
|
+
req and d.update(req)
|
|
272
|
+
d = apis.CreateLoadBalancerRequestSchema().dumps(d)
|
|
273
|
+
|
|
274
|
+
# build options
|
|
275
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
276
|
+
|
|
277
|
+
resp = self.invoke("CreateLoadBalancer", d, **kwargs)
|
|
278
|
+
return apis.CreateLoadBalancerResponseSchema().loads(resp)
|
|
279
|
+
|
|
280
|
+
def create_policy(
|
|
281
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
282
|
+
) -> dict:
|
|
283
|
+
"""CreatePolicy - 传统型负载均衡创建VServer内容转发策略
|
|
284
|
+
|
|
285
|
+
**Request**
|
|
286
|
+
|
|
287
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
288
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
289
|
+
- **BackendId** (list) - (Required) 内容转发策略应用的传统型负载均衡后端资源实例的ID,来源于 AllocateBackend 返回的 BackendId
|
|
290
|
+
- **Match** (str) - (Required) 内容转发匹配字段
|
|
291
|
+
- **ULBId** (str) - (Required) 需要添加内容转发策略的传统型负载均衡实例ID
|
|
292
|
+
- **VServerId** (str) - (Required) 需要添加内容转发策略的传统型负载均衡VServer实例ID
|
|
293
|
+
- **DomainMatchMode** (str) - 内容转发规则中域名的匹配方式,默认与原本一致。枚举值:Regular,正则;Wildcard,泛域名
|
|
294
|
+
- **PolicyPriority** (int) - 策略优先级,1-9999;只针对路径规则生效
|
|
295
|
+
- **Type** (str) - 内容转发匹配字段的类型
|
|
296
|
+
|
|
297
|
+
**Response**
|
|
298
|
+
|
|
299
|
+
- **PolicyId** (str) - 内容转发策略ID
|
|
300
|
+
|
|
301
|
+
"""
|
|
302
|
+
# build request
|
|
303
|
+
d = {
|
|
304
|
+
"ProjectId": self.config.project_id,
|
|
305
|
+
"Region": self.config.region,
|
|
306
|
+
}
|
|
307
|
+
req and d.update(req)
|
|
308
|
+
d = apis.CreatePolicyRequestSchema().dumps(d)
|
|
309
|
+
|
|
310
|
+
# build options
|
|
311
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
312
|
+
|
|
313
|
+
resp = self.invoke("CreatePolicy", d, **kwargs)
|
|
314
|
+
return apis.CreatePolicyResponseSchema().loads(resp)
|
|
315
|
+
|
|
316
|
+
def create_rule(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
|
|
317
|
+
"""CreateRule - 给应用型负载均衡监听器创建一条转发规则
|
|
318
|
+
|
|
319
|
+
**Request**
|
|
320
|
+
|
|
321
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
322
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
323
|
+
- **ListenerId** (str) - (Required) 监听器的ID
|
|
324
|
+
- **LoadBalancerId** (str) - (Required) 负载均衡实例的ID
|
|
325
|
+
- **Pass** (bool) - 当转发的服务节点为空时,规则是否忽略。默认值true
|
|
326
|
+
- **RuleActions** (list) - 见 **CreateRuleParamRuleActions** 模型定义
|
|
327
|
+
- **RuleConditions** (list) - 见 **CreateRuleParamRuleConditions** 模型定义
|
|
328
|
+
|
|
329
|
+
**Response**
|
|
330
|
+
|
|
331
|
+
- **RuleId** (str) - 转发规则的ID
|
|
332
|
+
|
|
333
|
+
**Request Model**
|
|
334
|
+
|
|
335
|
+
**CreateRuleParamRuleActionsForwardConfigTargets**
|
|
336
|
+
- **Id** (str) - 转发的后端服务节点的标识ID。限定在监听器的服务节点池里;数组长度可以是0;转发服务节点配置的数组长度不为0时,Id必填
|
|
337
|
+
- **Weight** (int) - 转发的后端服务节点的权重。仅监听器负载均衡算法是加权轮询是有效
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
**CreateRuleParamRuleConditionsPathConfig**
|
|
341
|
+
- **Values** (list) - 取值。暂时只支持数组长度为1;取值需符合相关条件;路径匹配时必填
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
**CreateRuleParamRuleConditionsHostConfig**
|
|
345
|
+
- **MatchMode** (str) - 匹配方式。限定枚举值:"Regular"/"Wildcard",默认值:"Regular"
|
|
346
|
+
- **Values** (list) - 取值。暂时只支持数组长度为1;取值需符合相关匹配方式的条件;域名匹配时必填
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
**CreateRuleParamRuleActionsForwardConfig**
|
|
350
|
+
- **Targets** (list) - 见 **CreateRuleParamRuleActionsForwardConfigTargets** 模型定义
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
**CreateRuleParamRuleConditions**
|
|
354
|
+
- **HostConfig** (dict) - 见 **CreateRuleParamRuleConditionsHostConfig** 模型定义
|
|
355
|
+
- **PathConfig** (dict) - 见 **CreateRuleParamRuleConditionsPathConfig** 模型定义
|
|
356
|
+
- **Type** (str) - 匹配条件类型。限定枚举值:"Host"/"Path"
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
**CreateRuleParamRuleActions**
|
|
360
|
+
- **ForwardConfig** (dict) - 见 **CreateRuleParamRuleActionsForwardConfig** 模型定义
|
|
361
|
+
- **Type** (str) - 动作类型。限定枚举值:"Forward";RuleActions暂支持长度为1
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
"""
|
|
365
|
+
# build request
|
|
366
|
+
d = {
|
|
367
|
+
"ProjectId": self.config.project_id,
|
|
368
|
+
"Region": self.config.region,
|
|
369
|
+
}
|
|
370
|
+
req and d.update(req)
|
|
371
|
+
d = apis.CreateRuleRequestSchema().dumps(d)
|
|
372
|
+
|
|
373
|
+
# build options
|
|
374
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
375
|
+
|
|
376
|
+
resp = self.invoke("CreateRule", d, **kwargs)
|
|
377
|
+
return apis.CreateRuleResponseSchema().loads(resp)
|
|
378
|
+
|
|
379
|
+
def create_ssl(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
|
|
380
|
+
"""CreateSSL - 创建SSL证书,可以把整个 Pem 证书内容传过来,或者把证书、私钥、CA证书分别传过来
|
|
381
|
+
|
|
382
|
+
**Request**
|
|
383
|
+
|
|
384
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
385
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
386
|
+
- **SSLName** (str) - (Required) SSL证书的名字,默认值不为空
|
|
387
|
+
- **CaCert** (str) - CA证书
|
|
388
|
+
- **PrivateKey** (str) - 加密证书的私钥
|
|
389
|
+
- **SSLContent** (str) - SSL证书的完整内容,包括用户证书、加密证书的私钥、CA证书
|
|
390
|
+
- **SSLType** (str) - 所添加的SSL证书类型,目前只支持Pem格式
|
|
391
|
+
- **USSLId** (str) - USSL证书的ID
|
|
392
|
+
- **UserCert** (str) - 用户的证书
|
|
393
|
+
|
|
394
|
+
**Response**
|
|
395
|
+
|
|
396
|
+
- **SSLId** (str) - SSL证书的Id
|
|
397
|
+
|
|
398
|
+
"""
|
|
399
|
+
# build request
|
|
400
|
+
d = {
|
|
401
|
+
"ProjectId": self.config.project_id,
|
|
402
|
+
"Region": self.config.region,
|
|
403
|
+
}
|
|
404
|
+
req and d.update(req)
|
|
405
|
+
d = apis.CreateSSLRequestSchema().dumps(d)
|
|
406
|
+
|
|
407
|
+
# build options
|
|
408
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
409
|
+
|
|
410
|
+
resp = self.invoke("CreateSSL", d, **kwargs)
|
|
411
|
+
return apis.CreateSSLResponseSchema().loads(resp)
|
|
412
|
+
|
|
413
|
+
def create_security_policy(
|
|
414
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
415
|
+
) -> dict:
|
|
416
|
+
"""CreateSecurityPolicy - 创建安全策略
|
|
417
|
+
|
|
418
|
+
**Request**
|
|
419
|
+
|
|
420
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
421
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
422
|
+
- **SSLCiphers** (list) - (Required) 加密套件
|
|
423
|
+
- **SecurityPolicyName** (str) - (Required) 安全策略名称
|
|
424
|
+
- **TLSVersion** (str) - (Required) TLS版本
|
|
425
|
+
|
|
426
|
+
**Response**
|
|
427
|
+
|
|
428
|
+
- **SecurityPolicyId** (str) - 安全策略ID
|
|
429
|
+
|
|
430
|
+
"""
|
|
431
|
+
# build request
|
|
432
|
+
d = {
|
|
433
|
+
"ProjectId": self.config.project_id,
|
|
434
|
+
"Region": self.config.region,
|
|
435
|
+
}
|
|
436
|
+
req and d.update(req)
|
|
437
|
+
d = apis.CreateSecurityPolicyRequestSchema().dumps(d)
|
|
438
|
+
|
|
439
|
+
# build options
|
|
440
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
441
|
+
|
|
442
|
+
resp = self.invoke("CreateSecurityPolicy", d, **kwargs)
|
|
443
|
+
return apis.CreateSecurityPolicyResponseSchema().loads(resp)
|
|
444
|
+
|
|
445
|
+
def create_ulb(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
|
|
446
|
+
"""CreateULB - 创建传统型负载均衡负载均衡实例,可以选择内网或者外网
|
|
447
|
+
|
|
448
|
+
**Request**
|
|
449
|
+
|
|
450
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
451
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
452
|
+
- **BusinessId** (str) - CLB 所属的业务组ID,如果不传则使用默认的业务组
|
|
453
|
+
- **ChargeType** (str) - 付费方式, 枚举值为: Year, 按年付费; Month, 按月付费; Dynamic, 按时付费
|
|
454
|
+
- **FirewallId** (str) - 防火墙ID,如果不传,则默认不绑定防火墙
|
|
455
|
+
- **InnerMode** (str) - 创建的CLB是否为内网模式
|
|
456
|
+
- **ListenType** (str) - CLB 监听器类型,外网CLB默认RequestProxy,内网ULB默认PacketsTransmit。枚举值:RequestProxy,请求代理; PacketsTransmit ,报文转发。
|
|
457
|
+
- **OuterMode** (str) - 创建的CLB是否为外网模式,默认即为外网模式
|
|
458
|
+
- **Remark** (str) - 备注
|
|
459
|
+
- **SubnetId** (str) - CLB 所属的子网ID,如果不传则随机选择一个。
|
|
460
|
+
- **Tag** (str) - 业务组
|
|
461
|
+
- **ULBName** (str) - 负载均衡的名字,默认值为“ULB”
|
|
462
|
+
- **VPCId** (str) - CLB所在的VPC的ID。 如果不传则使用默认的VPC,若不传且无默认VPC则接口报错
|
|
463
|
+
|
|
464
|
+
**Response**
|
|
465
|
+
|
|
466
|
+
- **IPv6AddressId** (str) - IPv6地址Id
|
|
467
|
+
- **ULBId** (str) - 传统型负载均衡实例的Id
|
|
468
|
+
|
|
469
|
+
"""
|
|
470
|
+
# build request
|
|
471
|
+
d = {
|
|
472
|
+
"ProjectId": self.config.project_id,
|
|
473
|
+
"Region": self.config.region,
|
|
474
|
+
}
|
|
475
|
+
req and d.update(req)
|
|
476
|
+
d = apis.CreateULBRequestSchema().dumps(d)
|
|
477
|
+
|
|
478
|
+
# build options
|
|
479
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
480
|
+
|
|
481
|
+
resp = self.invoke("CreateULB", d, **kwargs)
|
|
482
|
+
return apis.CreateULBResponseSchema().loads(resp)
|
|
483
|
+
|
|
484
|
+
def create_vserver(
|
|
485
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
486
|
+
) -> dict:
|
|
487
|
+
"""CreateVServer - 创建CLB的VServer实例,定义监听的协议和端口以及负载均衡算法
|
|
488
|
+
|
|
489
|
+
**Request**
|
|
490
|
+
|
|
491
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
492
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
493
|
+
- **ULBId** (str) - (Required) 传统型负载均衡实例ID
|
|
494
|
+
- **ClientTimeout** (int) - ListenType为RequestProxy时表示空闲连接的回收时间,单位:秒,取值范围:时(0,86400],默认值为60;ListenType为PacketsTransmit时表示连接保持的时间,单位:秒,取值范围:[60,900],0 表示禁用连接保持
|
|
495
|
+
- **Domain** (str) - 根据MonitorType确认; 当MonitorType为Path时,此字段有意义,代表HTTP检查域名
|
|
496
|
+
- **EnableCompression** (int) - 0:关闭 1:开启,用于数据压缩功能
|
|
497
|
+
- **EnableHTTP2** (int) - 0:关闭 1:开启,用于开启http2功能;默认值为0
|
|
498
|
+
- **ForwardPort** (int) - 重定向端口,取值范围[0-65535];默认值为0,代表关闭;仅HTTP协议支持开启重定向功能
|
|
499
|
+
- **FrontendPort** (int) - VServer后端端口,取值范围[1-65535];默认值为80
|
|
500
|
+
- **ListenType** (str) - 监听器类型,枚举值,RequestProxy ,请求代理;PacketsTransmit ,报文转发。默认为RequestProxy
|
|
501
|
+
- **Method** (str) - VServer负载均衡模式,枚举值:Roundrobin -> 轮询;Source -> 源地址;ConsistentHash -> 一致性哈希;SourcePort -> 源地址(计算端口);ConsistentHashPort -> 一致性哈希(计算端口); WeightRoundrobin -> 加权轮询; Leastconn -> 最小连接数;Backup ->主备模式。ConsistentHash,SourcePort,ConsistentHashPort 只在报文转发中使用;Leastconn只在请求代理中使用;Roundrobin、Source和WeightRoundrobin,Backup在请求代理和报文转发中使用。默认为:"Roundrobin"
|
|
502
|
+
- **MonitorType** (str) - 健康检查类型,枚举值:Port -> 端口检查;Path -> 路径检查;Ping -> Ping探测;Customize -> UDP检查请求代理型默认值为Port,其中TCP协议仅支持Port,其他协议支持Port和Path;报文转发型TCP协议仅支持Port,UDP协议支持Ping、Port和Customize,默认值为Ping
|
|
503
|
+
- **Path** (str) - 根据MonitorType确认; 当MonitorType为Path时,此字段有意义,代表HTTP检查路径
|
|
504
|
+
- **PersistenceInfo** (str) - 根据PersistenceType确认; None和ServerInsert: 此字段无意义; UserDefined:此字段传入自定义会话保持String
|
|
505
|
+
- **PersistenceType** (str) - VServer会话保持方式,默认关闭会话保持。枚举值:None -> 关闭;ServerInsert -> 自动生成KEY;UserDefined -> 用户自定义KEY。
|
|
506
|
+
- **Protocol** (str) - VServer实例的协议,请求代理模式下有 HTTP、HTTPS、TCP,报文转发下有 TCP,UDP。默认为“HTTP"
|
|
507
|
+
- **RequestMsg** (str) - 根据MonitorType确认; 当MonitorType为Customize时,此字段有意义,代表UDP检查发出的请求报文
|
|
508
|
+
- **ResponseMsg** (str) - 根据MonitorType确认; 当MonitorType为Customize时,此字段有意义,代表UDP检查请求应收到的响应报文
|
|
509
|
+
- **SecurityPolicyId** (str) - 安全策略组ID,默认值'Default'
|
|
510
|
+
- **VServerName** (str) - VServer实例名称,默认为"VServer"
|
|
511
|
+
|
|
512
|
+
**Response**
|
|
513
|
+
|
|
514
|
+
- **VServerId** (str) - VServer实例的Id
|
|
515
|
+
|
|
516
|
+
"""
|
|
517
|
+
# build request
|
|
518
|
+
d = {
|
|
519
|
+
"ProjectId": self.config.project_id,
|
|
520
|
+
"Region": self.config.region,
|
|
521
|
+
}
|
|
522
|
+
req and d.update(req)
|
|
523
|
+
d = apis.CreateVServerRequestSchema().dumps(d)
|
|
524
|
+
|
|
525
|
+
# build options
|
|
526
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
527
|
+
|
|
528
|
+
resp = self.invoke("CreateVServer", d, **kwargs)
|
|
529
|
+
return apis.CreateVServerResponseSchema().loads(resp)
|
|
530
|
+
|
|
531
|
+
def delete_listener(
|
|
532
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
533
|
+
) -> dict:
|
|
534
|
+
"""DeleteListener - 删除一个应用型负载均衡监听器
|
|
535
|
+
|
|
536
|
+
**Request**
|
|
537
|
+
|
|
538
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
539
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
540
|
+
- **ListenerId** (str) - (Required) 应用型负载均衡监听器的ID
|
|
541
|
+
- **LoadBalancerId** (str) - (Required) 应用型负载均衡实例的ID
|
|
542
|
+
- **RelatedRedirectDisabled** (bool) - (Required) 是否关闭相关监听器的重定向功能。默认为false,即有其他监听器重定向到本监听器,则删除失败。为true时,会先关闭相关监听器的重定向功能,再删除本监听器。默认值为:false
|
|
543
|
+
|
|
544
|
+
**Response**
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
"""
|
|
548
|
+
# build request
|
|
549
|
+
d = {
|
|
550
|
+
"ProjectId": self.config.project_id,
|
|
551
|
+
"Region": self.config.region,
|
|
552
|
+
}
|
|
553
|
+
req and d.update(req)
|
|
554
|
+
d = apis.DeleteListenerRequestSchema().dumps(d)
|
|
555
|
+
|
|
556
|
+
resp = self.invoke("DeleteListener", d, **kwargs)
|
|
557
|
+
return apis.DeleteListenerResponseSchema().loads(resp)
|
|
558
|
+
|
|
559
|
+
def delete_load_balancer(
|
|
560
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
561
|
+
) -> dict:
|
|
562
|
+
"""DeleteLoadBalancer - 删除一个应用型负载均衡实例
|
|
563
|
+
|
|
564
|
+
**Request**
|
|
565
|
+
|
|
566
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
567
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
568
|
+
- **LoadBalancerId** (str) - (Required) 应用型负载均衡实例的ID
|
|
569
|
+
|
|
570
|
+
**Response**
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
"""
|
|
574
|
+
# build request
|
|
575
|
+
d = {
|
|
576
|
+
"ProjectId": self.config.project_id,
|
|
577
|
+
"Region": self.config.region,
|
|
578
|
+
}
|
|
579
|
+
req and d.update(req)
|
|
580
|
+
d = apis.DeleteLoadBalancerRequestSchema().dumps(d)
|
|
581
|
+
|
|
582
|
+
resp = self.invoke("DeleteLoadBalancer", d, **kwargs)
|
|
583
|
+
return apis.DeleteLoadBalancerResponseSchema().loads(resp)
|
|
584
|
+
|
|
585
|
+
def delete_policy(
|
|
586
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
587
|
+
) -> dict:
|
|
588
|
+
"""DeletePolicy - 删除传统型负载均衡的内容转发策略
|
|
589
|
+
|
|
590
|
+
**Request**
|
|
591
|
+
|
|
592
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
593
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
594
|
+
- **PolicyId** (str) - (Required) CLB的内容转发策略ID
|
|
595
|
+
- **VServerId** (str) - CLB的VServer 资源ID
|
|
596
|
+
|
|
597
|
+
**Response**
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
"""
|
|
601
|
+
# build request
|
|
602
|
+
d = {
|
|
603
|
+
"ProjectId": self.config.project_id,
|
|
604
|
+
"Region": self.config.region,
|
|
605
|
+
}
|
|
606
|
+
req and d.update(req)
|
|
607
|
+
d = apis.DeletePolicyRequestSchema().dumps(d)
|
|
608
|
+
|
|
609
|
+
resp = self.invoke("DeletePolicy", d, **kwargs)
|
|
610
|
+
return apis.DeletePolicyResponseSchema().loads(resp)
|
|
611
|
+
|
|
612
|
+
def delete_rule(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
|
|
613
|
+
"""DeleteRule - 删除应用型负载均衡监听器的一条转发规则
|
|
614
|
+
|
|
615
|
+
**Request**
|
|
616
|
+
|
|
617
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
618
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
619
|
+
- **ListenerId** (str) - (Required) 应用型负载均衡监听器的ID
|
|
620
|
+
- **LoadBalancerId** (str) - (Required) 应用型负载均衡实例的ID
|
|
621
|
+
- **RuleId** (str) - (Required) 应用型负载均衡的转发规则的ID
|
|
622
|
+
|
|
623
|
+
**Response**
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
"""
|
|
627
|
+
# build request
|
|
628
|
+
d = {
|
|
629
|
+
"ProjectId": self.config.project_id,
|
|
630
|
+
"Region": self.config.region,
|
|
631
|
+
}
|
|
632
|
+
req and d.update(req)
|
|
633
|
+
d = apis.DeleteRuleRequestSchema().dumps(d)
|
|
634
|
+
|
|
635
|
+
resp = self.invoke("DeleteRule", d, **kwargs)
|
|
636
|
+
return apis.DeleteRuleResponseSchema().loads(resp)
|
|
637
|
+
|
|
638
|
+
def delete_ssl(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
|
|
639
|
+
"""DeleteSSL - 删除SSL证书
|
|
640
|
+
|
|
641
|
+
**Request**
|
|
642
|
+
|
|
643
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
644
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
645
|
+
- **SSLId** (str) - (Required) SSL证书的ID
|
|
646
|
+
|
|
647
|
+
**Response**
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
"""
|
|
651
|
+
# build request
|
|
652
|
+
d = {
|
|
653
|
+
"ProjectId": self.config.project_id,
|
|
654
|
+
"Region": self.config.region,
|
|
655
|
+
}
|
|
656
|
+
req and d.update(req)
|
|
657
|
+
d = apis.DeleteSSLRequestSchema().dumps(d)
|
|
658
|
+
|
|
659
|
+
resp = self.invoke("DeleteSSL", d, **kwargs)
|
|
660
|
+
return apis.DeleteSSLResponseSchema().loads(resp)
|
|
661
|
+
|
|
662
|
+
def delete_security_policy(
|
|
663
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
664
|
+
) -> dict:
|
|
665
|
+
"""DeleteSecurityPolicy - 删除安全策略
|
|
666
|
+
|
|
667
|
+
**Request**
|
|
668
|
+
|
|
669
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
670
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
671
|
+
- **SecurityPolicyId** (str) - (Required) 安全策略ID
|
|
672
|
+
|
|
673
|
+
**Response**
|
|
674
|
+
|
|
675
|
+
|
|
676
|
+
"""
|
|
677
|
+
# build request
|
|
678
|
+
d = {
|
|
679
|
+
"ProjectId": self.config.project_id,
|
|
680
|
+
"Region": self.config.region,
|
|
681
|
+
}
|
|
682
|
+
req and d.update(req)
|
|
683
|
+
d = apis.DeleteSecurityPolicyRequestSchema().dumps(d)
|
|
684
|
+
|
|
685
|
+
resp = self.invoke("DeleteSecurityPolicy", d, **kwargs)
|
|
686
|
+
return apis.DeleteSecurityPolicyResponseSchema().loads(resp)
|
|
687
|
+
|
|
688
|
+
def delete_ulb(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
|
|
689
|
+
"""DeleteULB - 删除传统型负载均衡实例
|
|
690
|
+
|
|
691
|
+
**Request**
|
|
692
|
+
|
|
693
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
694
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
695
|
+
- **ULBId** (str) - (Required) 传统型负载均衡实例的ID
|
|
696
|
+
- **ReleaseEip** (bool) - 删除clb时是否释放绑定的EIP,false标识只解绑EIP,true表示会释放绑定的EIP,默认是false。Anycast IP 此参数无效
|
|
697
|
+
|
|
698
|
+
**Response**
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
"""
|
|
702
|
+
# build request
|
|
703
|
+
d = {
|
|
704
|
+
"ProjectId": self.config.project_id,
|
|
705
|
+
"Region": self.config.region,
|
|
706
|
+
}
|
|
707
|
+
req and d.update(req)
|
|
708
|
+
d = apis.DeleteULBRequestSchema().dumps(d)
|
|
709
|
+
|
|
710
|
+
resp = self.invoke("DeleteULB", d, **kwargs)
|
|
711
|
+
return apis.DeleteULBResponseSchema().loads(resp)
|
|
712
|
+
|
|
713
|
+
def delete_vserver(
|
|
714
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
715
|
+
) -> dict:
|
|
716
|
+
"""DeleteVServer - 删除CLB的VServer实例
|
|
717
|
+
|
|
718
|
+
**Request**
|
|
719
|
+
|
|
720
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
721
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
722
|
+
- **ULBId** (str) - (Required) 传统型负载均衡实例的ID
|
|
723
|
+
- **VServerId** (str) - (Required) CLB下的VServer实例的ID
|
|
724
|
+
|
|
725
|
+
**Response**
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
"""
|
|
729
|
+
# build request
|
|
730
|
+
d = {
|
|
731
|
+
"ProjectId": self.config.project_id,
|
|
732
|
+
"Region": self.config.region,
|
|
733
|
+
}
|
|
734
|
+
req and d.update(req)
|
|
735
|
+
d = apis.DeleteVServerRequestSchema().dumps(d)
|
|
736
|
+
|
|
737
|
+
resp = self.invoke("DeleteVServer", d, **kwargs)
|
|
738
|
+
return apis.DeleteVServerResponseSchema().loads(resp)
|
|
739
|
+
|
|
740
|
+
def describe_listeners(
|
|
741
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
742
|
+
) -> dict:
|
|
743
|
+
"""DescribeListeners - 描述一个指定的监听器或者一个应用型负载均衡实例下的所有监听器
|
|
744
|
+
|
|
745
|
+
**Request**
|
|
746
|
+
|
|
747
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
748
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
749
|
+
- **Limit** (int) - 数据分页值,默认为100
|
|
750
|
+
- **ListenerId** (str) - 应用型负载均衡监听器的ID。若指定ListenerId,则忽略LoadBalancerId。ListenId和LoadBalancerId必选其一
|
|
751
|
+
- **LoadBalancerId** (str) - 应用型负载均衡实例的ID。未指定ListenId,则描述指定的LoadBalancerId下的所有监听器。
|
|
752
|
+
- **Offset** (int) - 数据偏移量,默认为0
|
|
753
|
+
|
|
754
|
+
**Response**
|
|
755
|
+
|
|
756
|
+
- **Listeners** (list) - 见 **Listener** 模型定义
|
|
757
|
+
- **TotalCount** (int) - 满足条件的负载均衡监听器总数
|
|
758
|
+
|
|
759
|
+
**Response Model**
|
|
760
|
+
|
|
761
|
+
**ForwardTargetSet**
|
|
762
|
+
- **Id** (str) - 服务节点的标识ID
|
|
763
|
+
- **Weight** (int) - 权重。仅监听器负载均衡算法是加权轮询是有效;取值范围[1-100],默认值为1
|
|
764
|
+
|
|
765
|
+
|
|
766
|
+
**ForwardConfigSet**
|
|
767
|
+
- **Targets** (list) - 见 **ForwardTargetSet** 模型定义
|
|
768
|
+
|
|
769
|
+
|
|
770
|
+
**PathConfigSet**
|
|
771
|
+
- **Values** (list) - 取值。暂时只支持数组长度为1; 取值需符合相关匹配方式的条件
|
|
772
|
+
|
|
773
|
+
|
|
774
|
+
**HostConfigSet**
|
|
775
|
+
- **MatchMode** (str) - 匹配方式。限定枚举值:Regular-正则,Wildcard-泛域名; 默认值:Regular
|
|
776
|
+
- **Values** (list) - 取值。暂时只支持数组长度为1; 取值需符合相关匹配方式的条件
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
**RuleAction**
|
|
780
|
+
- **ForwardConfig** (dict) - 见 **ForwardConfigSet** 模型定义
|
|
781
|
+
- **Type** (str) - 动作类型。限定枚举值:Forward
|
|
782
|
+
|
|
783
|
+
|
|
784
|
+
**RuleCondition**
|
|
785
|
+
- **HostConfig** (dict) - 见 **HostConfigSet** 模型定义
|
|
786
|
+
- **PathConfig** (dict) - 见 **PathConfigSet** 模型定义
|
|
787
|
+
- **Type** (str) - 匹配条件类型。限定枚举值:Host,Path
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
**StickinessConfigSet**
|
|
791
|
+
- **CookieName** (str) - (应用型专用)自定义Cookie。当StickinessType取值"UserDefined"时有效
|
|
792
|
+
- **Enabled** (bool) - 是否开启会话保持功能。应用型负载均衡实例基于Cookie实现
|
|
793
|
+
- **Type** (str) - (应用型专用)Cookie处理方式。限定枚举值: ServerInsert -> 自动生成KEY;UserDefined -> 用户自定义KEY
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
**HealthCheckConfigSet**
|
|
797
|
+
- **Domain** (str) - (应用型专用)HTTP检查域名。 当Type为HTTP时,此字段有意义,代表HTTP检查域名
|
|
798
|
+
- **Enabled** (bool) - 是否开启健康检查功能。暂时不支持关闭。 默认值为:true
|
|
799
|
+
- **Path** (str) - (应用型专用)HTTP检查路径。当Type为HTTP时,此字段有意义,代表HTTP检查路径
|
|
800
|
+
- **Type** (str) - 健康检查方式。应用型限定取值: Port -> 端口检查;HTTP -> HTTP检查; 默认值:Port
|
|
801
|
+
|
|
802
|
+
|
|
803
|
+
**Rule**
|
|
804
|
+
- **IsDefault** (bool) - 是否为默认转发规则
|
|
805
|
+
- **Pass** (bool) - 当转发的服务节点为空时,规则是否忽略
|
|
806
|
+
- **RuleActions** (list) - 见 **RuleAction** 模型定义
|
|
807
|
+
- **RuleConditions** (list) - 见 **RuleCondition** 模型定义
|
|
808
|
+
- **RuleId** (str) - 转发规则的ID
|
|
809
|
+
|
|
810
|
+
|
|
811
|
+
**Target**
|
|
812
|
+
- **Enabled** (bool) - 服务节点是否启用
|
|
813
|
+
- **Id** (str) - 服务节点的标识ID。为ALB/NLB中使用,与资源自身ID无关,可用于UpdateTargetsAttribute/RemoveTargets
|
|
814
|
+
- **IsBackup** (bool) - 服务节点是否为备节点
|
|
815
|
+
- **Port** (int) - 服务节点的端口
|
|
816
|
+
- **ResourceIP** (str) - 服务节点的IP
|
|
817
|
+
- **ResourceId** (str) - 服务节点的资源ID
|
|
818
|
+
- **ResourceName** (str) - 服务节点的资源名称
|
|
819
|
+
- **ResourceType** (str) - 服务节点的类型。限定枚举值:UHost -> 云主机,UNI -> 虚拟网卡,UPM -> 物理云主机,IP -> IP类型; 默认值:"UHost"; 非IP类型,如果该资源有多个IP,将只能添加主IP; 非IP类型,展示时,会显示相关资源信息,IP类型只展示IP信息。 在相关资源被删除时,非IP类型会把相关资源从lb中剔除,IP类型不保证这个逻辑
|
|
820
|
+
- **State** (str) - 服务节点的健康检查状态。限定枚举值:Healthy -> 健康,Unhealthy -> 不健康
|
|
821
|
+
- **SubnetId** (str) - 服务节点的子网资源ID
|
|
822
|
+
- **VPCId** (str) - 服务节点的VPC资源ID
|
|
823
|
+
- **Weight** (int) - 服务节点的权重。仅在加权轮询算法时有效
|
|
824
|
+
|
|
825
|
+
|
|
826
|
+
**Certificate**
|
|
827
|
+
- **IsDefault** (bool) - 是否为默认证书
|
|
828
|
+
- **SSLId** (str) - 证书ID
|
|
829
|
+
|
|
830
|
+
|
|
831
|
+
**Listener**
|
|
832
|
+
- **Certificates** (list) - 见 **Certificate** 模型定义
|
|
833
|
+
- **CompressionEnabled** (bool) - (应用型专用)是否开启数据压缩功能。目前只支持使用gzip对特定文件类型进行压缩
|
|
834
|
+
- **HTTP2Enabled** (bool) - (应用型专用)是否开启HTTP/2特性。仅HTTPS监听支持开启
|
|
835
|
+
- **HealthCheckConfig** (dict) - 见 **HealthCheckConfigSet** 模型定义
|
|
836
|
+
- **IdleTimeout** (int) - 连接空闲超时时间。单位:秒
|
|
837
|
+
- **ListenerId** (str) - 监听器的ID
|
|
838
|
+
- **ListenerPort** (int) - 监听器的监听端口
|
|
839
|
+
- **ListenerProtocol** (str) - 监听协议。应用型限定取值: HTTP、HTTPS
|
|
840
|
+
- **Name** (str) - 监听器的名称
|
|
841
|
+
- **RedirectEnabled** (bool) - (应用型专用)是否开启HTTP重定向到HTTPS。仅HTTP监听支持开启
|
|
842
|
+
- **RedirectPort** (int) - (应用型专用)重定向端口
|
|
843
|
+
- **Remark** (str) - 监听器的备注信息
|
|
844
|
+
- **Rules** (list) - 见 **Rule** 模型定义
|
|
845
|
+
- **Scheduler** (str) - 负载均衡算法。应用型限定取值:Roundrobin -> 轮询;Source -> 源地址; WeightRoundrobin -> 加权轮询; Leastconn -> 最小连接数;Backup ->主备模式
|
|
846
|
+
- **SecurityPolicyId** (str) - (应用型专用)安全策略组ID。仅HTTPS监听支持绑定;Default -> 原生策略
|
|
847
|
+
- **State** (str) - listener健康状态。限定枚举值:Healthy -> 健康,Unhealthy -> 不健康,PartialHealth -> 部分健康,None -> 无节点状态
|
|
848
|
+
- **StickinessConfig** (dict) - 见 **StickinessConfigSet** 模型定义
|
|
849
|
+
- **Targets** (list) - 见 **Target** 模型定义
|
|
850
|
+
|
|
851
|
+
|
|
852
|
+
"""
|
|
853
|
+
# build request
|
|
854
|
+
d = {
|
|
855
|
+
"ProjectId": self.config.project_id,
|
|
856
|
+
"Region": self.config.region,
|
|
857
|
+
}
|
|
858
|
+
req and d.update(req)
|
|
859
|
+
d = apis.DescribeListenersRequestSchema().dumps(d)
|
|
860
|
+
|
|
861
|
+
resp = self.invoke("DescribeListeners", d, **kwargs)
|
|
862
|
+
return apis.DescribeListenersResponseSchema().loads(resp)
|
|
863
|
+
|
|
864
|
+
def describe_load_balancers(
|
|
865
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
866
|
+
) -> dict:
|
|
867
|
+
"""DescribeLoadBalancers - 描述特定条件下的应用型负载均衡实例或者全部的应用型负载均衡实例
|
|
868
|
+
|
|
869
|
+
**Request**
|
|
870
|
+
|
|
871
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
872
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
873
|
+
- **Limit** (str) - 数据分页值,默认为100
|
|
874
|
+
- **LoadBalancerIds** (list) - 负载均衡实例的ID。必须是同一类型的实例,若指定了实例ID,将忽略除Type外的其他过滤条件
|
|
875
|
+
- **Offset** (str) - 数据偏移量,默认为0
|
|
876
|
+
- **ShowDetail** (bool) - 是否获取监听器和后端服务节点的详细信息。默认值:false
|
|
877
|
+
- **SubnetId** (str) - 限定所在的子网
|
|
878
|
+
- **Type** (str) - 负载均衡实例的类型。限定枚举值:"Application" / "Network",默认值:"Application"
|
|
879
|
+
- **VPCId** (str) - 限定所在的VPC
|
|
880
|
+
|
|
881
|
+
**Response**
|
|
882
|
+
|
|
883
|
+
- **LoadBalancers** (list) - 见 **LoadBalancer** 模型定义
|
|
884
|
+
- **TotalCount** (int) - 满足条件的负载均衡实例总数
|
|
885
|
+
|
|
886
|
+
**Response Model**
|
|
887
|
+
|
|
888
|
+
**ForwardTargetSet**
|
|
889
|
+
- **Id** (str) - 服务节点的标识ID
|
|
890
|
+
- **Weight** (int) - 权重。仅监听器负载均衡算法是加权轮询是有效;取值范围[1-100],默认值为1
|
|
891
|
+
|
|
892
|
+
|
|
893
|
+
**ForwardConfigSet**
|
|
894
|
+
- **Targets** (list) - 见 **ForwardTargetSet** 模型定义
|
|
895
|
+
|
|
896
|
+
|
|
897
|
+
**HostConfigSet**
|
|
898
|
+
- **MatchMode** (str) - 匹配方式。限定枚举值:Regular-正则,Wildcard-泛域名; 默认值:Regular
|
|
899
|
+
- **Values** (list) - 取值。暂时只支持数组长度为1; 取值需符合相关匹配方式的条件
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
**PathConfigSet**
|
|
903
|
+
- **Values** (list) - 取值。暂时只支持数组长度为1; 取值需符合相关匹配方式的条件
|
|
904
|
+
|
|
905
|
+
|
|
906
|
+
**RuleAction**
|
|
907
|
+
- **ForwardConfig** (dict) - 见 **ForwardConfigSet** 模型定义
|
|
908
|
+
- **Type** (str) - 动作类型。限定枚举值:Forward
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
**RuleCondition**
|
|
912
|
+
- **HostConfig** (dict) - 见 **HostConfigSet** 模型定义
|
|
913
|
+
- **PathConfig** (dict) - 见 **PathConfigSet** 模型定义
|
|
914
|
+
- **Type** (str) - 匹配条件类型。限定枚举值:Host,Path
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
**StickinessConfigSet**
|
|
918
|
+
- **CookieName** (str) - (应用型专用)自定义Cookie。当StickinessType取值"UserDefined"时有效
|
|
919
|
+
- **Enabled** (bool) - 是否开启会话保持功能。应用型负载均衡实例基于Cookie实现
|
|
920
|
+
- **Type** (str) - (应用型专用)Cookie处理方式。限定枚举值: ServerInsert -> 自动生成KEY;UserDefined -> 用户自定义KEY
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
**Rule**
|
|
924
|
+
- **IsDefault** (bool) - 是否为默认转发规则
|
|
925
|
+
- **Pass** (bool) - 当转发的服务节点为空时,规则是否忽略
|
|
926
|
+
- **RuleActions** (list) - 见 **RuleAction** 模型定义
|
|
927
|
+
- **RuleConditions** (list) - 见 **RuleCondition** 模型定义
|
|
928
|
+
- **RuleId** (str) - 转发规则的ID
|
|
929
|
+
|
|
930
|
+
|
|
931
|
+
**Certificate**
|
|
932
|
+
- **IsDefault** (bool) - 是否为默认证书
|
|
933
|
+
- **SSLId** (str) - 证书ID
|
|
934
|
+
|
|
935
|
+
|
|
936
|
+
**Target**
|
|
937
|
+
- **Enabled** (bool) - 服务节点是否启用
|
|
938
|
+
- **Id** (str) - 服务节点的标识ID。为ALB/NLB中使用,与资源自身ID无关,可用于UpdateTargetsAttribute/RemoveTargets
|
|
939
|
+
- **IsBackup** (bool) - 服务节点是否为备节点
|
|
940
|
+
- **Port** (int) - 服务节点的端口
|
|
941
|
+
- **ResourceIP** (str) - 服务节点的IP
|
|
942
|
+
- **ResourceId** (str) - 服务节点的资源ID
|
|
943
|
+
- **ResourceName** (str) - 服务节点的资源名称
|
|
944
|
+
- **ResourceType** (str) - 服务节点的类型。限定枚举值:UHost -> 云主机,UNI -> 虚拟网卡,UPM -> 物理云主机,IP -> IP类型; 默认值:"UHost"; 非IP类型,如果该资源有多个IP,将只能添加主IP; 非IP类型,展示时,会显示相关资源信息,IP类型只展示IP信息。 在相关资源被删除时,非IP类型会把相关资源从lb中剔除,IP类型不保证这个逻辑
|
|
945
|
+
- **State** (str) - 服务节点的健康检查状态。限定枚举值:Healthy -> 健康,Unhealthy -> 不健康
|
|
946
|
+
- **SubnetId** (str) - 服务节点的子网资源ID
|
|
947
|
+
- **VPCId** (str) - 服务节点的VPC资源ID
|
|
948
|
+
- **Weight** (int) - 服务节点的权重。仅在加权轮询算法时有效
|
|
949
|
+
|
|
950
|
+
|
|
951
|
+
**HealthCheckConfigSet**
|
|
952
|
+
- **Domain** (str) - (应用型专用)HTTP检查域名。 当Type为HTTP时,此字段有意义,代表HTTP检查域名
|
|
953
|
+
- **Enabled** (bool) - 是否开启健康检查功能。暂时不支持关闭。 默认值为:true
|
|
954
|
+
- **Path** (str) - (应用型专用)HTTP检查路径。当Type为HTTP时,此字段有意义,代表HTTP检查路径
|
|
955
|
+
- **Type** (str) - 健康检查方式。应用型限定取值: Port -> 端口检查;HTTP -> HTTP检查; 默认值:Port
|
|
956
|
+
|
|
957
|
+
|
|
958
|
+
**Listener**
|
|
959
|
+
- **Certificates** (list) - 见 **Certificate** 模型定义
|
|
960
|
+
- **CompressionEnabled** (bool) - (应用型专用)是否开启数据压缩功能。目前只支持使用gzip对特定文件类型进行压缩
|
|
961
|
+
- **HTTP2Enabled** (bool) - (应用型专用)是否开启HTTP/2特性。仅HTTPS监听支持开启
|
|
962
|
+
- **HealthCheckConfig** (dict) - 见 **HealthCheckConfigSet** 模型定义
|
|
963
|
+
- **IdleTimeout** (int) - 连接空闲超时时间。单位:秒
|
|
964
|
+
- **ListenerId** (str) - 监听器的ID
|
|
965
|
+
- **ListenerPort** (int) - 监听器的监听端口
|
|
966
|
+
- **ListenerProtocol** (str) - 监听协议。应用型限定取值: HTTP、HTTPS
|
|
967
|
+
- **Name** (str) - 监听器的名称
|
|
968
|
+
- **RedirectEnabled** (bool) - (应用型专用)是否开启HTTP重定向到HTTPS。仅HTTP监听支持开启
|
|
969
|
+
- **RedirectPort** (int) - (应用型专用)重定向端口
|
|
970
|
+
- **Remark** (str) - 监听器的备注信息
|
|
971
|
+
- **Rules** (list) - 见 **Rule** 模型定义
|
|
972
|
+
- **Scheduler** (str) - 负载均衡算法。应用型限定取值:Roundrobin -> 轮询;Source -> 源地址; WeightRoundrobin -> 加权轮询; Leastconn -> 最小连接数;Backup ->主备模式
|
|
973
|
+
- **SecurityPolicyId** (str) - (应用型专用)安全策略组ID。仅HTTPS监听支持绑定;Default -> 原生策略
|
|
974
|
+
- **State** (str) - listener健康状态。限定枚举值:Healthy -> 健康,Unhealthy -> 不健康,PartialHealth -> 部分健康,None -> 无节点状态
|
|
975
|
+
- **StickinessConfig** (dict) - 见 **StickinessConfigSet** 模型定义
|
|
976
|
+
- **Targets** (list) - 见 **Target** 模型定义
|
|
977
|
+
|
|
978
|
+
|
|
979
|
+
**FirewallSet**
|
|
980
|
+
- **FirewallId** (str) - 防火墙ID
|
|
981
|
+
- **FirewallName** (str) - 防火墙名称
|
|
982
|
+
|
|
983
|
+
|
|
984
|
+
**IPInfo**
|
|
985
|
+
- **AddressType** (str) - 网络模式。 限定枚举值:Internet -> 互联网,Intranet -> 内联网
|
|
986
|
+
- **Bandwidth** (int) - 带宽值。单位M
|
|
987
|
+
- **BandwidthType** (int) - 带宽类型。限定枚举值:1 -> 共享带宽,0 -> 普通带宽类型
|
|
988
|
+
- **IP** (str) - IP地址
|
|
989
|
+
- **IPVersion** (str) - IP协议版本
|
|
990
|
+
- **Id** (str) - 唯一标识ID
|
|
991
|
+
- **OperatorName** (str) - 外网IP的运营商信息。枚举值为:Telecom -> 电信,Unicom -> 联通,International -> 国际IP,Bgp -> BGP,Duplet -> 双线(电信+联通双线路),BGPPro -> 精品BGP,China-mobile -> 中国移动,Anycast -> AnycastEIP
|
|
992
|
+
|
|
993
|
+
|
|
994
|
+
**AccessLogConfigSet**
|
|
995
|
+
- **Enabled** (bool) - (应用型专用)是否开启访问日志记录功能
|
|
996
|
+
- **US3BucketName** (str) - (应用型专用)用于存储访问日志的bucket
|
|
997
|
+
- **US3TokenId** (str) - (应用型专用)上传访问日志到bucket所需的token
|
|
998
|
+
|
|
999
|
+
|
|
1000
|
+
**LoadBalancer**
|
|
1001
|
+
- **AccessLogConfig** (dict) - 见 **AccessLogConfigSet** 模型定义
|
|
1002
|
+
- **AutoRenewEnabled** (bool) - 是否开启自动续费
|
|
1003
|
+
- **ChargeType** (str) - 付费模式
|
|
1004
|
+
- **CreateTime** (int) - 负载均衡实例创建时间。格式为Unix Timestamp
|
|
1005
|
+
- **Firewall** (dict) - 见 **FirewallSet** 模型定义
|
|
1006
|
+
- **IPInfos** (list) - 见 **IPInfo** 模型定义
|
|
1007
|
+
- **IPVersion** (str) - 负载均衡实例支持的IP协议版本
|
|
1008
|
+
- **Listeners** (list) - 见 **Listener** 模型定义
|
|
1009
|
+
- **LoadBalancerId** (str) - 负载均衡实例的ID
|
|
1010
|
+
- **Name** (str) - 负载均衡实例的名称
|
|
1011
|
+
- **PurchaseValue** (int) - 有效期(计费)。格式为Unix Timestamp
|
|
1012
|
+
- **Remark** (str) - 负载均衡实例的备注信息
|
|
1013
|
+
- **SnatIPs** (list) - 应用型实例的代理IP或网络型FULLNAT模式下snat所用的IP
|
|
1014
|
+
- **Status** (str) - lb状态:Normal-正常;Arrears-欠费停服
|
|
1015
|
+
- **SubnetId** (str) - 负载均衡实例所属的子网资源ID。负载均衡实例的内网VIP和SNAT场景的源IP限定在该子网内;指定子网不影响添加后端服务节点时的范围,依旧是整个VPC下支持的资源
|
|
1016
|
+
- **Tag** (str) - 负载均衡实例所属的业务组ID
|
|
1017
|
+
- **Type** (str) - 负载均衡实例的类型。限定枚举值:Application -> 应用型,Network -> 网络型
|
|
1018
|
+
- **VPCId** (str) - 负载均衡实例所属的VPC资源ID
|
|
1019
|
+
|
|
1020
|
+
|
|
1021
|
+
"""
|
|
1022
|
+
# build request
|
|
1023
|
+
d = {
|
|
1024
|
+
"ProjectId": self.config.project_id,
|
|
1025
|
+
"Region": self.config.region,
|
|
1026
|
+
}
|
|
1027
|
+
req and d.update(req)
|
|
1028
|
+
d = apis.DescribeLoadBalancersRequestSchema().dumps(d)
|
|
1029
|
+
|
|
1030
|
+
resp = self.invoke("DescribeLoadBalancers", d, **kwargs)
|
|
1031
|
+
return apis.DescribeLoadBalancersResponseSchema().loads(resp)
|
|
1032
|
+
|
|
1033
|
+
def describe_rules(
|
|
1034
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1035
|
+
) -> dict:
|
|
1036
|
+
"""DescribeRules - 描述一条指定的转发规则或者一个应用型负载均衡监听器下的所有转发规则
|
|
1037
|
+
|
|
1038
|
+
**Request**
|
|
1039
|
+
|
|
1040
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1041
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1042
|
+
- **ListenerId** (str) - (Required) 监听器的ID
|
|
1043
|
+
- **LoadBalancerId** (str) - (Required) 应用型负载均衡实例的ID
|
|
1044
|
+
- **RuleId** (str) - 应用型负载均衡转发规则的ID。指定RuleId,则只描述该规则
|
|
1045
|
+
|
|
1046
|
+
**Response**
|
|
1047
|
+
|
|
1048
|
+
- **Rules** (list) - 见 **Rule** 模型定义
|
|
1049
|
+
|
|
1050
|
+
**Response Model**
|
|
1051
|
+
|
|
1052
|
+
**ForwardTargetSet**
|
|
1053
|
+
- **Id** (str) - 服务节点的标识ID
|
|
1054
|
+
- **Weight** (int) - 权重。仅监听器负载均衡算法是加权轮询是有效;取值范围[1-100],默认值为1
|
|
1055
|
+
|
|
1056
|
+
|
|
1057
|
+
**ForwardConfigSet**
|
|
1058
|
+
- **Targets** (list) - 见 **ForwardTargetSet** 模型定义
|
|
1059
|
+
|
|
1060
|
+
|
|
1061
|
+
**PathConfigSet**
|
|
1062
|
+
- **Values** (list) - 取值。暂时只支持数组长度为1; 取值需符合相关匹配方式的条件
|
|
1063
|
+
|
|
1064
|
+
|
|
1065
|
+
**HostConfigSet**
|
|
1066
|
+
- **MatchMode** (str) - 匹配方式。限定枚举值:Regular-正则,Wildcard-泛域名; 默认值:Regular
|
|
1067
|
+
- **Values** (list) - 取值。暂时只支持数组长度为1; 取值需符合相关匹配方式的条件
|
|
1068
|
+
|
|
1069
|
+
|
|
1070
|
+
**RuleAction**
|
|
1071
|
+
- **ForwardConfig** (dict) - 见 **ForwardConfigSet** 模型定义
|
|
1072
|
+
- **Type** (str) - 动作类型。限定枚举值:Forward
|
|
1073
|
+
|
|
1074
|
+
|
|
1075
|
+
**RuleCondition**
|
|
1076
|
+
- **HostConfig** (dict) - 见 **HostConfigSet** 模型定义
|
|
1077
|
+
- **PathConfig** (dict) - 见 **PathConfigSet** 模型定义
|
|
1078
|
+
- **Type** (str) - 匹配条件类型。限定枚举值:Host,Path
|
|
1079
|
+
|
|
1080
|
+
|
|
1081
|
+
**Rule**
|
|
1082
|
+
- **IsDefault** (bool) - 是否为默认转发规则
|
|
1083
|
+
- **Pass** (bool) - 当转发的服务节点为空时,规则是否忽略
|
|
1084
|
+
- **RuleActions** (list) - 见 **RuleAction** 模型定义
|
|
1085
|
+
- **RuleConditions** (list) - 见 **RuleCondition** 模型定义
|
|
1086
|
+
- **RuleId** (str) - 转发规则的ID
|
|
1087
|
+
|
|
1088
|
+
|
|
1089
|
+
"""
|
|
1090
|
+
# build request
|
|
1091
|
+
d = {
|
|
1092
|
+
"ProjectId": self.config.project_id,
|
|
1093
|
+
"Region": self.config.region,
|
|
1094
|
+
}
|
|
1095
|
+
req and d.update(req)
|
|
1096
|
+
d = apis.DescribeRulesRequestSchema().dumps(d)
|
|
1097
|
+
|
|
1098
|
+
resp = self.invoke("DescribeRules", d, **kwargs)
|
|
1099
|
+
return apis.DescribeRulesResponseSchema().loads(resp)
|
|
1100
|
+
|
|
1101
|
+
def describe_ssl(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
|
|
1102
|
+
"""DescribeSSL - 获取SSL证书信息,仅能获取SSL证书与传统型负载均衡监听器的绑定关系
|
|
1103
|
+
|
|
1104
|
+
**Request**
|
|
1105
|
+
|
|
1106
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1107
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1108
|
+
- **Limit** (int) - 数据分页值,默认为20
|
|
1109
|
+
- **Offset** (int) - 数据偏移量,默认值为0
|
|
1110
|
+
- **SSLId** (str) - SSL证书的Id
|
|
1111
|
+
|
|
1112
|
+
**Response**
|
|
1113
|
+
|
|
1114
|
+
- **DataSet** (list) - 见 **ULBSSLSet** 模型定义
|
|
1115
|
+
- **TotalCount** (int) - 满足条件的SSL证书总数
|
|
1116
|
+
|
|
1117
|
+
**Response Model**
|
|
1118
|
+
|
|
1119
|
+
**ULBSSLSet**
|
|
1120
|
+
- **BindedTargetSet** (list) - 见 **SSLBindedTargetSet** 模型定义
|
|
1121
|
+
- **CreateTime** (int) - SSL证书的创建时间
|
|
1122
|
+
- **Domains** (str) - USSL证书平台的域名,只有当SSLSource为1时才出现
|
|
1123
|
+
- **HashValue** (str) - SSL证书的HASH值
|
|
1124
|
+
- **NotAfter** (int) - 证书过期时间,只有当SSLSource为1时才出现
|
|
1125
|
+
- **NotBefore** (int) - 证书颁发时间,只有当SSLSource为1时才出现
|
|
1126
|
+
- **SSLContent** (str) - SSL证书的内容
|
|
1127
|
+
- **SSLId** (str) - SSL证书的Id
|
|
1128
|
+
- **SSLName** (str) - SSL证书的名字
|
|
1129
|
+
- **SSLSource** (int) - SSL证书来源,SSL证书来源,0代表证书来自于ULB平台,1代表证书来自于USSL平台
|
|
1130
|
+
- **SSLType** (str) - SSL证书类型,暂时只有 Pem 一种类型
|
|
1131
|
+
- **USSLId** (str) - USSL证书平台的编号,只有当SSLSource为1时才出现
|
|
1132
|
+
|
|
1133
|
+
|
|
1134
|
+
**SSLBindedTargetSet**
|
|
1135
|
+
- **ULBId** (str) - VServer 所属的ULB实例的资源ID
|
|
1136
|
+
- **ULBName** (str) - ULB实例的名称
|
|
1137
|
+
- **VServerId** (str) - SSL证书绑定到的VServer的资源ID
|
|
1138
|
+
- **VServerName** (str) - 对应的VServer的名字
|
|
1139
|
+
|
|
1140
|
+
|
|
1141
|
+
"""
|
|
1142
|
+
# build request
|
|
1143
|
+
d = {
|
|
1144
|
+
"ProjectId": self.config.project_id,
|
|
1145
|
+
"Region": self.config.region,
|
|
1146
|
+
}
|
|
1147
|
+
req and d.update(req)
|
|
1148
|
+
d = apis.DescribeSSLRequestSchema().dumps(d)
|
|
1149
|
+
|
|
1150
|
+
resp = self.invoke("DescribeSSL", d, **kwargs)
|
|
1151
|
+
return apis.DescribeSSLResponseSchema().loads(resp)
|
|
1152
|
+
|
|
1153
|
+
def describe_sslv_22(
|
|
1154
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1155
|
+
) -> dict:
|
|
1156
|
+
"""DescribeSSLV2 - 获取SSL证书信息,该接口可以同时获取SSL与传统型和应用型负载均衡监听器的绑定关系
|
|
1157
|
+
|
|
1158
|
+
**Request**
|
|
1159
|
+
|
|
1160
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1161
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1162
|
+
- **Limit** (int) - 数据分页值,默认为20
|
|
1163
|
+
- **Offset** (int) - 数据偏移量,默认值为0
|
|
1164
|
+
- **SSLId** (str) - SSL证书的Id
|
|
1165
|
+
|
|
1166
|
+
**Response**
|
|
1167
|
+
|
|
1168
|
+
- **DataSet** (list) - 见 **SSLInfo** 模型定义
|
|
1169
|
+
- **TotalCount** (int) - 满足条件的SSL证书总数
|
|
1170
|
+
|
|
1171
|
+
**Response Model**
|
|
1172
|
+
|
|
1173
|
+
**SSLRelation**
|
|
1174
|
+
- **IsDefault** (bool) - 是否为监听器默认SSL证书
|
|
1175
|
+
- **ListenerId** (str) - 监听器的ID
|
|
1176
|
+
- **ListenerName** (str) - 监听器的名称
|
|
1177
|
+
- **LoadBalancerId** (str) - 负载均衡实例的ID
|
|
1178
|
+
- **LoadBalancerName** (str) - 负载均衡实例的名称
|
|
1179
|
+
|
|
1180
|
+
|
|
1181
|
+
**SSLInfo**
|
|
1182
|
+
- **CreateTime** (int) - SSL证书的创建时间
|
|
1183
|
+
- **Domains** (str) - USSL证书平台的域名,只有当SSLSource为1时才出现
|
|
1184
|
+
- **HashValue** (str) - SSL证书的HASH值
|
|
1185
|
+
- **NotAfter** (int) - 证书过期时间,只有当SSLSource为1时才出现
|
|
1186
|
+
- **NotBefore** (int) - 证书颁发时间,只有当SSLSource为1时才出现
|
|
1187
|
+
- **Relations** (list) - 见 **SSLRelation** 模型定义
|
|
1188
|
+
- **SSLContent** (str) - SSL证书的内容
|
|
1189
|
+
- **SSLId** (str) - SSL证书的Id
|
|
1190
|
+
- **SSLName** (str) - SSL证书的名字
|
|
1191
|
+
- **SSLSource** (int) - SSL证书来源,SSL证书来源,0代表证书来自于ULB平台,1代表证书来自于USSL平台
|
|
1192
|
+
- **SSLType** (str) - SSL证书类型,暂时只有 Pem 一种类型
|
|
1193
|
+
- **USSLId** (str) - USSL证书平台的编号,只有当SSLSource为1时才出现
|
|
1194
|
+
|
|
1195
|
+
|
|
1196
|
+
"""
|
|
1197
|
+
# build request
|
|
1198
|
+
d = {
|
|
1199
|
+
"ProjectId": self.config.project_id,
|
|
1200
|
+
"Region": self.config.region,
|
|
1201
|
+
}
|
|
1202
|
+
req and d.update(req)
|
|
1203
|
+
d = apis.DescribeSSLV2RequestSchema().dumps(d)
|
|
1204
|
+
|
|
1205
|
+
resp = self.invoke("DescribeSSLV2", d, **kwargs)
|
|
1206
|
+
return apis.DescribeSSLV2ResponseSchema().loads(resp)
|
|
1207
|
+
|
|
1208
|
+
def describe_security_policies(
|
|
1209
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1210
|
+
) -> dict:
|
|
1211
|
+
"""DescribeSecurityPolicies - 获取安全策略的信息,绑定关系仅能获取安全策略与传统型负载均衡监听器的绑定关系
|
|
1212
|
+
|
|
1213
|
+
**Request**
|
|
1214
|
+
|
|
1215
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1216
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1217
|
+
- **Limit** (int) - 数据分页值
|
|
1218
|
+
- **Offset** (int) - 数据偏移量
|
|
1219
|
+
- **SecurityPolicyId** (str) - 安全策略ID
|
|
1220
|
+
|
|
1221
|
+
**Response**
|
|
1222
|
+
|
|
1223
|
+
- **DataSet** (list) - 见 **SecurityPolicy** 模型定义
|
|
1224
|
+
- **TotalCount** (int) - 满足条件的安全策略总数
|
|
1225
|
+
|
|
1226
|
+
**Response Model**
|
|
1227
|
+
|
|
1228
|
+
**SecurityPolicy**
|
|
1229
|
+
- **SSLCiphers** (list) - 加密套件
|
|
1230
|
+
- **SecurityPolicyId** (str) - 安全策略ID
|
|
1231
|
+
- **SecurityPolicyName** (str) - 安全策略名称
|
|
1232
|
+
- **SecurityPolicyType** (int) - 安全策略类型 0:预定义 1:自定义
|
|
1233
|
+
- **TLSVersion** (str) - TLS最低版本
|
|
1234
|
+
- **VServerSet** (list) - 见 **BindVServerInfo** 模型定义
|
|
1235
|
+
|
|
1236
|
+
|
|
1237
|
+
**BindVServerInfo**
|
|
1238
|
+
- **Port** (int) - VServer端口
|
|
1239
|
+
- **ULBId** (str) - ULB的ID
|
|
1240
|
+
- **VServerId** (str) - 绑定的VServerId
|
|
1241
|
+
- **VServerName** (str) - 绑定的VServer名称
|
|
1242
|
+
|
|
1243
|
+
|
|
1244
|
+
"""
|
|
1245
|
+
# build request
|
|
1246
|
+
d = {
|
|
1247
|
+
"ProjectId": self.config.project_id,
|
|
1248
|
+
"Region": self.config.region,
|
|
1249
|
+
}
|
|
1250
|
+
req and d.update(req)
|
|
1251
|
+
d = apis.DescribeSecurityPoliciesRequestSchema().dumps(d)
|
|
1252
|
+
|
|
1253
|
+
resp = self.invoke("DescribeSecurityPolicies", d, **kwargs)
|
|
1254
|
+
return apis.DescribeSecurityPoliciesResponseSchema().loads(resp)
|
|
1255
|
+
|
|
1256
|
+
def describe_security_policies_v2(
|
|
1257
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1258
|
+
) -> dict:
|
|
1259
|
+
"""DescribeSecurityPoliciesV2 - 获取安全策略的信息,可以同时获取安全策略与传统型和应用性负载均衡监听器的绑定关系
|
|
1260
|
+
|
|
1261
|
+
**Request**
|
|
1262
|
+
|
|
1263
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1264
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1265
|
+
- **Limit** (int) - 数据分页值
|
|
1266
|
+
- **Offset** (int) - 数据偏移量
|
|
1267
|
+
- **SecurityPolicyId** (str) - 安全策略ID
|
|
1268
|
+
|
|
1269
|
+
**Response**
|
|
1270
|
+
|
|
1271
|
+
- **DataSet** (list) - 见 **SecurityPolicyInfo** 模型定义
|
|
1272
|
+
- **TotalCount** (int) - 满足条件的安全策略总数
|
|
1273
|
+
|
|
1274
|
+
**Response Model**
|
|
1275
|
+
|
|
1276
|
+
**SecurityPolicyRelation**
|
|
1277
|
+
- **ListenerId** (str) - 监听器的ID
|
|
1278
|
+
- **ListenerName** (str) - 监听器的名称
|
|
1279
|
+
- **ListenerPort** (int) - 监听端口
|
|
1280
|
+
- **LoadBalancerId** (str) - 负载均衡实例的ID
|
|
1281
|
+
|
|
1282
|
+
|
|
1283
|
+
**SecurityPolicyInfo**
|
|
1284
|
+
- **Relations** (list) - 见 **SecurityPolicyRelation** 模型定义
|
|
1285
|
+
- **SSLCiphers** (list) - 加密套件
|
|
1286
|
+
- **SecurityPolicyId** (str) - 安全策略ID
|
|
1287
|
+
- **SecurityPolicyName** (str) - 安全策略名称
|
|
1288
|
+
- **SecurityPolicyType** (int) - 安全策略类型 0:预定义 1:自定义
|
|
1289
|
+
- **TLSVersion** (str) - TLS最低版本
|
|
1290
|
+
|
|
1291
|
+
|
|
1292
|
+
"""
|
|
1293
|
+
# build request
|
|
1294
|
+
d = {
|
|
1295
|
+
"ProjectId": self.config.project_id,
|
|
1296
|
+
"Region": self.config.region,
|
|
1297
|
+
}
|
|
1298
|
+
req and d.update(req)
|
|
1299
|
+
d = apis.DescribeSecurityPoliciesV2RequestSchema().dumps(d)
|
|
1300
|
+
|
|
1301
|
+
resp = self.invoke("DescribeSecurityPoliciesV2", d, **kwargs)
|
|
1302
|
+
return apis.DescribeSecurityPoliciesV2ResponseSchema().loads(resp)
|
|
1303
|
+
|
|
1304
|
+
def describe_support_ciphers(
|
|
1305
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1306
|
+
) -> dict:
|
|
1307
|
+
"""DescribeSupportCiphers - 返回安全策略所有支持的加密套件
|
|
1308
|
+
|
|
1309
|
+
**Request**
|
|
1310
|
+
|
|
1311
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1312
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1313
|
+
|
|
1314
|
+
**Response**
|
|
1315
|
+
|
|
1316
|
+
- **DataSet** (list) - 见 **TLSAndCiphers** 模型定义
|
|
1317
|
+
|
|
1318
|
+
**Response Model**
|
|
1319
|
+
|
|
1320
|
+
**TLSAndCiphers**
|
|
1321
|
+
- **SSLCiphers** (list) - 加密套件
|
|
1322
|
+
- **TLSVersion** (str) - TLS最低版本
|
|
1323
|
+
|
|
1324
|
+
|
|
1325
|
+
"""
|
|
1326
|
+
# build request
|
|
1327
|
+
d = {
|
|
1328
|
+
"ProjectId": self.config.project_id,
|
|
1329
|
+
"Region": self.config.region,
|
|
1330
|
+
}
|
|
1331
|
+
req and d.update(req)
|
|
1332
|
+
d = apis.DescribeSupportCiphersRequestSchema().dumps(d)
|
|
1333
|
+
|
|
1334
|
+
resp = self.invoke("DescribeSupportCiphers", d, **kwargs)
|
|
1335
|
+
return apis.DescribeSupportCiphersResponseSchema().loads(resp)
|
|
1336
|
+
|
|
1337
|
+
def describe_ulb(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
|
|
1338
|
+
"""DescribeULB - 获取CLB详细信息
|
|
1339
|
+
|
|
1340
|
+
**Request**
|
|
1341
|
+
|
|
1342
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1343
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1344
|
+
- **BusinessId** (str) - CLB所属的业务组ID
|
|
1345
|
+
- **Limit** (int) - 数据分页值,默认为20
|
|
1346
|
+
- **Offset** (int) - 数据偏移量,默认为0
|
|
1347
|
+
- **SubnetId** (str) - CLB所属的子网ID
|
|
1348
|
+
- **ULBId** (str) - 传统型负载均衡实例的Id。 若指定则返回指定的传统型负载均衡实例的信息; 若不指定则返回当前数据中心中所有的传统型负载均衡实例的信息
|
|
1349
|
+
- **VPCId** (str) - CLB所属的VPC
|
|
1350
|
+
|
|
1351
|
+
**Response**
|
|
1352
|
+
|
|
1353
|
+
- **DataSet** (list) - 见 **ULBSet** 模型定义
|
|
1354
|
+
- **TotalCount** (int) - 满足条件的CLB总数
|
|
1355
|
+
|
|
1356
|
+
**Response Model**
|
|
1357
|
+
|
|
1358
|
+
**ULBSet**
|
|
1359
|
+
- **Bandwidth** (int) - 带宽
|
|
1360
|
+
- **BandwidthType** (int) - 带宽类型,枚举值为: 0,非共享带宽; 1,共享带宽
|
|
1361
|
+
- **BusinessId** (str) - ULB 所属的业务组ID
|
|
1362
|
+
- **CreateTime** (int) - ULB的创建时间,格式为Unix Timestamp
|
|
1363
|
+
- **EnableLog** (int) - ULB是否开启日志功能。0,关闭;1,开启
|
|
1364
|
+
- **FirewallSet** (list) - 见 **FirewallSet** 模型定义
|
|
1365
|
+
- **IPSet** (list) - 见 **ULBIPSet** 模型定义
|
|
1366
|
+
- **IPVersion** (str) - ULB ip类型,枚举值:IPv6 / IPv4 (内部测试,暂未对外开放)
|
|
1367
|
+
- **ListenType** (str) - ULB 监听器类型,枚举值:RequestProxy,请求代理; PacketsTransmit ,报文转发;Comprehensive,兼容型;Pending,未定型
|
|
1368
|
+
- **LogSet** (dict) - 见 **LoggerSet** 模型定义
|
|
1369
|
+
- **Name** (str) - 负载均衡的资源名称
|
|
1370
|
+
- **PrivateIP** (str) - ULB的内网IP,当ULBType为OuterMode时,该值为空
|
|
1371
|
+
- **Remark** (str) - 负载均衡的备注
|
|
1372
|
+
- **SnatIps** (list) - ULB后向代理IP,仅当有代理IP时返回否
|
|
1373
|
+
- **SubnetId** (str) - ULB 为 InnerMode 时,ULB 所属的子网ID,默认为空
|
|
1374
|
+
- **Tag** (str) - 负载均衡的业务组名称
|
|
1375
|
+
- **ULBId** (str) - 负载均衡的资源ID
|
|
1376
|
+
- **ULBType** (str) - ULB 的类型
|
|
1377
|
+
- **VPCId** (str) - ULB所在的VPC的ID
|
|
1378
|
+
- **VServerSet** (list) - 见 **ULBVServerSet** 模型定义
|
|
1379
|
+
|
|
1380
|
+
|
|
1381
|
+
**FirewallSet**
|
|
1382
|
+
- **FirewallId** (str) - 防火墙ID
|
|
1383
|
+
- **FirewallName** (str) - 防火墙名称
|
|
1384
|
+
|
|
1385
|
+
|
|
1386
|
+
**ULBIPSet**
|
|
1387
|
+
- **Bandwidth** (int) - 弹性IP的带宽值(暂未对外开放)
|
|
1388
|
+
- **BandwidthType** (int) - 弹性IP的带宽类型,枚举值:1 表示是共享带宽,0 普通带宽类型(暂未对外开放)
|
|
1389
|
+
- **EIP** (str) - 弹性IP地址
|
|
1390
|
+
- **EIPId** (str) - 弹性IP的ID
|
|
1391
|
+
- **OperatorName** (str) - 弹性IP的运营商信息,枚举值为: Bgp:BGP IP International:国际IP
|
|
1392
|
+
|
|
1393
|
+
|
|
1394
|
+
**LoggerSet**
|
|
1395
|
+
- **BucketName** (str) - ulb日志上传的bucket
|
|
1396
|
+
- **TokenID** (str) - 上传到bucket使用的token的tokenid
|
|
1397
|
+
- **TokenName** (str) - bucket的token名称
|
|
1398
|
+
|
|
1399
|
+
|
|
1400
|
+
**ULBVServerSet**
|
|
1401
|
+
- **BackendSet** (list) - 见 **ULBBackendSet** 模型定义
|
|
1402
|
+
- **ClientTimeout** (int) - 空闲连接的回收时间,单位:秒。
|
|
1403
|
+
- **Domain** (str) - 根据MonitorType确认; 当MonitorType为Port时,此字段无意义。当MonitorType为Path时,代表HTTP检查域名
|
|
1404
|
+
- **EnableCompression** (int) - 数据压缩开关,0:关闭 1:开启
|
|
1405
|
+
- **EnableHTTP2** (int) - 0:关闭 1:开启,用于开启http2功能;默认值为0
|
|
1406
|
+
- **ForwardPort** (int) - 重定向端口,取值范围[0-65535];默认值为0,代表关闭;仅HTTP协议支持开启重定向功能
|
|
1407
|
+
- **FrontendPort** (int) - VServer服务端口
|
|
1408
|
+
- **ListenType** (str) - 监听器类型,枚举值为: RequestProxy -> 请求代理;PacketsTransmit -> 报文转发
|
|
1409
|
+
- **Method** (str) - VServer负载均衡的模式,枚举值:Roundrobin -> 轮询;Source -> 源地址;ConsistentHash -> 一致性哈希;SourcePort -> 源地址(计算端口);ConsistentHashPort -> 一致性哈希(计算端口)。
|
|
1410
|
+
- **MonitorType** (str) - 健康检查类型,枚举值:Port -> 端口检查;Path -> 路径检查;Ping -> Ping探测, Customize -> UDP检查请求代理型默认值为Port,其中TCP协议仅支持Port,其他协议支持Port和Path; 报文转发型TCP协议仅支持Port,UDP协议支持Ping、Port和Customize
|
|
1411
|
+
- **Path** (str) - 根据MonitorType确认; 当MonitorType为Port时,此字段无意义。当MonitorType为Path时,代表HTTP检查路径
|
|
1412
|
+
- **PersistenceInfo** (str) - 根据PersistenceType确定: None或ServerInsert,此字段为空; UserDefined,此字段展示用户自定义会话string。
|
|
1413
|
+
- **PersistenceType** (str) - VServer会话保持方式。枚举值为: None -> 关闭会话保持; ServerInsert -> 自动生成; UserDefined -> 用户自定义。
|
|
1414
|
+
- **PolicySet** (list) - 见 **ULBPolicySet** 模型定义
|
|
1415
|
+
- **Protocol** (str) - VServer实例的协议。 枚举值为:HTTP,TCP,UDP,HTTPS。
|
|
1416
|
+
- **RequestMsg** (str) - 根据MonitorType确认; 当MonitorType为Customize时,此字段有意义,代表UDP检查发出的请求报文
|
|
1417
|
+
- **ResponseMsg** (str) - 根据MonitorType确认; 当MonitorType为Customize时,此字段有意义,代表UDP检查请求应收到的响应报文
|
|
1418
|
+
- **SSLSet** (list) - 见 **ULBSSLSet** 模型定义
|
|
1419
|
+
- **SecurityPolicy** (dict) - 见 **BindSecurityPolicy** 模型定义
|
|
1420
|
+
- **Status** (int) - VServer的运行状态。枚举值: 0 -> rs全部运行正常;1 -> rs全部运行异常;2 -> rs部分运行异常。
|
|
1421
|
+
- **ULBId** (str) - 负载均衡实例的Id
|
|
1422
|
+
- **VServerId** (str) - VServer实例的Id
|
|
1423
|
+
- **VServerName** (str) - VServer实例的名字
|
|
1424
|
+
|
|
1425
|
+
|
|
1426
|
+
**ULBBackendSet**
|
|
1427
|
+
- **BackendId** (str) - 后端资源实例的Id
|
|
1428
|
+
- **Enabled** (int) - 后端提供服务的实例启用与否,枚举值:0 禁用 1 启用
|
|
1429
|
+
- **IsBackup** (int) - 是否为backup,只有当vserver的Backup属性为1时才会有此字段,说明:0:主rs1:备rs
|
|
1430
|
+
- **Port** (int) - 后端提供服务的端口
|
|
1431
|
+
- **PrivateIP** (str) - 后端提供服务的内网IP
|
|
1432
|
+
- **ResourceId** (str) - 资源实例的资源Id
|
|
1433
|
+
- **ResourceName** (str) - 资源实例的资源名称
|
|
1434
|
+
- **ResourceType** (str) - 资源实例的类型
|
|
1435
|
+
- **Status** (int) - 后端提供服务的实例运行状态,枚举值:0健康检查健康状态 1 健康检查异常
|
|
1436
|
+
- **SubResourceId** (str) - 资源绑定的虚拟网卡实例的资源Id
|
|
1437
|
+
- **SubResourceName** (str) - 资源绑定的虚拟网卡实例的资源名称
|
|
1438
|
+
- **SubResourceType** (str) - 资源绑定的虚拟网卡实例的类型
|
|
1439
|
+
- **SubnetId** (str) - 后端提供服务的资源所在的子网的ID
|
|
1440
|
+
- **VPCId** (str) - 后端服务器所在的VPC
|
|
1441
|
+
- **Weight** (int) - 后端RS权重(在加权轮询算法下有效)
|
|
1442
|
+
|
|
1443
|
+
|
|
1444
|
+
**ULBPolicySet**
|
|
1445
|
+
- **BackendSet** (list) - 见 **PolicyBackendSet** 模型定义
|
|
1446
|
+
- **DomainMatchMode** (str) - 内容转发规则中域名的匹配方式。枚举值:Regular,正则;Wildcard,泛域名
|
|
1447
|
+
- **Match** (str) - 内容转发匹配字段;默认内容转发类型下为空。
|
|
1448
|
+
- **PolicyId** (str) - 内容转发Id,默认内容转发类型下为空。
|
|
1449
|
+
- **PolicyPriority** (int) - 内容转发优先级,范围[1,9999],数字越大优先级越高。默认内容转发规则下为0。
|
|
1450
|
+
- **PolicyType** (str) - 内容类型,枚举值:Custom -> 客户自定义;Default -> 默认内容转发
|
|
1451
|
+
- **TotalCount** (int) - 默认内容转发类型下返回当前rs总数
|
|
1452
|
+
- **Type** (str) - 内容转发匹配字段的类型,枚举值:Domain -> 域名;Path -> 路径; 默认内容转发类型下为空
|
|
1453
|
+
- **VServerId** (str) - 所属VServerId
|
|
1454
|
+
|
|
1455
|
+
|
|
1456
|
+
**PolicyBackendSet**
|
|
1457
|
+
- **BackendId** (str) - 所添加的后端资源在ULB中的对象ID,(为ULB系统中使用,与资源自身ID无关
|
|
1458
|
+
- **ObjectId** (str) - 后端资源的对象ID
|
|
1459
|
+
- **Port** (int) - 所添加的后端资源服务端口
|
|
1460
|
+
- **PrivateIP** (str) - 后端资源的内网IP
|
|
1461
|
+
- **ResourceName** (str) - 后端资源的实例名称
|
|
1462
|
+
- **ResourceType** (str) - 所添加的后端资源的类型,枚举值:UHost -> 云主机;UPM -> 物理云主机; UDHost -> 私有专区主机;UDocker -> 容器;UHybrid->混合云主机;CUBE->Cube;UNI -> 虚拟网卡
|
|
1463
|
+
- **SubResourceId** (str) - 如果资源绑定了弹性网卡,则展示弹性网卡的资源ID
|
|
1464
|
+
- **SubResourceName** (str) - 如果资源绑定了弹性网卡,则展示弹性网卡的资源名称
|
|
1465
|
+
- **SubResourceType** (str) - "UNI"或者为空
|
|
1466
|
+
|
|
1467
|
+
|
|
1468
|
+
**ULBSSLSet**
|
|
1469
|
+
- **BindedTargetSet** (list) - 见 **SSLBindedTargetSet** 模型定义
|
|
1470
|
+
- **CreateTime** (int) - SSL证书的创建时间
|
|
1471
|
+
- **Domains** (str) - USSL证书平台的域名,只有当SSLSource为1时才出现
|
|
1472
|
+
- **HashValue** (str) - SSL证书的HASH值
|
|
1473
|
+
- **NotAfter** (int) - 证书过期时间,只有当SSLSource为1时才出现
|
|
1474
|
+
- **NotBefore** (int) - 证书颁发时间,只有当SSLSource为1时才出现
|
|
1475
|
+
- **SSLContent** (str) - SSL证书的内容
|
|
1476
|
+
- **SSLId** (str) - SSL证书的Id
|
|
1477
|
+
- **SSLName** (str) - SSL证书的名字
|
|
1478
|
+
- **SSLSource** (int) - SSL证书来源,SSL证书来源,0代表证书来自于ULB平台,1代表证书来自于USSL平台
|
|
1479
|
+
- **SSLType** (str) - SSL证书类型,暂时只有 Pem 一种类型
|
|
1480
|
+
- **USSLId** (str) - USSL证书平台的编号,只有当SSLSource为1时才出现
|
|
1481
|
+
|
|
1482
|
+
|
|
1483
|
+
**SSLBindedTargetSet**
|
|
1484
|
+
- **ULBId** (str) - VServer 所属的ULB实例的资源ID
|
|
1485
|
+
- **ULBName** (str) - ULB实例的名称
|
|
1486
|
+
- **VServerId** (str) - SSL证书绑定到的VServer的资源ID
|
|
1487
|
+
- **VServerName** (str) - 对应的VServer的名字
|
|
1488
|
+
|
|
1489
|
+
|
|
1490
|
+
**BindSecurityPolicy**
|
|
1491
|
+
- **SSLCiphers** (list) - 加密套件
|
|
1492
|
+
- **SecurityPolicyId** (str) - 安全策略组ID
|
|
1493
|
+
- **SecurityPolicyName** (str) - 安全策略组名称
|
|
1494
|
+
- **SecurityPolicyType** (int) - 安全策略类型 0:预定义 1:自定义
|
|
1495
|
+
- **TLSVersion** (str) - TLS最低版本
|
|
1496
|
+
|
|
1497
|
+
|
|
1498
|
+
"""
|
|
1499
|
+
# build request
|
|
1500
|
+
d = {
|
|
1501
|
+
"ProjectId": self.config.project_id,
|
|
1502
|
+
"Region": self.config.region,
|
|
1503
|
+
}
|
|
1504
|
+
req and d.update(req)
|
|
1505
|
+
d = apis.DescribeULBRequestSchema().dumps(d)
|
|
1506
|
+
|
|
1507
|
+
resp = self.invoke("DescribeULB", d, **kwargs)
|
|
1508
|
+
return apis.DescribeULBResponseSchema().loads(resp)
|
|
1509
|
+
|
|
1510
|
+
def describe_ulb_simple(
|
|
1511
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1512
|
+
) -> dict:
|
|
1513
|
+
"""DescribeULBSimple - 获取CLB信息
|
|
1514
|
+
|
|
1515
|
+
**Request**
|
|
1516
|
+
|
|
1517
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1518
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1519
|
+
- **BusinessId** (str) - CLB所属的业务组ID
|
|
1520
|
+
- **Limit** (int) - 数据分页值,默认为10000
|
|
1521
|
+
- **Offset** (int) - 数据偏移量,默认为0
|
|
1522
|
+
- **SubnetId** (str) - CLB所属的子网ID
|
|
1523
|
+
- **ULBId** (str) - 传统型负载均衡实例的Id。 若指定则返回指定的传统型负载均衡实例的信息; 若不指定则返回当前数据中心中所有的传统型负载均衡实例的信息
|
|
1524
|
+
- **VPCId** (str) - CLB所属的VPC
|
|
1525
|
+
|
|
1526
|
+
**Response**
|
|
1527
|
+
|
|
1528
|
+
- **DataSet** (list) - 见 **ULBSimpleSet** 模型定义
|
|
1529
|
+
- **TotalCount** (int) - 满足条件的CLB总数
|
|
1530
|
+
|
|
1531
|
+
**Response Model**
|
|
1532
|
+
|
|
1533
|
+
**ULBSimpleSet**
|
|
1534
|
+
- **Bandwidth** (int) - 带宽
|
|
1535
|
+
- **BandwidthType** (int) - 带宽类型,枚举值为: 0,非共享带宽; 1,共享带宽
|
|
1536
|
+
- **BusinessId** (str) - ULB 所属的业务组ID
|
|
1537
|
+
- **CreateTime** (int) - ULB的创建时间,格式为Unix Timestamp
|
|
1538
|
+
- **EnableLog** (int) - ULB是否开启日志功能。0,关闭;1,开启
|
|
1539
|
+
- **FirewallSet** (list) - 见 **FirewallSet** 模型定义
|
|
1540
|
+
- **IPSet** (list) - 见 **ULBIPSet** 模型定义
|
|
1541
|
+
- **IPVersion** (str) - ULB提供服务的IP类型。枚举值,“IPv4”,"IPv6"。默认为“IPv4”
|
|
1542
|
+
- **ListenType** (str) - ULB 监听器类型,枚举值:RequestProxy,请求代理; PacketsTransmit ,报文转发;Comprehensive,兼容型;Pending,未定型
|
|
1543
|
+
- **LogSet** (dict) - 见 **LoggerSet** 模型定义
|
|
1544
|
+
- **Name** (str) - 负载均衡的资源名称
|
|
1545
|
+
- **PrivateIP** (str) - ULB的内网IP,当ULBType为OuterMode时,该值为空
|
|
1546
|
+
- **Remark** (str) - 负载均衡的备注
|
|
1547
|
+
- **SnatIps** (list) - ULB后向代理IP,仅当有代理IP时返回否
|
|
1548
|
+
- **SubnetId** (str) - ULB 为 InnerMode 时,ULB 所属的子网ID
|
|
1549
|
+
- **Tag** (str) - 负载均衡的业务组名称
|
|
1550
|
+
- **ULBId** (str) - 负载均衡的资源ID
|
|
1551
|
+
- **ULBType** (str) - ULB 的类型(InnerMode or OuterMode)
|
|
1552
|
+
- **VPCId** (str) - ULB所在的VPC的ID
|
|
1553
|
+
- **VServerCount** (int) - ulb下vserver数量
|
|
1554
|
+
- **WAFMode** (str) - WAF功能状态,枚举类型:Unavailable:无法创建WAF;NoWAF:未绑定WAF;Intranet:内网回源Waf;Extranet:外网回源Waf
|
|
1555
|
+
|
|
1556
|
+
|
|
1557
|
+
**FirewallSet**
|
|
1558
|
+
- **FirewallId** (str) - 防火墙ID
|
|
1559
|
+
- **FirewallName** (str) - 防火墙名称
|
|
1560
|
+
|
|
1561
|
+
|
|
1562
|
+
**ULBIPSet**
|
|
1563
|
+
- **Bandwidth** (int) - 弹性IP的带宽值(暂未对外开放)
|
|
1564
|
+
- **BandwidthType** (int) - 弹性IP的带宽类型,枚举值:1 表示是共享带宽,0 普通带宽类型(暂未对外开放)
|
|
1565
|
+
- **EIP** (str) - 弹性IP地址
|
|
1566
|
+
- **EIPId** (str) - 弹性IP的ID
|
|
1567
|
+
- **OperatorName** (str) - 弹性IP的运营商信息,枚举值为: Bgp:BGP IP International:国际IP
|
|
1568
|
+
|
|
1569
|
+
|
|
1570
|
+
**LoggerSet**
|
|
1571
|
+
- **BucketName** (str) - ulb日志上传的bucket
|
|
1572
|
+
- **TokenID** (str) - 上传到bucket使用的token的tokenid
|
|
1573
|
+
- **TokenName** (str) - bucket的token名称
|
|
1574
|
+
|
|
1575
|
+
|
|
1576
|
+
"""
|
|
1577
|
+
# build request
|
|
1578
|
+
d = {
|
|
1579
|
+
"ProjectId": self.config.project_id,
|
|
1580
|
+
"Region": self.config.region,
|
|
1581
|
+
}
|
|
1582
|
+
req and d.update(req)
|
|
1583
|
+
d = apis.DescribeULBSimpleRequestSchema().dumps(d)
|
|
1584
|
+
|
|
1585
|
+
resp = self.invoke("DescribeULBSimple", d, **kwargs)
|
|
1586
|
+
return apis.DescribeULBSimpleResponseSchema().loads(resp)
|
|
1587
|
+
|
|
1588
|
+
def describe_vserver(
|
|
1589
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1590
|
+
) -> dict:
|
|
1591
|
+
"""DescribeVServer - 获取CLB下的VServer的详细信息
|
|
1592
|
+
|
|
1593
|
+
**Request**
|
|
1594
|
+
|
|
1595
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1596
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1597
|
+
- **Limit** (int) - 数据分页值
|
|
1598
|
+
- **Offset** (int) - 数据偏移量
|
|
1599
|
+
- **ULBId** (str) - 传统型负载均衡实例的Id
|
|
1600
|
+
- **VServerId** (str) - CLB下的VServer实例的Id;若指定则返回指定的VServer实例的信息; 若不指定则返回当前传统型负载均衡实例下所有VServer的信息
|
|
1601
|
+
|
|
1602
|
+
**Response**
|
|
1603
|
+
|
|
1604
|
+
- **DataSet** (list) - 见 **ULBVServerSet** 模型定义
|
|
1605
|
+
- **TotalCount** (int) - 满足条件的VServer总数
|
|
1606
|
+
|
|
1607
|
+
**Response Model**
|
|
1608
|
+
|
|
1609
|
+
**ULBVServerSet**
|
|
1610
|
+
- **BackendSet** (list) - 见 **ULBBackendSet** 模型定义
|
|
1611
|
+
- **ClientTimeout** (int) - 空闲连接的回收时间,单位:秒。
|
|
1612
|
+
- **Domain** (str) - 根据MonitorType确认; 当MonitorType为Port时,此字段无意义。当MonitorType为Path时,代表HTTP检查域名
|
|
1613
|
+
- **EnableCompression** (int) - 数据压缩开关,0:关闭 1:开启
|
|
1614
|
+
- **EnableHTTP2** (int) - 0:关闭 1:开启,用于开启http2功能;默认值为0
|
|
1615
|
+
- **ForwardPort** (int) - 重定向端口,取值范围[0-65535];默认值为0,代表关闭;仅HTTP协议支持开启重定向功能
|
|
1616
|
+
- **FrontendPort** (int) - VServer服务端口
|
|
1617
|
+
- **ListenType** (str) - 监听器类型,枚举值为: RequestProxy -> 请求代理;PacketsTransmit -> 报文转发
|
|
1618
|
+
- **Method** (str) - VServer负载均衡的模式,枚举值:Roundrobin -> 轮询;Source -> 源地址;ConsistentHash -> 一致性哈希;SourcePort -> 源地址(计算端口);ConsistentHashPort -> 一致性哈希(计算端口)。
|
|
1619
|
+
- **MonitorType** (str) - 健康检查类型,枚举值:Port -> 端口检查;Path -> 路径检查;Ping -> Ping探测, Customize -> UDP检查请求代理型默认值为Port,其中TCP协议仅支持Port,其他协议支持Port和Path; 报文转发型TCP协议仅支持Port,UDP协议支持Ping、Port和Customize
|
|
1620
|
+
- **Path** (str) - 根据MonitorType确认; 当MonitorType为Port时,此字段无意义。当MonitorType为Path时,代表HTTP检查路径
|
|
1621
|
+
- **PersistenceInfo** (str) - 根据PersistenceType确定: None或ServerInsert,此字段为空; UserDefined,此字段展示用户自定义会话string。
|
|
1622
|
+
- **PersistenceType** (str) - VServer会话保持方式。枚举值为: None -> 关闭会话保持; ServerInsert -> 自动生成; UserDefined -> 用户自定义。
|
|
1623
|
+
- **PolicySet** (list) - 见 **ULBPolicySet** 模型定义
|
|
1624
|
+
- **Protocol** (str) - VServer实例的协议。 枚举值为:HTTP,TCP,UDP,HTTPS。
|
|
1625
|
+
- **RequestMsg** (str) - 根据MonitorType确认; 当MonitorType为Customize时,此字段有意义,代表UDP检查发出的请求报文
|
|
1626
|
+
- **ResponseMsg** (str) - 根据MonitorType确认; 当MonitorType为Customize时,此字段有意义,代表UDP检查请求应收到的响应报文
|
|
1627
|
+
- **SSLSet** (list) - 见 **ULBSSLSet** 模型定义
|
|
1628
|
+
- **SecurityPolicy** (dict) - 见 **BindSecurityPolicy** 模型定义
|
|
1629
|
+
- **Status** (int) - VServer的运行状态。枚举值: 0 -> rs全部运行正常;1 -> rs全部运行异常;2 -> rs部分运行异常。
|
|
1630
|
+
- **ULBId** (str) - 负载均衡实例的Id
|
|
1631
|
+
- **VServerId** (str) - VServer实例的Id
|
|
1632
|
+
- **VServerName** (str) - VServer实例的名字
|
|
1633
|
+
|
|
1634
|
+
|
|
1635
|
+
**ULBBackendSet**
|
|
1636
|
+
- **BackendId** (str) - 后端资源实例的Id
|
|
1637
|
+
- **Enabled** (int) - 后端提供服务的实例启用与否,枚举值:0 禁用 1 启用
|
|
1638
|
+
- **IsBackup** (int) - 是否为backup,只有当vserver的Backup属性为1时才会有此字段,说明:0:主rs1:备rs
|
|
1639
|
+
- **Port** (int) - 后端提供服务的端口
|
|
1640
|
+
- **PrivateIP** (str) - 后端提供服务的内网IP
|
|
1641
|
+
- **ResourceId** (str) - 资源实例的资源Id
|
|
1642
|
+
- **ResourceName** (str) - 资源实例的资源名称
|
|
1643
|
+
- **ResourceType** (str) - 资源实例的类型
|
|
1644
|
+
- **Status** (int) - 后端提供服务的实例运行状态,枚举值:0健康检查健康状态 1 健康检查异常
|
|
1645
|
+
- **SubResourceId** (str) - 资源绑定的虚拟网卡实例的资源Id
|
|
1646
|
+
- **SubResourceName** (str) - 资源绑定的虚拟网卡实例的资源名称
|
|
1647
|
+
- **SubResourceType** (str) - 资源绑定的虚拟网卡实例的类型
|
|
1648
|
+
- **SubnetId** (str) - 后端提供服务的资源所在的子网的ID
|
|
1649
|
+
- **VPCId** (str) - 后端服务器所在的VPC
|
|
1650
|
+
- **Weight** (int) - 后端RS权重(在加权轮询算法下有效)
|
|
1651
|
+
|
|
1652
|
+
|
|
1653
|
+
**ULBPolicySet**
|
|
1654
|
+
- **BackendSet** (list) - 见 **PolicyBackendSet** 模型定义
|
|
1655
|
+
- **DomainMatchMode** (str) - 内容转发规则中域名的匹配方式。枚举值:Regular,正则;Wildcard,泛域名
|
|
1656
|
+
- **Match** (str) - 内容转发匹配字段;默认内容转发类型下为空。
|
|
1657
|
+
- **PolicyId** (str) - 内容转发Id,默认内容转发类型下为空。
|
|
1658
|
+
- **PolicyPriority** (int) - 内容转发优先级,范围[1,9999],数字越大优先级越高。默认内容转发规则下为0。
|
|
1659
|
+
- **PolicyType** (str) - 内容类型,枚举值:Custom -> 客户自定义;Default -> 默认内容转发
|
|
1660
|
+
- **TotalCount** (int) - 默认内容转发类型下返回当前rs总数
|
|
1661
|
+
- **Type** (str) - 内容转发匹配字段的类型,枚举值:Domain -> 域名;Path -> 路径; 默认内容转发类型下为空
|
|
1662
|
+
- **VServerId** (str) - 所属VServerId
|
|
1663
|
+
|
|
1664
|
+
|
|
1665
|
+
**PolicyBackendSet**
|
|
1666
|
+
- **BackendId** (str) - 所添加的后端资源在ULB中的对象ID,(为ULB系统中使用,与资源自身ID无关
|
|
1667
|
+
- **ObjectId** (str) - 后端资源的对象ID
|
|
1668
|
+
- **Port** (int) - 所添加的后端资源服务端口
|
|
1669
|
+
- **PrivateIP** (str) - 后端资源的内网IP
|
|
1670
|
+
- **ResourceName** (str) - 后端资源的实例名称
|
|
1671
|
+
- **ResourceType** (str) - 所添加的后端资源的类型,枚举值:UHost -> 云主机;UPM -> 物理云主机; UDHost -> 私有专区主机;UDocker -> 容器;UHybrid->混合云主机;CUBE->Cube;UNI -> 虚拟网卡
|
|
1672
|
+
- **SubResourceId** (str) - 如果资源绑定了弹性网卡,则展示弹性网卡的资源ID
|
|
1673
|
+
- **SubResourceName** (str) - 如果资源绑定了弹性网卡,则展示弹性网卡的资源名称
|
|
1674
|
+
- **SubResourceType** (str) - "UNI"或者为空
|
|
1675
|
+
|
|
1676
|
+
|
|
1677
|
+
**ULBSSLSet**
|
|
1678
|
+
- **BindedTargetSet** (list) - 见 **SSLBindedTargetSet** 模型定义
|
|
1679
|
+
- **CreateTime** (int) - SSL证书的创建时间
|
|
1680
|
+
- **Domains** (str) - USSL证书平台的域名,只有当SSLSource为1时才出现
|
|
1681
|
+
- **HashValue** (str) - SSL证书的HASH值
|
|
1682
|
+
- **NotAfter** (int) - 证书过期时间,只有当SSLSource为1时才出现
|
|
1683
|
+
- **NotBefore** (int) - 证书颁发时间,只有当SSLSource为1时才出现
|
|
1684
|
+
- **SSLContent** (str) - SSL证书的内容
|
|
1685
|
+
- **SSLId** (str) - SSL证书的Id
|
|
1686
|
+
- **SSLName** (str) - SSL证书的名字
|
|
1687
|
+
- **SSLSource** (int) - SSL证书来源,SSL证书来源,0代表证书来自于ULB平台,1代表证书来自于USSL平台
|
|
1688
|
+
- **SSLType** (str) - SSL证书类型,暂时只有 Pem 一种类型
|
|
1689
|
+
- **USSLId** (str) - USSL证书平台的编号,只有当SSLSource为1时才出现
|
|
1690
|
+
|
|
1691
|
+
|
|
1692
|
+
**SSLBindedTargetSet**
|
|
1693
|
+
- **ULBId** (str) - VServer 所属的ULB实例的资源ID
|
|
1694
|
+
- **ULBName** (str) - ULB实例的名称
|
|
1695
|
+
- **VServerId** (str) - SSL证书绑定到的VServer的资源ID
|
|
1696
|
+
- **VServerName** (str) - 对应的VServer的名字
|
|
1697
|
+
|
|
1698
|
+
|
|
1699
|
+
**BindSecurityPolicy**
|
|
1700
|
+
- **SSLCiphers** (list) - 加密套件
|
|
1701
|
+
- **SecurityPolicyId** (str) - 安全策略组ID
|
|
1702
|
+
- **SecurityPolicyName** (str) - 安全策略组名称
|
|
1703
|
+
- **SecurityPolicyType** (int) - 安全策略类型 0:预定义 1:自定义
|
|
1704
|
+
- **TLSVersion** (str) - TLS最低版本
|
|
1705
|
+
|
|
1706
|
+
|
|
1707
|
+
"""
|
|
1708
|
+
# build request
|
|
1709
|
+
d = {
|
|
1710
|
+
"ProjectId": self.config.project_id,
|
|
1711
|
+
"Region": self.config.region,
|
|
1712
|
+
}
|
|
1713
|
+
req and d.update(req)
|
|
1714
|
+
d = apis.DescribeVServerRequestSchema().dumps(d)
|
|
1715
|
+
|
|
1716
|
+
resp = self.invoke("DescribeVServer", d, **kwargs)
|
|
1717
|
+
return apis.DescribeVServerResponseSchema().loads(resp)
|
|
1718
|
+
|
|
1719
|
+
def release_backend(
|
|
1720
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1721
|
+
) -> dict:
|
|
1722
|
+
"""ReleaseBackend - 从CLB的VServer释放后端资源实例
|
|
1723
|
+
|
|
1724
|
+
**Request**
|
|
1725
|
+
|
|
1726
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1727
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1728
|
+
- **BackendId** (str) - (Required) 后端资源实例的ID(CLB后端ID,非资源自身ID)
|
|
1729
|
+
- **ULBId** (str) - (Required) 传统型负载均衡实例的ID
|
|
1730
|
+
|
|
1731
|
+
**Response**
|
|
1732
|
+
|
|
1733
|
+
|
|
1734
|
+
"""
|
|
1735
|
+
# build request
|
|
1736
|
+
d = {
|
|
1737
|
+
"ProjectId": self.config.project_id,
|
|
1738
|
+
"Region": self.config.region,
|
|
1739
|
+
}
|
|
1740
|
+
req and d.update(req)
|
|
1741
|
+
d = apis.ReleaseBackendRequestSchema().dumps(d)
|
|
1742
|
+
|
|
1743
|
+
resp = self.invoke("ReleaseBackend", d, **kwargs)
|
|
1744
|
+
return apis.ReleaseBackendResponseSchema().loads(resp)
|
|
1745
|
+
|
|
1746
|
+
def remove_targets(
|
|
1747
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1748
|
+
) -> dict:
|
|
1749
|
+
"""RemoveTargets - 从应用型负载均衡监听器删除后端服务节点
|
|
1750
|
+
|
|
1751
|
+
**Request**
|
|
1752
|
+
|
|
1753
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1754
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1755
|
+
- **Ids** (list) - (Required) 服务节点的标识ID。不超过20个;
|
|
1756
|
+
- **ListenerId** (str) - (Required) 监听器的ID
|
|
1757
|
+
- **LoadBalancerId** (str) - (Required) 负载均衡实例的ID
|
|
1758
|
+
|
|
1759
|
+
**Response**
|
|
1760
|
+
|
|
1761
|
+
|
|
1762
|
+
"""
|
|
1763
|
+
# build request
|
|
1764
|
+
d = {
|
|
1765
|
+
"ProjectId": self.config.project_id,
|
|
1766
|
+
"Region": self.config.region,
|
|
1767
|
+
}
|
|
1768
|
+
req and d.update(req)
|
|
1769
|
+
d = apis.RemoveTargetsRequestSchema().dumps(d)
|
|
1770
|
+
|
|
1771
|
+
resp = self.invoke("RemoveTargets", d, **kwargs)
|
|
1772
|
+
return apis.RemoveTargetsResponseSchema().loads(resp)
|
|
1773
|
+
|
|
1774
|
+
def un_bind_security_policy(
|
|
1775
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1776
|
+
) -> dict:
|
|
1777
|
+
"""UnBindSecurityPolicy - 批量解绑安全策略,会同时解绑与传统型和应用型负载均衡监听器的绑定关系
|
|
1778
|
+
|
|
1779
|
+
**Request**
|
|
1780
|
+
|
|
1781
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1782
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1783
|
+
- **SecurityPolicyId** (str) - (Required) 安全策略ID
|
|
1784
|
+
|
|
1785
|
+
**Response**
|
|
1786
|
+
|
|
1787
|
+
|
|
1788
|
+
"""
|
|
1789
|
+
# build request
|
|
1790
|
+
d = {
|
|
1791
|
+
"ProjectId": self.config.project_id,
|
|
1792
|
+
"Region": self.config.region,
|
|
1793
|
+
}
|
|
1794
|
+
req and d.update(req)
|
|
1795
|
+
d = apis.UnBindSecurityPolicyRequestSchema().dumps(d)
|
|
1796
|
+
|
|
1797
|
+
resp = self.invoke("UnBindSecurityPolicy", d, **kwargs)
|
|
1798
|
+
return apis.UnBindSecurityPolicyResponseSchema().loads(resp)
|
|
1799
|
+
|
|
1800
|
+
def unbind_ssl(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
|
|
1801
|
+
"""UnbindSSL - 从CLB下的VServer解绑SSL证书
|
|
1802
|
+
|
|
1803
|
+
**Request**
|
|
1804
|
+
|
|
1805
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1806
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1807
|
+
- **SSLId** (str) - (Required) SSL证书的Id
|
|
1808
|
+
- **ULBId** (str) - (Required) 所绑定CLB实例ID
|
|
1809
|
+
- **VServerId** (str) - (Required) CLB所绑定VServer实例ID
|
|
1810
|
+
|
|
1811
|
+
**Response**
|
|
1812
|
+
|
|
1813
|
+
|
|
1814
|
+
"""
|
|
1815
|
+
# build request
|
|
1816
|
+
d = {
|
|
1817
|
+
"ProjectId": self.config.project_id,
|
|
1818
|
+
"Region": self.config.region,
|
|
1819
|
+
}
|
|
1820
|
+
req and d.update(req)
|
|
1821
|
+
d = apis.UnbindSSLRequestSchema().dumps(d)
|
|
1822
|
+
|
|
1823
|
+
resp = self.invoke("UnbindSSL", d, **kwargs)
|
|
1824
|
+
return apis.UnbindSSLResponseSchema().loads(resp)
|
|
1825
|
+
|
|
1826
|
+
def update_backend_attribute(
|
|
1827
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1828
|
+
) -> dict:
|
|
1829
|
+
"""UpdateBackendAttribute - 更新CLB后端资源实例(服务节点)属性
|
|
1830
|
+
|
|
1831
|
+
**Request**
|
|
1832
|
+
|
|
1833
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1834
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1835
|
+
- **BackendId** (str) - (Required) 后端资源实例的ID(CLB后端ID,非资源自身ID)
|
|
1836
|
+
- **ULBId** (str) - (Required) 传统型负载均衡资源ID
|
|
1837
|
+
- **Enabled** (int) - 后端实例状态开关
|
|
1838
|
+
- **IsBackup** (int) - 是否为backup0:主rs1:备rs默认为0
|
|
1839
|
+
- **Port** (int) - 后端资源服务端口,取值范围[1-65535]
|
|
1840
|
+
- **Weight** (int) - 所添加的后端RS权重(在加权轮询算法下有效),取值范围[1-100],默认为1
|
|
1841
|
+
|
|
1842
|
+
**Response**
|
|
1843
|
+
|
|
1844
|
+
|
|
1845
|
+
"""
|
|
1846
|
+
# build request
|
|
1847
|
+
d = {
|
|
1848
|
+
"ProjectId": self.config.project_id,
|
|
1849
|
+
"Region": self.config.region,
|
|
1850
|
+
}
|
|
1851
|
+
req and d.update(req)
|
|
1852
|
+
d = apis.UpdateBackendAttributeRequestSchema().dumps(d)
|
|
1853
|
+
|
|
1854
|
+
resp = self.invoke("UpdateBackendAttribute", d, **kwargs)
|
|
1855
|
+
return apis.UpdateBackendAttributeResponseSchema().loads(resp)
|
|
1856
|
+
|
|
1857
|
+
def update_backend_batch(
|
|
1858
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1859
|
+
) -> dict:
|
|
1860
|
+
"""UpdateBackendBatch - 批量更新ULB后端资源实例(服务节点)属性
|
|
1861
|
+
|
|
1862
|
+
**Request**
|
|
1863
|
+
|
|
1864
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1865
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1866
|
+
- **ULBId** (str) - (Required) 负载均衡资源ID
|
|
1867
|
+
- **Attributes** (list) - 见 **UpdateBackendBatchParamAttributes** 模型定义
|
|
1868
|
+
|
|
1869
|
+
**Response**
|
|
1870
|
+
|
|
1871
|
+
- **BackendSet** (list) - 见 **BackendMsg** 模型定义
|
|
1872
|
+
|
|
1873
|
+
**Request Model**
|
|
1874
|
+
|
|
1875
|
+
**UpdateBackendBatchParamAttributes**
|
|
1876
|
+
- **BackendId** (str) - 后端资源实例的ID(ULB后端ID,非资源自身ID)
|
|
1877
|
+
- **Enabled** (int) - 后端实例状态开关
|
|
1878
|
+
- **IsBackup** (int) - 是否为backup 0:主rs 1:备rs 默认为0
|
|
1879
|
+
- **Port** (int) - 后端资源服务端口,取值范围[1-65535]
|
|
1880
|
+
- **Weight** (int) - 所添加的后端RS权重(在加权轮询算法下有效),取值范围[0-100],默认为1
|
|
1881
|
+
|
|
1882
|
+
|
|
1883
|
+
**Response Model**
|
|
1884
|
+
|
|
1885
|
+
**BackendMsg**
|
|
1886
|
+
- **BackendId** (str) - rs的资源ID
|
|
1887
|
+
- **SubMessage** (str) - 修改rs返回的消息
|
|
1888
|
+
- **SubRetCode** (int) - 修改rs的返回值
|
|
1889
|
+
|
|
1890
|
+
|
|
1891
|
+
"""
|
|
1892
|
+
# build request
|
|
1893
|
+
d = {
|
|
1894
|
+
"ProjectId": self.config.project_id,
|
|
1895
|
+
"Region": self.config.region,
|
|
1896
|
+
}
|
|
1897
|
+
req and d.update(req)
|
|
1898
|
+
d = apis.UpdateBackendBatchRequestSchema().dumps(d)
|
|
1899
|
+
|
|
1900
|
+
resp = self.invoke("UpdateBackendBatch", d, **kwargs)
|
|
1901
|
+
return apis.UpdateBackendBatchResponseSchema().loads(resp)
|
|
1902
|
+
|
|
1903
|
+
def update_listener_attribute(
|
|
1904
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1905
|
+
) -> dict:
|
|
1906
|
+
"""UpdateListenerAttribute - 更新一个应用型负载均衡监听器的属性
|
|
1907
|
+
|
|
1908
|
+
**Request**
|
|
1909
|
+
|
|
1910
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1911
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1912
|
+
- **ListenerId** (str) - (Required) 监听器的ID
|
|
1913
|
+
- **LoadBalancerId** (str) - (Required) 负载均衡实例的ID
|
|
1914
|
+
- **Certificates** (list) - (应用型专用)服务器默认证书ID。仅HTTPS监听支持
|
|
1915
|
+
- **CompressionEnabled** (bool) - (应用型专用)是否开启数据压缩功能。目前只支持使用gzip对特定文件类型进行压缩
|
|
1916
|
+
- **HTTP2Enabled** (bool) - (应用型专用)是否开启HTTP/2特性。仅HTTPS监听支持开启
|
|
1917
|
+
- **HealthCheckConfig** (dict) - 见 **UpdateListenerAttributeParamHealthCheckConfig** 模型定义
|
|
1918
|
+
- **IdleTimeout** (int) - 连接空闲超时时间。单位:秒。应用型限定取值:[1-86400]
|
|
1919
|
+
- **Name** (str) - 监听器的名称。限定字符长度:[1-255];限定特殊字符,仅支持:-_.
|
|
1920
|
+
- **RedirectEnabled** (bool) - (应用型专用)是否开启HTTP重定向到HTTPS。仅HTTP监听支持开启
|
|
1921
|
+
- **RedirectPort** (int) - (应用型专用)重定向端口。限定取值:[1-65535]
|
|
1922
|
+
- **Remark** (str) - 监听器的备注信息。限定字符长度:[0-255]
|
|
1923
|
+
- **Scheduler** (str) - 负载均衡算法。应用型限定取值:"Roundrobin"/"Source"/"WeightRoundrobin"/" Leastconn"/"Backup"
|
|
1924
|
+
- **SecurityPolicyId** (str) - (应用型专用)安全策略组ID。仅HTTPS监听支持绑定。“Default”,表示绑定原生策略
|
|
1925
|
+
- **StickinessConfig** (dict) - 见 **UpdateListenerAttributeParamStickinessConfig** 模型定义
|
|
1926
|
+
|
|
1927
|
+
**Response**
|
|
1928
|
+
|
|
1929
|
+
|
|
1930
|
+
**Request Model**
|
|
1931
|
+
|
|
1932
|
+
**UpdateListenerAttributeParamStickinessConfig**
|
|
1933
|
+
- **CookieName** (str) - (应用型专用)自定义Cookie。当StickinessType取值"UserDefined"时有效;限定字符长度:[0-255]
|
|
1934
|
+
- **Enabled** (bool) - 是否开启会话保持功能。应用型负载均衡实例基于Cookie实现,网络型负载均衡则基于源IP,保证在对应的空闲超时时间内,同一个源IP送到同一个服务节点。默认值为:false
|
|
1935
|
+
- **Type** (str) - (应用型专用)Cookie处理方式。限定枚举值:"ServerInsert" / "UserDefined",默认值为:“ServerInsert”
|
|
1936
|
+
|
|
1937
|
+
|
|
1938
|
+
**UpdateListenerAttributeParamHealthCheckConfig**
|
|
1939
|
+
- **Domain** (str) - (应用型专用)HTTP检查域名
|
|
1940
|
+
- **Enabled** (bool) - 是否开启健康检查功能。暂时不支持关闭;默认值为:true
|
|
1941
|
+
- **Path** (str) - (应用型专用)HTTP检查路径
|
|
1942
|
+
- **Type** (str) - 健康检查方式。应用型限定取值:“Port”/"HTTP";默认值:“Port”
|
|
1943
|
+
|
|
1944
|
+
|
|
1945
|
+
"""
|
|
1946
|
+
# build request
|
|
1947
|
+
d = {
|
|
1948
|
+
"ProjectId": self.config.project_id,
|
|
1949
|
+
"Region": self.config.region,
|
|
1950
|
+
}
|
|
1951
|
+
req and d.update(req)
|
|
1952
|
+
d = apis.UpdateListenerAttributeRequestSchema().dumps(d)
|
|
1953
|
+
|
|
1954
|
+
resp = self.invoke("UpdateListenerAttribute", d, **kwargs)
|
|
1955
|
+
return apis.UpdateListenerAttributeResponseSchema().loads(resp)
|
|
1956
|
+
|
|
1957
|
+
def update_load_balancer_attribute(
|
|
1958
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1959
|
+
) -> dict:
|
|
1960
|
+
"""UpdateLoadBalancerAttribute - 更新一个应用型负载均衡实例的属性
|
|
1961
|
+
|
|
1962
|
+
**Request**
|
|
1963
|
+
|
|
1964
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1965
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1966
|
+
- **LoadBalancerId** (str) - (Required) 负载均衡实例的ID
|
|
1967
|
+
- **AccessLogConfig** (dict) - 见 **UpdateLoadBalancerAttributeParamAccessLogConfig** 模型定义
|
|
1968
|
+
- **Name** (str) - 负载均衡实例的名称,不传则默认不修改
|
|
1969
|
+
- **Remark** (str) - 负载均衡实例的备注信息,不传则默认不修改,限定字符长度:[0-255]
|
|
1970
|
+
- **Tag** (str) - 负载均衡实例所属的业务组ID,不传则默认不修改
|
|
1971
|
+
|
|
1972
|
+
**Response**
|
|
1973
|
+
|
|
1974
|
+
|
|
1975
|
+
**Request Model**
|
|
1976
|
+
|
|
1977
|
+
**UpdateLoadBalancerAttributeParamAccessLogConfig**
|
|
1978
|
+
- **Enabled** (bool) - (应用型专用)是否开启访问日志记录功能
|
|
1979
|
+
- **US3BucketName** (str) - (应用型专用)用于存储访问日志的bucket
|
|
1980
|
+
- **US3TokenId** (str) - (应用型专用)上传访问日志到bucket所需的token
|
|
1981
|
+
|
|
1982
|
+
|
|
1983
|
+
"""
|
|
1984
|
+
# build request
|
|
1985
|
+
d = {
|
|
1986
|
+
"ProjectId": self.config.project_id,
|
|
1987
|
+
"Region": self.config.region,
|
|
1988
|
+
}
|
|
1989
|
+
req and d.update(req)
|
|
1990
|
+
d = apis.UpdateLoadBalancerAttributeRequestSchema().dumps(d)
|
|
1991
|
+
|
|
1992
|
+
resp = self.invoke("UpdateLoadBalancerAttribute", d, **kwargs)
|
|
1993
|
+
return apis.UpdateLoadBalancerAttributeResponseSchema().loads(resp)
|
|
1994
|
+
|
|
1995
|
+
def update_policy(
|
|
1996
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1997
|
+
) -> dict:
|
|
1998
|
+
"""UpdatePolicy - 更新传统型负载均衡内容转发规则,包括转发规则后的服务节点
|
|
1999
|
+
|
|
2000
|
+
**Request**
|
|
2001
|
+
|
|
2002
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
2003
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2004
|
+
- **Match** (str) - (Required) 内容转发匹配字段
|
|
2005
|
+
- **ULBId** (str) - (Required) 需要添加内容转发策略的传统型负载均衡实例ID
|
|
2006
|
+
- **VServerId** (str) - (Required) 需要添加内容转发策略的VServer实例ID,只支持请求代理模式下,HTTP或HTTPS协议的CLB下的VServer
|
|
2007
|
+
- **BackendId** (list) - 内容转发策略应用的后端资源实例的ID(CLB的后端节点Id),来源于 AllocateBackend 返回的 BackendId,不传表示更新转发节点为空
|
|
2008
|
+
- **DomainMatchMode** (str) - 内容转发规则中域名的匹配方式,默认与原本一致。枚举值:Regular,正则;Wildcard,泛域名
|
|
2009
|
+
- **PolicyId** (str) - 传统型负载均衡转发规则的ID,当Type为Default时,可以不传或为空
|
|
2010
|
+
- **PolicyPriority** (int) - 策略优先级,1-9999;只针对路径规则生效
|
|
2011
|
+
- **Type** (str) - 内容转发匹配字段的类型,枚举值:Domain -> 域名转发规则;Path -> 路径转发规则;Default -> 默认转发规则,不传默认值Domain
|
|
2012
|
+
|
|
2013
|
+
**Response**
|
|
2014
|
+
|
|
2015
|
+
|
|
2016
|
+
"""
|
|
2017
|
+
# build request
|
|
2018
|
+
d = {
|
|
2019
|
+
"ProjectId": self.config.project_id,
|
|
2020
|
+
"Region": self.config.region,
|
|
2021
|
+
}
|
|
2022
|
+
req and d.update(req)
|
|
2023
|
+
d = apis.UpdatePolicyRequestSchema().dumps(d)
|
|
2024
|
+
|
|
2025
|
+
resp = self.invoke("UpdatePolicy", d, **kwargs)
|
|
2026
|
+
return apis.UpdatePolicyResponseSchema().loads(resp)
|
|
2027
|
+
|
|
2028
|
+
def update_rule_attribute(
|
|
2029
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2030
|
+
) -> dict:
|
|
2031
|
+
"""UpdateRuleAttribute - 更新应用型负载均衡监听器的一条转发规则的属性
|
|
2032
|
+
|
|
2033
|
+
**Request**
|
|
2034
|
+
|
|
2035
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
2036
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2037
|
+
- **ListenerId** (str) - (Required) 监听器的ID
|
|
2038
|
+
- **LoadBalancerId** (str) - (Required) 负载均衡实例的ID
|
|
2039
|
+
- **RuleId** (str) - (Required) 转发规则的ID
|
|
2040
|
+
- **Pass** (bool) - 当转发的服务节点为空时,规则是否忽略。默认转发规则不可更改
|
|
2041
|
+
- **RuleActions** (list) - 见 **UpdateRuleAttributeParamRuleActions** 模型定义
|
|
2042
|
+
- **RuleConditions** (list) - 见 **UpdateRuleAttributeParamRuleConditions** 模型定义
|
|
2043
|
+
|
|
2044
|
+
**Response**
|
|
2045
|
+
|
|
2046
|
+
|
|
2047
|
+
**Request Model**
|
|
2048
|
+
|
|
2049
|
+
**UpdateRuleAttributeParamRuleActionsForwardConfigTargets**
|
|
2050
|
+
- **Id** (str) - 转发的后端服务节点的标识ID。限定在监听器的服务节点池里;数组长度可以是0;转发服务节点配置的数组长度不为0时,Id必填
|
|
2051
|
+
- **Weight** (int) - 转发的后端服务节点的权重。仅监听器负载均衡算法是加权轮询是有效
|
|
2052
|
+
|
|
2053
|
+
|
|
2054
|
+
**UpdateRuleAttributeParamRuleActionsForwardConfig**
|
|
2055
|
+
- **Targets** (list) - 见 **UpdateRuleAttributeParamRuleActionsForwardConfigTargets** 模型定义
|
|
2056
|
+
|
|
2057
|
+
|
|
2058
|
+
**UpdateRuleAttributeParamRuleConditionsPathConfig**
|
|
2059
|
+
- **Values** (list) - 取值。暂时只支持数组长度为1;取值需符合相关条件;修改路径匹配时必填
|
|
2060
|
+
|
|
2061
|
+
|
|
2062
|
+
**UpdateRuleAttributeParamRuleConditionsHostConfig**
|
|
2063
|
+
- **MatchMode** (str) - 匹配方式。限定枚举值:"Regular"/"Wildcard",默认值:"Regular"
|
|
2064
|
+
- **Values** (list) - 取值。暂时只支持数组长度为1;取值需符合相关匹配方式的条件;修改域名匹配时必填
|
|
2065
|
+
|
|
2066
|
+
|
|
2067
|
+
**UpdateRuleAttributeParamRuleActions**
|
|
2068
|
+
- **ForwardConfig** (dict) - 见 **UpdateRuleAttributeParamRuleActionsForwardConfig** 模型定义
|
|
2069
|
+
- **Type** (str) - 动作类型。限定枚举值:"Forward";RuleActions数组长度不为0时必填
|
|
2070
|
+
|
|
2071
|
+
|
|
2072
|
+
**UpdateRuleAttributeParamRuleConditions**
|
|
2073
|
+
- **HostConfig** (dict) - 见 **UpdateRuleAttributeParamRuleConditionsHostConfig** 模型定义
|
|
2074
|
+
- **PathConfig** (dict) - 见 **UpdateRuleAttributeParamRuleConditionsPathConfig** 模型定义
|
|
2075
|
+
- **Type** (str) - 匹配条件类型。限定枚举值:"Host"/"Path";RuleConditions数组长度不为0时必填
|
|
2076
|
+
|
|
2077
|
+
|
|
2078
|
+
"""
|
|
2079
|
+
# build request
|
|
2080
|
+
d = {
|
|
2081
|
+
"ProjectId": self.config.project_id,
|
|
2082
|
+
"Region": self.config.region,
|
|
2083
|
+
}
|
|
2084
|
+
req and d.update(req)
|
|
2085
|
+
d = apis.UpdateRuleAttributeRequestSchema().dumps(d)
|
|
2086
|
+
|
|
2087
|
+
resp = self.invoke("UpdateRuleAttribute", d, **kwargs)
|
|
2088
|
+
return apis.UpdateRuleAttributeResponseSchema().loads(resp)
|
|
2089
|
+
|
|
2090
|
+
def update_ssl_attribute(
|
|
2091
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2092
|
+
) -> dict:
|
|
2093
|
+
"""UpdateSSLAttribute - 更新修改SSL的属性,如:修改SSLName
|
|
2094
|
+
|
|
2095
|
+
**Request**
|
|
2096
|
+
|
|
2097
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
2098
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2099
|
+
- **SSLId** (str) - (Required) SSL的资源id
|
|
2100
|
+
- **SSLName** (str) - (Required) SSL实例名称,不允许传空
|
|
2101
|
+
|
|
2102
|
+
**Response**
|
|
2103
|
+
|
|
2104
|
+
|
|
2105
|
+
"""
|
|
2106
|
+
# build request
|
|
2107
|
+
d = {
|
|
2108
|
+
"ProjectId": self.config.project_id,
|
|
2109
|
+
"Region": self.config.region,
|
|
2110
|
+
}
|
|
2111
|
+
req and d.update(req)
|
|
2112
|
+
d = apis.UpdateSSLAttributeRequestSchema().dumps(d)
|
|
2113
|
+
|
|
2114
|
+
resp = self.invoke("UpdateSSLAttribute", d, **kwargs)
|
|
2115
|
+
return apis.UpdateSSLAttributeResponseSchema().loads(resp)
|
|
2116
|
+
|
|
2117
|
+
def update_ssl_binding(
|
|
2118
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2119
|
+
) -> dict:
|
|
2120
|
+
"""UpdateSSLBinding - 将传统型或应用型负载均衡监听器绑定的证书更换为另一个证书,
|
|
2121
|
+
|
|
2122
|
+
**Request**
|
|
2123
|
+
|
|
2124
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
2125
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2126
|
+
- **NewSSLId** (str) - (Required) 监听器实例需要绑定的新的证书
|
|
2127
|
+
- **OldSSLId** (str) - (Required) 监听器实例绑定的旧的证书
|
|
2128
|
+
- **ListenerId** (str) - 所操作监听器实例ID(仅ListenerId传参时,将更换该监听器所有原证书为OldSSLId的绑定关系;LoadBalancerId和ListenerId都不传参则将更新该项目下所有原证书为OldSSLId的绑定关系;若LoadBalancerId与ListenerId皆有传参,则会强校验ULB与Vsserver的所属关系,将更换该ulb下vserver所绑定的OldSSLId为NewSSLId)(监听器指VServer或Listener)
|
|
2129
|
+
- **LoadBalancerId** (str) - 所操作LB实例ID(仅LoadBalancerId传参时,将更换该LB所有原证书为OldSSLId的绑定关系;LoadBalancerId和ListenerId都不传参则将更新该项目下所有原证书为OldSSLId的绑定关系)(LB指CLB或ALB)
|
|
2130
|
+
|
|
2131
|
+
**Response**
|
|
2132
|
+
|
|
2133
|
+
|
|
2134
|
+
"""
|
|
2135
|
+
# build request
|
|
2136
|
+
d = {
|
|
2137
|
+
"ProjectId": self.config.project_id,
|
|
2138
|
+
"Region": self.config.region,
|
|
2139
|
+
}
|
|
2140
|
+
req and d.update(req)
|
|
2141
|
+
d = apis.UpdateSSLBindingRequestSchema().dumps(d)
|
|
2142
|
+
|
|
2143
|
+
resp = self.invoke("UpdateSSLBinding", d, **kwargs)
|
|
2144
|
+
return apis.UpdateSSLBindingResponseSchema().loads(resp)
|
|
2145
|
+
|
|
2146
|
+
def update_security_policy(
|
|
2147
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2148
|
+
) -> dict:
|
|
2149
|
+
"""UpdateSecurityPolicy - 更新安全策略
|
|
2150
|
+
|
|
2151
|
+
**Request**
|
|
2152
|
+
|
|
2153
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
2154
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2155
|
+
- **SecurityPolicyId** (str) - (Required) 安全策略ID
|
|
2156
|
+
- **SSLCiphers** (list) - 加密套件,TLS最低版本和加密套件必须全不为空或全为空
|
|
2157
|
+
- **SecurityPolicyName** (str) - 安全策略名称
|
|
2158
|
+
- **TLSVersion** (str) - TLS最低版本,TLS最低版本和加密套件必须全不为空或全为空
|
|
2159
|
+
|
|
2160
|
+
**Response**
|
|
2161
|
+
|
|
2162
|
+
|
|
2163
|
+
"""
|
|
2164
|
+
# build request
|
|
2165
|
+
d = {
|
|
2166
|
+
"ProjectId": self.config.project_id,
|
|
2167
|
+
"Region": self.config.region,
|
|
2168
|
+
}
|
|
2169
|
+
req and d.update(req)
|
|
2170
|
+
d = apis.UpdateSecurityPolicyRequestSchema().dumps(d)
|
|
2171
|
+
|
|
2172
|
+
resp = self.invoke("UpdateSecurityPolicy", d, **kwargs)
|
|
2173
|
+
return apis.UpdateSecurityPolicyResponseSchema().loads(resp)
|
|
2174
|
+
|
|
2175
|
+
def update_targets_attribute(
|
|
2176
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2177
|
+
) -> dict:
|
|
2178
|
+
"""UpdateTargetsAttribute - 更新应用型负载均衡监听器后端服务节点的属性
|
|
2179
|
+
|
|
2180
|
+
**Request**
|
|
2181
|
+
|
|
2182
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
2183
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2184
|
+
- **ListenerId** (str) - (Required) 监听器的ID
|
|
2185
|
+
- **LoadBalancerId** (str) - (Required) 负载均衡实例的ID
|
|
2186
|
+
- **Targets** (list) - 见 **UpdateTargetsAttributeParamTargets** 模型定义
|
|
2187
|
+
|
|
2188
|
+
**Response**
|
|
2189
|
+
|
|
2190
|
+
|
|
2191
|
+
**Request Model**
|
|
2192
|
+
|
|
2193
|
+
**UpdateTargetsAttributeParamTargets**
|
|
2194
|
+
- **Enabled** (bool) - 服务节点是否启用。默认值true;要更新的Targets数组长度至少为1,不超过20个
|
|
2195
|
+
- **Id** (str) - 服务节点的标识ID。限定枚举值:"UHost" / "UNI"/"UPM"/"IP";要更新的Targets数组长度至少为1,不超过20个
|
|
2196
|
+
- **IsBackup** (bool) - 服务节点是否为备节点。默认值false;要更新的Targets数组长度至少为1,不超过20个
|
|
2197
|
+
- **Weight** (int) - 服务节点的权重。限定取值:[1-100],默认值1;仅在加权轮询算法时有效;要更新的Targets数组长度至少为1,不超过20个
|
|
2198
|
+
|
|
2199
|
+
|
|
2200
|
+
"""
|
|
2201
|
+
# build request
|
|
2202
|
+
d = {
|
|
2203
|
+
"ProjectId": self.config.project_id,
|
|
2204
|
+
"Region": self.config.region,
|
|
2205
|
+
}
|
|
2206
|
+
req and d.update(req)
|
|
2207
|
+
d = apis.UpdateTargetsAttributeRequestSchema().dumps(d)
|
|
2208
|
+
|
|
2209
|
+
resp = self.invoke("UpdateTargetsAttribute", d, **kwargs)
|
|
2210
|
+
return apis.UpdateTargetsAttributeResponseSchema().loads(resp)
|
|
2211
|
+
|
|
2212
|
+
def update_ulb_attribute(
|
|
2213
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2214
|
+
) -> dict:
|
|
2215
|
+
"""UpdateULBAttribute - 更新CLB名字业务组备注等属性字段
|
|
2216
|
+
|
|
2217
|
+
**Request**
|
|
2218
|
+
|
|
2219
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
2220
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2221
|
+
- **ULBId** (str) - (Required) CLB资源ID
|
|
2222
|
+
- **BucketName** (str) - 设置用于存储ulb日志的bucket
|
|
2223
|
+
- **EnableLog** (int) - 日志开关,1代表开启日志,0代表关闭日志,传1时必须同时传BucketName,TokenName与TokenId二选一
|
|
2224
|
+
- **IsWAFOn** (str) - 是否开启WAF。枚举类型:Yes,No,默认值为No
|
|
2225
|
+
- **Name** (str) - 名字,不传则默认不修改
|
|
2226
|
+
- **Remark** (str) - 备注,不传则默认不修改
|
|
2227
|
+
- **Tag** (str) - 业务,不传则默认不修改
|
|
2228
|
+
- **TokenId** (str) - 用于指定上传到bucket所需的token,与TokenName选填其一即可
|
|
2229
|
+
- **TokenName** (str) - 用于指定上传到bucket所需的token,与TokenId选填其一即可
|
|
2230
|
+
|
|
2231
|
+
**Response**
|
|
2232
|
+
|
|
2233
|
+
|
|
2234
|
+
"""
|
|
2235
|
+
# build request
|
|
2236
|
+
d = {
|
|
2237
|
+
"ProjectId": self.config.project_id,
|
|
2238
|
+
"Region": self.config.region,
|
|
2239
|
+
}
|
|
2240
|
+
req and d.update(req)
|
|
2241
|
+
d = apis.UpdateULBAttributeRequestSchema().dumps(d)
|
|
2242
|
+
|
|
2243
|
+
resp = self.invoke("UpdateULBAttribute", d, **kwargs)
|
|
2244
|
+
return apis.UpdateULBAttributeResponseSchema().loads(resp)
|
|
2245
|
+
|
|
2246
|
+
def update_vserver_attribute(
|
|
2247
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2248
|
+
) -> dict:
|
|
2249
|
+
"""UpdateVServerAttribute - 更新传统型负载均衡VServer实例属性
|
|
2250
|
+
|
|
2251
|
+
**Request**
|
|
2252
|
+
|
|
2253
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
2254
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2255
|
+
- **ULBId** (str) - (Required) 传统型负载均衡实例ID
|
|
2256
|
+
- **VServerId** (str) - (Required) 传统型负载均衡VServer实例ID
|
|
2257
|
+
- **ClientTimeout** (int) - 请求代理的VServer下表示空闲连接的回收时间,单位:秒,取值范围:时(0,86400],默认值为60;报文转发的VServer下表示回话保持的时间,单位:秒,取值范围:[60,900],0 表示禁用连接保持
|
|
2258
|
+
- **Domain** (str) - MonitorType 为 Path 时指定健康检查发送请求时HTTP HEADER 里的域名
|
|
2259
|
+
- **EnableCompression** (int) - 0:关闭 1:开启,用于数据压缩功能
|
|
2260
|
+
- **EnableHTTP2** (int) - 0:关闭 1:开启,用于开启http2功能;默认值为0
|
|
2261
|
+
- **ForwardPort** (int) - 重定向端口,取值范围[0-65535];默认值为0,代表关闭;仅HTTP协议支持开启重定向功能
|
|
2262
|
+
- **Method** (str) - VServer负载均衡模式,枚举值:Roundrobin -> 轮询;Source -> 源地址;ConsistentHash -> 一致性哈希;SourcePort -> 源地址(计算端口);ConsistentHashPort -> 一致性哈希(计算端口); WeightRoundrobin -> 加权轮询; Leastconn -> 最小连接数;Backup -> 主备模式。ConsistentHash,SourcePort,ConsistentHashPort 只在报文转发中使用;Leastconn只在请求代理中使用;Roundrobin、Source和WeightRoundrobin,Backup在请求代理和报文转发中使用。默认为:"Roundrobin"
|
|
2263
|
+
- **MonitorType** (str) - 健康检查类型,枚举值:Port -> 端口检查;Path -> 路径检查;Ping -> Ping探测,Customize -> UDP检查请求代理型默认值为Port,其中TCP协议仅支持Port,其他协议支持Port和Path;报文转发型TCP协议仅支持Port,UDP协议支持Ping、Port和Customize,默认值为Ping
|
|
2264
|
+
- **Path** (str) - MonitorType 为 Path 时指定健康检查发送请求时的路径,默认为 /
|
|
2265
|
+
- **PersistenceInfo** (str) - 根据PersistenceType确定: None或ServerInsert, 此字段无意义; UserDefined, 则此字段传入用户自定义会话保持String. 若无此字段则不做修改
|
|
2266
|
+
- **PersistenceType** (str) - VServer会话保持模式,若无此字段则不做修改。枚举值:None:关闭;ServerInsert:自动生成KEY;UserDefined:用户自定义KEY。
|
|
2267
|
+
- **RequestMsg** (str) - 根据MonitorType确认; 当MonitorType为Customize时,此字段有意义,代表UDP检查发出的请求报文
|
|
2268
|
+
- **ResponseMsg** (str) - 根据MonitorType确认; 当MonitorType为Customize时,此字段有意义,代表UDP检查请求应收到的响应报文
|
|
2269
|
+
- **SecurityPolicyId** (str) - 安全策略组ID
|
|
2270
|
+
- **VServerName** (str) - VServer实例名称,若无此字段则不做修改
|
|
2271
|
+
|
|
2272
|
+
**Response**
|
|
2273
|
+
|
|
2274
|
+
|
|
2275
|
+
"""
|
|
2276
|
+
# build request
|
|
2277
|
+
d = {
|
|
2278
|
+
"ProjectId": self.config.project_id,
|
|
2279
|
+
"Region": self.config.region,
|
|
2280
|
+
}
|
|
2281
|
+
req and d.update(req)
|
|
2282
|
+
d = apis.UpdateVServerAttributeRequestSchema().dumps(d)
|
|
2283
|
+
|
|
2284
|
+
resp = self.invoke("UpdateVServerAttribute", d, **kwargs)
|
|
2285
|
+
return apis.UpdateVServerAttributeResponseSchema().loads(resp)
|