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,1278 @@
|
|
|
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.unet.schemas import apis
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class UNetClient(Client):
|
|
11
|
+
def __init__(
|
|
12
|
+
self, config: dict, transport=None, middleware=None, logger=None
|
|
13
|
+
):
|
|
14
|
+
super(UNetClient, self).__init__(config, transport, middleware, logger)
|
|
15
|
+
|
|
16
|
+
def allocate_eip(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
|
|
17
|
+
"""AllocateEIP - 根据提供信息, 申请弹性IP
|
|
18
|
+
|
|
19
|
+
**Request**
|
|
20
|
+
|
|
21
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。
|
|
22
|
+
- **Region** (str) - (Config) 地域。
|
|
23
|
+
- **Bandwidth** (int) - (Required) 弹性IP的外网带宽, 单位为Mbps. 共享带宽模式必须指定0M带宽, 非共享带宽模式必须指定非0Mbps带宽. 各地域非共享带宽的带宽范围如下: 流量计费[1-300],带宽计费[1-10000]
|
|
24
|
+
- **OperatorName** (str) - (Required) 弹性IP线路,枚举值:国际线路, International;BGP线路:Bgp;精品BGP:BGPPro。使用BGP线路的地域:北京二、上海金融云、上海二、广州等,其他地域均使用国际线路。使用BGPPro线路的地域:香港
|
|
25
|
+
- **ChargeType** (str) - 付费方式, 枚举值为: Year, 按年付费; Month, 按月付费; Dynamic, 按时付费,默认为按月付费。
|
|
26
|
+
- **Count** (int) - 购买EIP数量,默认值为1
|
|
27
|
+
- **CouponId** (str) - 代金券ID, 默认不使用
|
|
28
|
+
- **Name** (str) - 弹性IP的名称, 默认为 "EIP"
|
|
29
|
+
- **PayMode** (str) - 弹性IP的计费模式. 枚举值: "Traffic", 流量计费; "Bandwidth", 带宽计费; "ShareBandwidth",共享带宽模式. 默认为 "Bandwidth".“PostAccurateBandwidth”:带宽后付费模式
|
|
30
|
+
- **Quantity** (int) - 购买的时长, 默认: 1
|
|
31
|
+
- **Remark** (str) - 弹性IP的备注, 默认为空
|
|
32
|
+
- **ShareBandwidthId** (str) - 绑定的共享带宽Id,仅当PayMode为ShareBandwidth时有效
|
|
33
|
+
- **Tag** (str) - 业务组名称, 默认为 "Default"
|
|
34
|
+
|
|
35
|
+
**Response**
|
|
36
|
+
|
|
37
|
+
- **EIPSet** (list) - 见 **UnetAllocateEIPSet** 模型定义
|
|
38
|
+
|
|
39
|
+
**Response Model**
|
|
40
|
+
|
|
41
|
+
**UnetAllocateEIPSet**
|
|
42
|
+
- **EIPAddr** (list) - 见 **UnetEIPAddrSet** 模型定义
|
|
43
|
+
- **EIPId** (str) - 申请到的EIP资源ID
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
**UnetEIPAddrSet**
|
|
47
|
+
- **IP** (str) - IP地址
|
|
48
|
+
- **OperatorName** (str) - 运营商信息如: 电信: Telecom, 联通: Unicom, 国际: International, Duplet: 双线IP(电信+联通), BGP: Bgp
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
"""
|
|
52
|
+
# build request
|
|
53
|
+
d = {
|
|
54
|
+
"ProjectId": self.config.project_id,
|
|
55
|
+
"Region": self.config.region,
|
|
56
|
+
}
|
|
57
|
+
req and d.update(req)
|
|
58
|
+
d = apis.AllocateEIPRequestSchema().dumps(d)
|
|
59
|
+
|
|
60
|
+
# build options
|
|
61
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
62
|
+
|
|
63
|
+
resp = self.invoke("AllocateEIP", d, **kwargs)
|
|
64
|
+
return apis.AllocateEIPResponseSchema().loads(resp)
|
|
65
|
+
|
|
66
|
+
def allocate_share_bandwidth(
|
|
67
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
68
|
+
) -> dict:
|
|
69
|
+
"""AllocateShareBandwidth - 开通共享带宽
|
|
70
|
+
|
|
71
|
+
**Request**
|
|
72
|
+
|
|
73
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。
|
|
74
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
75
|
+
- **ChargeType** (str) - (Required) 付费方式:Year 按年,Month 按月,Dynamic 按时;
|
|
76
|
+
- **Name** (str) - (Required) 共享带宽名字
|
|
77
|
+
- **ShareBandwidth** (int) - (Required) 共享带宽值
|
|
78
|
+
- **IPVersion** (str) - 共享带宽类型,IPv4或者IPv6,不传默认IPv4
|
|
79
|
+
- **OperatorName** (str) - 共享带宽线路:BGP 国内多线,International 国际多线,ChinaMobile 移动单线,Unicom 联通单线,Telecom 电信单线,BGPPro 精品BGP(仅香港支持精品BGP)
|
|
80
|
+
- **Quantity** (int) - 购买时长
|
|
81
|
+
- **Tag** (str) - 业务组名称, 默认为 "Default"
|
|
82
|
+
|
|
83
|
+
**Response**
|
|
84
|
+
|
|
85
|
+
- **ShareBandwidthId** (str) - 共享带宽资源Id
|
|
86
|
+
|
|
87
|
+
"""
|
|
88
|
+
# build request
|
|
89
|
+
d = {
|
|
90
|
+
"ProjectId": self.config.project_id,
|
|
91
|
+
"Region": self.config.region,
|
|
92
|
+
}
|
|
93
|
+
req and d.update(req)
|
|
94
|
+
d = apis.AllocateShareBandwidthRequestSchema().dumps(d)
|
|
95
|
+
|
|
96
|
+
# build options
|
|
97
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
98
|
+
|
|
99
|
+
resp = self.invoke("AllocateShareBandwidth", d, **kwargs)
|
|
100
|
+
return apis.AllocateShareBandwidthResponseSchema().loads(resp)
|
|
101
|
+
|
|
102
|
+
def associate_eip_with_share_bandwidth(
|
|
103
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
104
|
+
) -> dict:
|
|
105
|
+
"""AssociateEIPWithShareBandwidth - 将EIP加入共享带宽
|
|
106
|
+
|
|
107
|
+
**Request**
|
|
108
|
+
|
|
109
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。
|
|
110
|
+
- **Region** (str) - (Config) 地域。
|
|
111
|
+
- **EIPIds** (list) - (Required) 要加入共享带宽的EIP的资源Id
|
|
112
|
+
- **ShareBandwidthId** (str) - (Required) 共享带宽ID
|
|
113
|
+
- **IPVersion** (str) - 共享带宽类型,IPv4或者IPv6,不传默认IPv4
|
|
114
|
+
|
|
115
|
+
**Response**
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
"""
|
|
119
|
+
# build request
|
|
120
|
+
d = {
|
|
121
|
+
"ProjectId": self.config.project_id,
|
|
122
|
+
"Region": self.config.region,
|
|
123
|
+
}
|
|
124
|
+
req and d.update(req)
|
|
125
|
+
d = apis.AssociateEIPWithShareBandwidthRequestSchema().dumps(d)
|
|
126
|
+
|
|
127
|
+
resp = self.invoke("AssociateEIPWithShareBandwidth", d, **kwargs)
|
|
128
|
+
return apis.AssociateEIPWithShareBandwidthResponseSchema().loads(resp)
|
|
129
|
+
|
|
130
|
+
def bind_eip(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
|
|
131
|
+
"""BindEIP - 将尚未使用的弹性IP绑定到指定的资源
|
|
132
|
+
|
|
133
|
+
**Request**
|
|
134
|
+
|
|
135
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写
|
|
136
|
+
- **Region** (str) - (Config) 地域
|
|
137
|
+
- **EIPId** (str) - (Required) 弹性IP的资源Id
|
|
138
|
+
- **ResourceId** (str) - (Required) 弹性IP请求绑定的资源ID
|
|
139
|
+
- **ResourceType** (str) - (Required) 弹性IP请求绑定的资源类型, 枚举值为: uhost: 云主机; ulb, 负载均衡器 upm: 物理机; hadoophost: 大数据集群;fortresshost:堡垒机;udockhost:容器;udhost:私有专区主机;natgw:natgw;udb:udb;vpngw:ipsec vpn;ucdr:云灾备;dbaudit:数据库审计;uni:虚拟网卡;cube,Cube容器。如果EIP为普通带宽计费,且带宽值高于2G,则只允许绑定在快杰型云主机和ULB
|
|
140
|
+
- **PrivateIP** (str) - EIP与内网IP进行绑定时需要传入UNI下未绑定过EIP的内网IP
|
|
141
|
+
|
|
142
|
+
**Response**
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
"""
|
|
146
|
+
# build request
|
|
147
|
+
d = {
|
|
148
|
+
"ProjectId": self.config.project_id,
|
|
149
|
+
"Region": self.config.region,
|
|
150
|
+
}
|
|
151
|
+
req and d.update(req)
|
|
152
|
+
d = apis.BindEIPRequestSchema().dumps(d)
|
|
153
|
+
|
|
154
|
+
resp = self.invoke("BindEIP", d, **kwargs)
|
|
155
|
+
return apis.BindEIPResponseSchema().loads(resp)
|
|
156
|
+
|
|
157
|
+
def create_bandwidth_package(
|
|
158
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
159
|
+
) -> dict:
|
|
160
|
+
"""CreateBandwidthPackage - 为非共享带宽模式下, 已绑定资源实例的带宽计费弹性IP附加临时带宽包
|
|
161
|
+
|
|
162
|
+
**Request**
|
|
163
|
+
|
|
164
|
+
- **ProjectId** (str) - (Config)
|
|
165
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
166
|
+
- **Bandwidth** (int) - (Required) 带宽大小(单位Mbps), 取值范围[2,800] (最大值受地域限制)
|
|
167
|
+
- **EIPId** (str) - (Required) 所绑定弹性IP的资源ID
|
|
168
|
+
- **TimeRange** (int) - (Required) 带宽包有效时长, 取值范围为大于0的整数, 即该带宽包在EnableTime到 EnableTime+TimeRange时间段内生效
|
|
169
|
+
- **CouponId** (str) - 代金券ID
|
|
170
|
+
- **EnableTime** (int) - 生效时间, 格式为 Unix timestamp, 默认为立即开通
|
|
171
|
+
|
|
172
|
+
**Response**
|
|
173
|
+
|
|
174
|
+
- **BandwidthPackageId** (str) - 所创建带宽包的资源ID
|
|
175
|
+
|
|
176
|
+
"""
|
|
177
|
+
# build request
|
|
178
|
+
d = {
|
|
179
|
+
"ProjectId": self.config.project_id,
|
|
180
|
+
"Region": self.config.region,
|
|
181
|
+
}
|
|
182
|
+
req and d.update(req)
|
|
183
|
+
d = apis.CreateBandwidthPackageRequestSchema().dumps(d)
|
|
184
|
+
|
|
185
|
+
# build options
|
|
186
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
187
|
+
|
|
188
|
+
resp = self.invoke("CreateBandwidthPackage", d, **kwargs)
|
|
189
|
+
return apis.CreateBandwidthPackageResponseSchema().loads(resp)
|
|
190
|
+
|
|
191
|
+
def create_firewall(
|
|
192
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
193
|
+
) -> dict:
|
|
194
|
+
"""CreateFirewall - 创建防火墙
|
|
195
|
+
|
|
196
|
+
**Request**
|
|
197
|
+
|
|
198
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写
|
|
199
|
+
- **Region** (str) - (Config) 地域
|
|
200
|
+
- **Name** (str) - (Required) 防火墙名称
|
|
201
|
+
- **Rule** (list) - (Required) 防火墙规则,例如:TCP|22|192.168.1.1/22|DROP|LOW|禁用22端口,第一个参数代表协议:第二个参数代表端口号,第三个参数为ip,第四个参数为ACCEPT(接受)和DROP(拒绝),第五个参数优先级:HIGH(高),MEDIUM(中),LOW(低),第六个参数为该条规则的自定义备注,备注最大长度64
|
|
202
|
+
- **Remark** (str) - 防火墙描述,默认为空
|
|
203
|
+
- **Tag** (str) - 防火墙业务组,默认为Default
|
|
204
|
+
|
|
205
|
+
**Response**
|
|
206
|
+
|
|
207
|
+
- **FWId** (str) - 防火墙ID
|
|
208
|
+
|
|
209
|
+
"""
|
|
210
|
+
# build request
|
|
211
|
+
d = {
|
|
212
|
+
"ProjectId": self.config.project_id,
|
|
213
|
+
"Region": self.config.region,
|
|
214
|
+
}
|
|
215
|
+
req and d.update(req)
|
|
216
|
+
d = apis.CreateFirewallRequestSchema().dumps(d)
|
|
217
|
+
|
|
218
|
+
# build options
|
|
219
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
220
|
+
|
|
221
|
+
resp = self.invoke("CreateFirewall", d, **kwargs)
|
|
222
|
+
return apis.CreateFirewallResponseSchema().loads(resp)
|
|
223
|
+
|
|
224
|
+
def delete_bandwidth_package(
|
|
225
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
226
|
+
) -> dict:
|
|
227
|
+
"""DeleteBandwidthPackage - 删除弹性IP上已附加带宽包
|
|
228
|
+
|
|
229
|
+
**Request**
|
|
230
|
+
|
|
231
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
232
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
233
|
+
- **BandwidthPackageId** (str) - (Required) 带宽包资源ID
|
|
234
|
+
|
|
235
|
+
**Response**
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
"""
|
|
239
|
+
# build request
|
|
240
|
+
d = {
|
|
241
|
+
"ProjectId": self.config.project_id,
|
|
242
|
+
"Region": self.config.region,
|
|
243
|
+
}
|
|
244
|
+
req and d.update(req)
|
|
245
|
+
d = apis.DeleteBandwidthPackageRequestSchema().dumps(d)
|
|
246
|
+
|
|
247
|
+
resp = self.invoke("DeleteBandwidthPackage", d, **kwargs)
|
|
248
|
+
return apis.DeleteBandwidthPackageResponseSchema().loads(resp)
|
|
249
|
+
|
|
250
|
+
def delete_firewall(
|
|
251
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
252
|
+
) -> dict:
|
|
253
|
+
"""DeleteFirewall - 删除防火墙
|
|
254
|
+
|
|
255
|
+
**Request**
|
|
256
|
+
|
|
257
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
258
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
259
|
+
- **FWId** (str) - (Required) 防火墙资源ID
|
|
260
|
+
|
|
261
|
+
**Response**
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
"""
|
|
265
|
+
# build request
|
|
266
|
+
d = {
|
|
267
|
+
"ProjectId": self.config.project_id,
|
|
268
|
+
"Region": self.config.region,
|
|
269
|
+
}
|
|
270
|
+
req and d.update(req)
|
|
271
|
+
d = apis.DeleteFirewallRequestSchema().dumps(d)
|
|
272
|
+
|
|
273
|
+
resp = self.invoke("DeleteFirewall", d, **kwargs)
|
|
274
|
+
return apis.DeleteFirewallResponseSchema().loads(resp)
|
|
275
|
+
|
|
276
|
+
def describe_bandwidth_package(
|
|
277
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
278
|
+
) -> dict:
|
|
279
|
+
"""DescribeBandwidthPackage - 获取某地域下的带宽包信息
|
|
280
|
+
|
|
281
|
+
**Request**
|
|
282
|
+
|
|
283
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
284
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
285
|
+
- **Limit** (int) - 返回数据分页值, 取值范围为 [0,10000000] 之间的整数, 默认为20
|
|
286
|
+
- **Offset** (int) - 返回数据偏移量, 默认为0
|
|
287
|
+
|
|
288
|
+
**Response**
|
|
289
|
+
|
|
290
|
+
- **DataSets** (list) - 见 **UnetBandwidthPackageSet** 模型定义
|
|
291
|
+
- **TotalCount** (int) - 满足条件的带宽包总数
|
|
292
|
+
|
|
293
|
+
**Response Model**
|
|
294
|
+
|
|
295
|
+
**UnetBandwidthPackageSet**
|
|
296
|
+
- **Bandwidth** (int) - 带宽包的临时带宽值, 单位Mbps
|
|
297
|
+
- **BandwidthPackageId** (str) - 带宽包的资源ID
|
|
298
|
+
- **CreateTime** (int) - 创建时间, 格式为 Unix Timestamp
|
|
299
|
+
- **DisableTime** (int) - 失效时间, 格式为 Unix Timestamp
|
|
300
|
+
- **EIPAddr** (list) - 见 **EIPAddrSet** 模型定义
|
|
301
|
+
- **EIPId** (str) - 带宽包所绑定弹性IP的资源ID
|
|
302
|
+
- **EnableTime** (int) - 生效时间, 格式为 Unix Timestamp
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
**EIPAddrSet**
|
|
306
|
+
- **IP** (str) - 弹性IP地址
|
|
307
|
+
- **OperatorName** (str) - 运营商信息, 枚举值为: BGP: BGP; International: 国际.
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
"""
|
|
311
|
+
# build request
|
|
312
|
+
d = {
|
|
313
|
+
"ProjectId": self.config.project_id,
|
|
314
|
+
"Region": self.config.region,
|
|
315
|
+
}
|
|
316
|
+
req and d.update(req)
|
|
317
|
+
d = apis.DescribeBandwidthPackageRequestSchema().dumps(d)
|
|
318
|
+
|
|
319
|
+
resp = self.invoke("DescribeBandwidthPackage", d, **kwargs)
|
|
320
|
+
return apis.DescribeBandwidthPackageResponseSchema().loads(resp)
|
|
321
|
+
|
|
322
|
+
def describe_bandwidth_usage(
|
|
323
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
324
|
+
) -> dict:
|
|
325
|
+
"""DescribeBandwidthUsage - 获取带宽用量信息
|
|
326
|
+
|
|
327
|
+
**Request**
|
|
328
|
+
|
|
329
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
330
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
331
|
+
- **BeginTime** (int) - 统计开始时间
|
|
332
|
+
- **EIPIds** (list) - 弹性IP的资源Id. 如果为空, 则返回当前 Region中符合条件的所有EIP的带宽用量, n为自然数
|
|
333
|
+
- **EndTime** (int) - 统计结束时间
|
|
334
|
+
- **Limit** (int) - 返回数据分页值, 取值范围为 [0,10000000] 之间的整数, 默认为20
|
|
335
|
+
- **OffSet** (int) - 返回数据偏移量, 默认为0
|
|
336
|
+
|
|
337
|
+
**Response**
|
|
338
|
+
|
|
339
|
+
- **EIPSet** (list) - 见 **UnetBandwidthUsageEIPSet** 模型定义
|
|
340
|
+
- **TotalCount** (int) - EIPSet中的元素个数
|
|
341
|
+
|
|
342
|
+
**Response Model**
|
|
343
|
+
|
|
344
|
+
**UnetBandwidthUsageEIPSet**
|
|
345
|
+
- **CurBandwidth** (float) - 最近5分钟带宽用量, 单位Mbps
|
|
346
|
+
- **EIPId** (str) - 弹性IP资源ID
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
"""
|
|
350
|
+
# build request
|
|
351
|
+
d = {
|
|
352
|
+
"ProjectId": self.config.project_id,
|
|
353
|
+
"Region": self.config.region,
|
|
354
|
+
}
|
|
355
|
+
req and d.update(req)
|
|
356
|
+
d = apis.DescribeBandwidthUsageRequestSchema().dumps(d)
|
|
357
|
+
|
|
358
|
+
resp = self.invoke("DescribeBandwidthUsage", d, **kwargs)
|
|
359
|
+
return apis.DescribeBandwidthUsageResponseSchema().loads(resp)
|
|
360
|
+
|
|
361
|
+
def describe_eip(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
|
|
362
|
+
"""DescribeEIP - 获取弹性IP信息
|
|
363
|
+
|
|
364
|
+
**Request**
|
|
365
|
+
|
|
366
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写
|
|
367
|
+
- **Region** (str) - (Config) 地域
|
|
368
|
+
- **EIPIds** (list) - 弹性IP的资源ID如果为空, 则返回当前 Region中符合条件的的所有EIP
|
|
369
|
+
- **IPs** (list) - IP地址,支持通过ip查询,如果ip与EIP都传,会取并集查询
|
|
370
|
+
- **Limit** (int) - 数据分页值, 默认为20
|
|
371
|
+
- **Offset** (int) - 数据偏移量, 默认为0
|
|
372
|
+
|
|
373
|
+
**Response**
|
|
374
|
+
|
|
375
|
+
- **EIPSet** (list) - 见 **UnetEIPSet** 模型定义
|
|
376
|
+
- **TotalBandwidth** (int) - 满足条件的弹性IP带宽总和, 单位Mbps
|
|
377
|
+
- **TotalCount** (int) - 满足条件的弹性IP总数
|
|
378
|
+
- **UnbindCount** (int) - 未绑定的弹性IP总数
|
|
379
|
+
|
|
380
|
+
**Response Model**
|
|
381
|
+
|
|
382
|
+
**UnetEIPSet**
|
|
383
|
+
- **Bandwidth** (int) - 弹性IP的带宽, 单位为Mbps, 当BandwidthType=1时, 该处显示为共享带宽值. 当BandwidthType=0时, 该处显示这个弹性IP的带宽.
|
|
384
|
+
- **BandwidthType** (int) - 带宽模式, 枚举值为: 0: 非共享带宽模式, 1: 共享带宽模式
|
|
385
|
+
- **ChargeType** (str) - 付费方式, 枚举值为: Year, 按年付费; Month, 按月付费; Dynamic, 按小时付费; Trial, 试用. 按小时付费和试用这两种付费模式需要开通权限.
|
|
386
|
+
- **CreateTime** (int) - 弹性IP的创建时间, 格式为Unix Timestamp
|
|
387
|
+
- **EIPAddr** (list) - 见 **UnetEIPAddrSet** 模型定义
|
|
388
|
+
- **EIPBinding** (dict) - 见 **EIPBinding** 模型定义
|
|
389
|
+
- **EIPId** (str) - 弹性IP的资源ID
|
|
390
|
+
- **Expire** (bool) - 弹性IP是否到期
|
|
391
|
+
- **ExpireTime** (int) - 弹性IP的到期时间, 格式为Unix Timestamp
|
|
392
|
+
- **Name** (str) - 弹性IP的名称,缺省值为 "EIP"
|
|
393
|
+
- **PayMode** (str) - 弹性IP的计费模式, 枚举值为: "Bandwidth", 带宽计费; "Traffic", 流量计费; "ShareBandwidth",共享带宽模式. 默认为 "Bandwidth".
|
|
394
|
+
- **Remark** (str) - 弹性IP的备注, 缺省值为 ""
|
|
395
|
+
- **Resource** (dict) - 见 **UnetEIPResourceSet** 模型定义
|
|
396
|
+
- **ShareBandwidthSet** (dict) - 见 **ShareBandwidthSet** 模型定义
|
|
397
|
+
- **Status** (str) - 弹性IP的资源绑定状态, 枚举值为: used: 已绑定, free: 未绑定, freeze: 已冻结
|
|
398
|
+
- **Tag** (str) - 弹性IP的业务组标识, 缺省值为 "Default"
|
|
399
|
+
- **Weight** (int) - 外网出口权重, 默认为50, 范围[0-100]
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
**UnetEIPAddrSet**
|
|
403
|
+
- **IP** (str) - IP地址
|
|
404
|
+
- **OperatorName** (str) - 运营商信息如: 国际: International, BGP: BGP
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
**EIPBinding**
|
|
408
|
+
- **EIP** (str) - 外网ip
|
|
409
|
+
- **PrivateIP** (str) - 内网ip
|
|
410
|
+
- **PrivateIPType** (str) - 内网ip类型:PrimaryIP(默认)、SecondaryIP(非默认)
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
**UnetEIPResourceSet**
|
|
414
|
+
- **EIPId** (str) - 弹性IP的资源ID
|
|
415
|
+
- **ResourceID** (str) - 已绑定资源的资源ID
|
|
416
|
+
- **ResourceName** (str) - 已绑定的资源名称
|
|
417
|
+
- **ResourceType** (str) - 已绑定的资源类型, 枚举值为: uhost, 云主机;natgw:NAT网关;ulb:负载均衡器;upm: 物理机; hadoophost: 大数据集群;fortresshost:堡垒机;udockhost:容器;udhost:私有专区主机;vpngw:IPSec VPN;ucdr:云灾备;dbaudit:数据库审计,uni:虚拟网卡。
|
|
418
|
+
- **SubResourceId** (str) - 资源绑定的虚拟网卡的ID
|
|
419
|
+
- **SubResourceName** (str) - 资源绑定的虚拟网卡的名称
|
|
420
|
+
- **SubResourceType** (str) - 资源绑定的虚拟网卡的类型。uni,虚拟网卡。
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
**ShareBandwidthSet**
|
|
424
|
+
- **ShareBandwidth** (int) - 共享带宽带宽值
|
|
425
|
+
- **ShareBandwidthId** (str) - 共享带宽ID
|
|
426
|
+
- **ShareBandwidthName** (str) - 共享带宽的资源名称
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
"""
|
|
430
|
+
# build request
|
|
431
|
+
d = {
|
|
432
|
+
"ProjectId": self.config.project_id,
|
|
433
|
+
"Region": self.config.region,
|
|
434
|
+
}
|
|
435
|
+
req and d.update(req)
|
|
436
|
+
d = apis.DescribeEIPRequestSchema().dumps(d)
|
|
437
|
+
|
|
438
|
+
resp = self.invoke("DescribeEIP", d, **kwargs)
|
|
439
|
+
return apis.DescribeEIPResponseSchema().loads(resp)
|
|
440
|
+
|
|
441
|
+
def describe_firewall(
|
|
442
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
443
|
+
) -> dict:
|
|
444
|
+
"""DescribeFirewall - 获取防火墙组信息
|
|
445
|
+
|
|
446
|
+
**Request**
|
|
447
|
+
|
|
448
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写
|
|
449
|
+
- **Region** (str) - (Config) 地域
|
|
450
|
+
- **FWId** (str) - 防火墙ID,默认为返回所有防火墙
|
|
451
|
+
- **Limit** (int) - 返回数据长度,默认为20,最大10000000
|
|
452
|
+
- **Offset** (int) - 列表起始位置偏移量,默认为0
|
|
453
|
+
- **ResourceId** (str) - 绑定防火墙组的资源ID。
|
|
454
|
+
- **ResourceType** (str) - 绑定防火墙的资源类型,仅获取资源对应防火墙信息时需要。枚举值为:"unatgw",NAT网关; "uhost",云主机; "upm",物理云主机; "hadoophost",hadoop节点; "fortresshost",堡垒机; "udhost",私有专区主机;"udockhost",容器;"dbaudit",数据库审计;”uni“,虚拟网卡;“cube”,Cube容器实例;“ulb”,负载均衡实例。
|
|
455
|
+
|
|
456
|
+
**Response**
|
|
457
|
+
|
|
458
|
+
- **DataSet** (list) - 见 **FirewallDataSet** 模型定义
|
|
459
|
+
- **TotalCount** (int) - 防火墙资源数量
|
|
460
|
+
|
|
461
|
+
**Response Model**
|
|
462
|
+
|
|
463
|
+
**FirewallDataSet**
|
|
464
|
+
- **CreateTime** (int) - 防火墙组创建时间,格式为Unix Timestamp
|
|
465
|
+
- **FWId** (str) - 防火墙ID
|
|
466
|
+
- **GroupId** (str) - 安全组ID(即将废弃)
|
|
467
|
+
- **Name** (str) - 防火墙名称
|
|
468
|
+
- **Remark** (str) - 防火墙备注
|
|
469
|
+
- **ResourceCount** (int) - 防火墙绑定资源数量
|
|
470
|
+
- **Rule** (list) - 见 **FirewallRuleSet** 模型定义
|
|
471
|
+
- **Tag** (str) - 防火墙业务组
|
|
472
|
+
- **Type** (str) - 防火墙组类型,枚举值为: "user defined", 用户自定义防火墙; "recommend web", 默认Web防火墙; "recommend non web", 默认非Web防火墙
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
**FirewallRuleSet**
|
|
476
|
+
- **DstPort** (str) - 目标端口
|
|
477
|
+
- **Priority** (str) - 优先级
|
|
478
|
+
- **ProtocolType** (str) - 协议类型
|
|
479
|
+
- **Remark** (str) - 防火墙规则备注
|
|
480
|
+
- **RuleAction** (str) - 防火墙动作
|
|
481
|
+
- **SrcIP** (str) - 源地址
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
"""
|
|
485
|
+
# build request
|
|
486
|
+
d = {
|
|
487
|
+
"ProjectId": self.config.project_id,
|
|
488
|
+
"Region": self.config.region,
|
|
489
|
+
}
|
|
490
|
+
req and d.update(req)
|
|
491
|
+
d = apis.DescribeFirewallRequestSchema().dumps(d)
|
|
492
|
+
|
|
493
|
+
resp = self.invoke("DescribeFirewall", d, **kwargs)
|
|
494
|
+
return apis.DescribeFirewallResponseSchema().loads(resp)
|
|
495
|
+
|
|
496
|
+
def describe_firewall_resource(
|
|
497
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
498
|
+
) -> dict:
|
|
499
|
+
"""DescribeFirewallResource - 获取防火墙组所绑定资源的外网IP
|
|
500
|
+
|
|
501
|
+
**Request**
|
|
502
|
+
|
|
503
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
504
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
505
|
+
- **FWId** (str) - (Required) 防火墙ID
|
|
506
|
+
- **Limit** (int) - 返回数据长度,默认为20,最大1000
|
|
507
|
+
- **Offset** (int) - 列表起始位置偏移量,默认为0
|
|
508
|
+
|
|
509
|
+
**Response**
|
|
510
|
+
|
|
511
|
+
- **ResourceSet** (list) - 见 **ResourceSet** 模型定义
|
|
512
|
+
- **TotalCount** (int) - 绑定资源总数
|
|
513
|
+
|
|
514
|
+
**Response Model**
|
|
515
|
+
|
|
516
|
+
**ResourceSet**
|
|
517
|
+
- **Name** (str) - 名称
|
|
518
|
+
- **PrivateIP** (str) - 内网IP
|
|
519
|
+
- **Remark** (str) - 备注
|
|
520
|
+
- **ResourceID** (str) - 绑定该防火墙的资源id
|
|
521
|
+
- **ResourceType** (str) - 绑定防火墙组的资源类型。"unatgw",NAT网关; "uhost",云主机; "upm",物理云主机; "hadoophost",hadoop节点; "fortresshost",堡垒机; "udhost",私有专区主机;"udockhost",容器;"dbaudit",数据库审计,“uni”,虚拟网卡。
|
|
522
|
+
- **Status** (int) - 状态
|
|
523
|
+
- **SubResourceId** (str) - 资源绑定的虚拟网卡的ID
|
|
524
|
+
- **SubResourceName** (str) - 资源绑定的虚拟网卡的名称
|
|
525
|
+
- **SubResourceType** (str) - 资源绑定的虚拟网卡的类型,“uni”,虚拟网卡。
|
|
526
|
+
- **Tag** (str) - 业务组
|
|
527
|
+
- **Zone** (int) - 可用区
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
"""
|
|
531
|
+
# build request
|
|
532
|
+
d = {
|
|
533
|
+
"ProjectId": self.config.project_id,
|
|
534
|
+
"Region": self.config.region,
|
|
535
|
+
}
|
|
536
|
+
req and d.update(req)
|
|
537
|
+
d = apis.DescribeFirewallResourceRequestSchema().dumps(d)
|
|
538
|
+
|
|
539
|
+
resp = self.invoke("DescribeFirewallResource", d, **kwargs)
|
|
540
|
+
return apis.DescribeFirewallResourceResponseSchema().loads(resp)
|
|
541
|
+
|
|
542
|
+
def describe_private_ip(
|
|
543
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
544
|
+
) -> dict:
|
|
545
|
+
"""DescribePrivateIP - 获取资源绑定的内网IP信息
|
|
546
|
+
|
|
547
|
+
**Request**
|
|
548
|
+
|
|
549
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
550
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
551
|
+
- **Limit** (int) - 获取信息数量 ,默认20;不允许为0
|
|
552
|
+
- **ObjectId** (str) - 虚拟网卡的资源ID; ObjectId为空时,则获取项目下所有的虚拟网卡主辅IP信息
|
|
553
|
+
- **Offset** (int) - 列表起始位置偏移量,默认为0
|
|
554
|
+
- **SubnetId** (str) - 子网的ID
|
|
555
|
+
- **VPCId** (str) - VPC的ID
|
|
556
|
+
|
|
557
|
+
**Response**
|
|
558
|
+
|
|
559
|
+
- **DataSet** (list) - 见 **DescribeSecondaryIPDataSet** 模型定义
|
|
560
|
+
- **TotalCount** (int) - 返回资源数量
|
|
561
|
+
|
|
562
|
+
**Response Model**
|
|
563
|
+
|
|
564
|
+
**DescribeSecondaryIPDataSet**
|
|
565
|
+
- **EIP** (str) - 外网IP
|
|
566
|
+
- **EIPId** (str) - EIP资源ID
|
|
567
|
+
- **PrivateIP** (str) - 内网IP
|
|
568
|
+
- **PrivateIPType** (str) - 内网IP类型;枚举值:PrimaryIP:主内网IP,SecondaryIP:辅助内网IP
|
|
569
|
+
- **ResourceID** (str) - 资源ID
|
|
570
|
+
- **ResourceName** (str) - 资源名称
|
|
571
|
+
- **SubnetID** (str) - 子网ID
|
|
572
|
+
- **VPCID** (str) - VPCID
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
"""
|
|
576
|
+
# build request
|
|
577
|
+
d = {
|
|
578
|
+
"ProjectId": self.config.project_id,
|
|
579
|
+
"Region": self.config.region,
|
|
580
|
+
}
|
|
581
|
+
req and d.update(req)
|
|
582
|
+
d = apis.DescribePrivateIPRequestSchema().dumps(d)
|
|
583
|
+
|
|
584
|
+
resp = self.invoke("DescribePrivateIP", d, **kwargs)
|
|
585
|
+
return apis.DescribePrivateIPResponseSchema().loads(resp)
|
|
586
|
+
|
|
587
|
+
def describe_share_bandwidth(
|
|
588
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
589
|
+
) -> dict:
|
|
590
|
+
"""DescribeShareBandwidth - 获取共享带宽信息
|
|
591
|
+
|
|
592
|
+
**Request**
|
|
593
|
+
|
|
594
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
595
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
596
|
+
- **ShareBandwidthIds** (list) - 需要返回的共享带宽Id
|
|
597
|
+
|
|
598
|
+
**Response**
|
|
599
|
+
|
|
600
|
+
- **DataSet** (list) - 见 **UnetShareBandwidthSet** 模型定义
|
|
601
|
+
- **TotalCount** (int) - 符合条件的共享带宽总数,大于等于返回DataSet长度
|
|
602
|
+
|
|
603
|
+
**Response Model**
|
|
604
|
+
|
|
605
|
+
**UnetShareBandwidthSet**
|
|
606
|
+
- **ChargeType** (str) - 付费方式, 预付费:Year 按年,Month 按月,Dynamic 按需;后付费:PostPay(按月)
|
|
607
|
+
- **CreateTime** (int) - 创建时间, 格式为Unix Timestamp
|
|
608
|
+
- **EIPSet** (list) - 见 **EIPSetData** 模型定义
|
|
609
|
+
- **ExpireTime** (int) - 过期时间, 格式为Unix Timestamp
|
|
610
|
+
- **IPVersion** (str) - 共享带宽类型
|
|
611
|
+
- **Name** (str) - 共享带宽名称
|
|
612
|
+
- **ShareBandwidth** (int) - 共享带宽值(预付费)/共享带宽峰值(后付费), 单位Mbps
|
|
613
|
+
- **ShareBandwidthId** (str) - 共享带宽的资源ID
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
**EIPSetData**
|
|
617
|
+
- **Bandwidth** (int) - EIP带宽值
|
|
618
|
+
- **EIPAddr** (list) - 见 **EIPAddrSet** 模型定义
|
|
619
|
+
- **EIPId** (str) - EIP资源Id
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
**EIPAddrSet**
|
|
623
|
+
- **IP** (str) - 弹性IP地址
|
|
624
|
+
- **OperatorName** (str) - 运营商信息, 枚举值为: BGP: BGP; International: 国际.
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
"""
|
|
628
|
+
# build request
|
|
629
|
+
d = {
|
|
630
|
+
"ProjectId": self.config.project_id,
|
|
631
|
+
"Region": self.config.region,
|
|
632
|
+
}
|
|
633
|
+
req and d.update(req)
|
|
634
|
+
d = apis.DescribeShareBandwidthRequestSchema().dumps(d)
|
|
635
|
+
|
|
636
|
+
resp = self.invoke("DescribeShareBandwidth", d, **kwargs)
|
|
637
|
+
return apis.DescribeShareBandwidthResponseSchema().loads(resp)
|
|
638
|
+
|
|
639
|
+
def describe_share_bandwidth_price(
|
|
640
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
641
|
+
) -> dict:
|
|
642
|
+
"""DescribeShareBandwidthPrice - 获取共享带宽价格
|
|
643
|
+
|
|
644
|
+
**Request**
|
|
645
|
+
|
|
646
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
647
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
648
|
+
- **ChargeType** (str) - (Required) 付费方式, 预付费:Year 按年,Month 按月,Dynamic 按需;
|
|
649
|
+
- **ShareBandwidth** (int) - (Required) 共享带宽值
|
|
650
|
+
- **OperatorName** (str) - 香港地域支持:BGPPro和International。其他地域无需填写该字段
|
|
651
|
+
- **Quantity** (int) - 购买数量
|
|
652
|
+
|
|
653
|
+
**Response**
|
|
654
|
+
|
|
655
|
+
- **TotalPrice** (int) - 共享带宽总价格
|
|
656
|
+
|
|
657
|
+
"""
|
|
658
|
+
# build request
|
|
659
|
+
d = {
|
|
660
|
+
"ProjectId": self.config.project_id,
|
|
661
|
+
"Region": self.config.region,
|
|
662
|
+
}
|
|
663
|
+
req and d.update(req)
|
|
664
|
+
d = apis.DescribeShareBandwidthPriceRequestSchema().dumps(d)
|
|
665
|
+
|
|
666
|
+
resp = self.invoke("DescribeShareBandwidthPrice", d, **kwargs)
|
|
667
|
+
return apis.DescribeShareBandwidthPriceResponseSchema().loads(resp)
|
|
668
|
+
|
|
669
|
+
def describe_share_bandwidth_update_price(
|
|
670
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
671
|
+
) -> dict:
|
|
672
|
+
"""DescribeShareBandwidthUpdatePrice - 获取共享带宽升级价格
|
|
673
|
+
|
|
674
|
+
**Request**
|
|
675
|
+
|
|
676
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
677
|
+
- **ShareBandwidth** (int) - (Required) 共享带宽值
|
|
678
|
+
- **ShareBandwidthId** (str) - (Required) 共享带宽Id
|
|
679
|
+
|
|
680
|
+
**Response**
|
|
681
|
+
|
|
682
|
+
- **Price** (float) - 共享带宽升降级价格
|
|
683
|
+
|
|
684
|
+
"""
|
|
685
|
+
# build request
|
|
686
|
+
d = {
|
|
687
|
+
"Region": self.config.region,
|
|
688
|
+
}
|
|
689
|
+
req and d.update(req)
|
|
690
|
+
d = apis.DescribeShareBandwidthUpdatePriceRequestSchema().dumps(d)
|
|
691
|
+
|
|
692
|
+
resp = self.invoke("DescribeShareBandwidthUpdatePrice", d, **kwargs)
|
|
693
|
+
return apis.DescribeShareBandwidthUpdatePriceResponseSchema().loads(
|
|
694
|
+
resp
|
|
695
|
+
)
|
|
696
|
+
|
|
697
|
+
def disassociate_eip_with_share_bandwidth(
|
|
698
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
699
|
+
) -> dict:
|
|
700
|
+
"""DisassociateEIPWithShareBandwidth - 将EIP移出共享带宽
|
|
701
|
+
|
|
702
|
+
**Request**
|
|
703
|
+
|
|
704
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
705
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
706
|
+
- **Bandwidth** (int) - (Required) 移出共享带宽后,EIP的外网带宽, 单位为Mbps. 各地域带宽范围如下: 流量计费[1-200],带宽计费[1-800]
|
|
707
|
+
- **ShareBandwidthId** (str) - (Required) 共享带宽ID
|
|
708
|
+
- **EIPIds** (list) - EIP的资源Id;默认移出该共享带宽下所有的EIP
|
|
709
|
+
- **IPVersion** (str) - 共享带宽类型,IPv4或者IPv6,不传默认IPv4
|
|
710
|
+
- **PayMode** (str) - 移出共享带宽后,EIP的计费模式. 枚举值: "Traffic", 流量计费; "Bandwidth", 带宽计费; 默认为 "Bandwidth".
|
|
711
|
+
|
|
712
|
+
**Response**
|
|
713
|
+
|
|
714
|
+
|
|
715
|
+
"""
|
|
716
|
+
# build request
|
|
717
|
+
d = {
|
|
718
|
+
"ProjectId": self.config.project_id,
|
|
719
|
+
"Region": self.config.region,
|
|
720
|
+
}
|
|
721
|
+
req and d.update(req)
|
|
722
|
+
d = apis.DisassociateEIPWithShareBandwidthRequestSchema().dumps(d)
|
|
723
|
+
|
|
724
|
+
resp = self.invoke("DisassociateEIPWithShareBandwidth", d, **kwargs)
|
|
725
|
+
return apis.DisassociateEIPWithShareBandwidthResponseSchema().loads(
|
|
726
|
+
resp
|
|
727
|
+
)
|
|
728
|
+
|
|
729
|
+
def disassociate_firewall(
|
|
730
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
731
|
+
) -> dict:
|
|
732
|
+
"""DisassociateFirewall - 解绑资源上的防火墙
|
|
733
|
+
|
|
734
|
+
**Request**
|
|
735
|
+
|
|
736
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
737
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
738
|
+
- **FWId** (str) - (Required) 防火墙ID
|
|
739
|
+
- **ResourceId** (str) - (Required) 需要解绑的资源ID
|
|
740
|
+
- **ResourceType** (str) - (Required) 资源类型:ULB 表示负载均衡
|
|
741
|
+
|
|
742
|
+
**Response**
|
|
743
|
+
|
|
744
|
+
|
|
745
|
+
"""
|
|
746
|
+
# build request
|
|
747
|
+
d = {
|
|
748
|
+
"ProjectId": self.config.project_id,
|
|
749
|
+
"Region": self.config.region,
|
|
750
|
+
}
|
|
751
|
+
req and d.update(req)
|
|
752
|
+
d = apis.DisassociateFirewallRequestSchema().dumps(d)
|
|
753
|
+
|
|
754
|
+
resp = self.invoke("DisassociateFirewall", d, **kwargs)
|
|
755
|
+
return apis.DisassociateFirewallResponseSchema().loads(resp)
|
|
756
|
+
|
|
757
|
+
def get_eip_exclusive_utp_info(
|
|
758
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
759
|
+
) -> dict:
|
|
760
|
+
"""GetEIPExclusiveUTPInfo - 获取EIP专属流量包信息
|
|
761
|
+
|
|
762
|
+
**Request**
|
|
763
|
+
|
|
764
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
765
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
766
|
+
- **EIPId** (str) - (Required) EIP资源Id
|
|
767
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
768
|
+
|
|
769
|
+
**Response**
|
|
770
|
+
|
|
771
|
+
- **EIPExclusiveInfo** (dict) - 见 **EIPExclusiveInfo** 模型定义
|
|
772
|
+
|
|
773
|
+
**Response Model**
|
|
774
|
+
|
|
775
|
+
**EIPExclusiveInfo**
|
|
776
|
+
- **AccountId** (int) -
|
|
777
|
+
- **AvailableSize** (int) - 专属流量包剩余可用规格(单位MB)
|
|
778
|
+
- **CreateTime** (int) - 资源创建时间
|
|
779
|
+
- **EIPId** (str) - EIP资源Id
|
|
780
|
+
- **LastResetTime** (int) - 专属流量包上次重置时间
|
|
781
|
+
- **NextResetTime** (int) - 专属流量包下次重置时间
|
|
782
|
+
- **ResetPolicy** (str) - 专属流量包重置策略枚举:Day、Month、Year
|
|
783
|
+
- **TotalSize** (int) - 专属流量包总规格(单位MB)
|
|
784
|
+
|
|
785
|
+
|
|
786
|
+
"""
|
|
787
|
+
# build request
|
|
788
|
+
d = {
|
|
789
|
+
"ProjectId": self.config.project_id,
|
|
790
|
+
"Region": self.config.region,
|
|
791
|
+
}
|
|
792
|
+
req and d.update(req)
|
|
793
|
+
d = apis.GetEIPExclusiveUTPInfoRequestSchema().dumps(d)
|
|
794
|
+
|
|
795
|
+
resp = self.invoke("GetEIPExclusiveUTPInfo", d, **kwargs)
|
|
796
|
+
return apis.GetEIPExclusiveUTPInfoResponseSchema().loads(resp)
|
|
797
|
+
|
|
798
|
+
def get_eip_pay_mode(
|
|
799
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
800
|
+
) -> dict:
|
|
801
|
+
"""GetEIPPayMode - 获取弹性IP计费模式
|
|
802
|
+
|
|
803
|
+
**Request**
|
|
804
|
+
|
|
805
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
806
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
807
|
+
- **EIPId** (list) - (Required) 弹性IP的资源Id
|
|
808
|
+
|
|
809
|
+
**Response**
|
|
810
|
+
|
|
811
|
+
- **EIPPayMode** (list) - 见 **EIPPayModeSet** 模型定义
|
|
812
|
+
|
|
813
|
+
**Response Model**
|
|
814
|
+
|
|
815
|
+
**EIPPayModeSet**
|
|
816
|
+
- **EIPId** (str) - EIP的资源ID
|
|
817
|
+
- **EIPPayMode** (str) - EIP的计费模式. 枚举值为:Bandwidth, 带宽计费;Traffic, 流量计费; "ShareBandwidth",共享带宽模式
|
|
818
|
+
|
|
819
|
+
|
|
820
|
+
"""
|
|
821
|
+
# build request
|
|
822
|
+
d = {
|
|
823
|
+
"ProjectId": self.config.project_id,
|
|
824
|
+
"Region": self.config.region,
|
|
825
|
+
}
|
|
826
|
+
req and d.update(req)
|
|
827
|
+
d = apis.GetEIPPayModeRequestSchema().dumps(d)
|
|
828
|
+
|
|
829
|
+
resp = self.invoke("GetEIPPayMode", d, **kwargs)
|
|
830
|
+
return apis.GetEIPPayModeResponseSchema().loads(resp)
|
|
831
|
+
|
|
832
|
+
def get_eip_price(
|
|
833
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
834
|
+
) -> dict:
|
|
835
|
+
"""GetEIPPrice - 获取弹性IP价格
|
|
836
|
+
|
|
837
|
+
**Request**
|
|
838
|
+
|
|
839
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
840
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
841
|
+
- **Bandwidth** (int) - (Required) 弹性IP的外网带宽, 单位为Mbps, 范围 [0-800]
|
|
842
|
+
- **OperatorName** (str) - (Required) 弹性IP的线路如下: 国际: International BGP: Bgp 各地域允许的线路参数如下: cn-sh1: Bgp cn-sh2: Bgp cn-gd: Bgp cn-bj1: Bgp cn-bj2: Bgp hk: International us-ca: International th-bkk: International kr-seoul:International us-ws:International ge-fra:International sg:International tw-kh:International.其他海外线路均为 International,泉州为移动单线cn-qz:ChinaMobile
|
|
843
|
+
- **ChargeType** (str) - 付费方式, 枚举值为: Year, 按年付费; Month, 按月付费; Dynamic, 按时付费; 默认为获取三种价格
|
|
844
|
+
- **PayMode** (str) - 弹性IP计费方式r. 枚举值为: Traffic, 流量计费; Bandwidth, 带宽计费; "ShareBandwidth",共享带宽模式. 默认为Bandwidth
|
|
845
|
+
- **Quantity** (int) - 购买时长。默认: 1。按小时购买(Dynamic)时无需此参数。 月付时,此参数传0,代表了购买至月末
|
|
846
|
+
|
|
847
|
+
**Response**
|
|
848
|
+
|
|
849
|
+
- **PriceSet** (list) - 见 **EIPPriceDetailSet** 模型定义
|
|
850
|
+
|
|
851
|
+
**Response Model**
|
|
852
|
+
|
|
853
|
+
**EIPPriceDetailSet**
|
|
854
|
+
- **ChargeType** (str) - 弹性IP付费方式
|
|
855
|
+
- **OriginalPrice** (float) - 弹性IP的原价,单位“元”
|
|
856
|
+
- **Price** (float) - 购买弹性IP的实际价格, 单位"元"
|
|
857
|
+
- **PurchaseValue** (int) - 资源有效期, 以Unix Timestamp表示
|
|
858
|
+
|
|
859
|
+
|
|
860
|
+
"""
|
|
861
|
+
# build request
|
|
862
|
+
d = {
|
|
863
|
+
"ProjectId": self.config.project_id,
|
|
864
|
+
"Region": self.config.region,
|
|
865
|
+
}
|
|
866
|
+
req and d.update(req)
|
|
867
|
+
d = apis.GetEIPPriceRequestSchema().dumps(d)
|
|
868
|
+
|
|
869
|
+
resp = self.invoke("GetEIPPrice", d, **kwargs)
|
|
870
|
+
return apis.GetEIPPriceResponseSchema().loads(resp)
|
|
871
|
+
|
|
872
|
+
def get_eip_upgrade_price(
|
|
873
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
874
|
+
) -> dict:
|
|
875
|
+
"""GetEIPUpgradePrice - 获取弹性IP带宽改动价格
|
|
876
|
+
|
|
877
|
+
**Request**
|
|
878
|
+
|
|
879
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
880
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
881
|
+
- **Bandwidth** (int) - (Required) 弹性IP的外网带宽, 单位为Mbps, 范围 [1-800]
|
|
882
|
+
- **EIPId** (str) - (Required) 弹性IP的资源ID
|
|
883
|
+
|
|
884
|
+
**Response**
|
|
885
|
+
|
|
886
|
+
- **Price** (float) - 调整带宽后的EIP价格, 单位为"元", 如需退费此处为负值
|
|
887
|
+
|
|
888
|
+
"""
|
|
889
|
+
# build request
|
|
890
|
+
d = {
|
|
891
|
+
"ProjectId": self.config.project_id,
|
|
892
|
+
"Region": self.config.region,
|
|
893
|
+
}
|
|
894
|
+
req and d.update(req)
|
|
895
|
+
d = apis.GetEIPUpgradePriceRequestSchema().dumps(d)
|
|
896
|
+
|
|
897
|
+
resp = self.invoke("GetEIPUpgradePrice", d, **kwargs)
|
|
898
|
+
return apis.GetEIPUpgradePriceResponseSchema().loads(resp)
|
|
899
|
+
|
|
900
|
+
def get_throughput_daily_billing_info(
|
|
901
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
902
|
+
) -> dict:
|
|
903
|
+
"""GetThroughputDailyBillingInfo - 获取流量计费EIP每日流量计费信息
|
|
904
|
+
|
|
905
|
+
**Request**
|
|
906
|
+
|
|
907
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
908
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
909
|
+
- **EIPId** (str) - (Required) EIP的资源ID
|
|
910
|
+
- **EndTime** (int) - (Required) 查询结束时间时间戳
|
|
911
|
+
- **StartTime** (int) - (Required) 查询开始时间时间戳
|
|
912
|
+
|
|
913
|
+
**Response**
|
|
914
|
+
|
|
915
|
+
- **EIPId** (str) - 资源ID
|
|
916
|
+
- **Stats** (list) - 见 **ThroughputDailyBillingInfo** 模型定义
|
|
917
|
+
- **TotalOut** (int) - 计费总流量
|
|
918
|
+
|
|
919
|
+
**Response Model**
|
|
920
|
+
|
|
921
|
+
**ThroughputDailyBillingInfo**
|
|
922
|
+
- **BillingState** (str) - 是否已计费,“Yes”或者“No”
|
|
923
|
+
- **EndTime** (int) - 计费结束时间
|
|
924
|
+
- **QuantityOut** (int) - 计费流量,单位“GB”
|
|
925
|
+
- **StartTime** (int) - 计费开始时间
|
|
926
|
+
|
|
927
|
+
|
|
928
|
+
"""
|
|
929
|
+
# build request
|
|
930
|
+
d = {
|
|
931
|
+
"ProjectId": self.config.project_id,
|
|
932
|
+
"Region": self.config.region,
|
|
933
|
+
}
|
|
934
|
+
req and d.update(req)
|
|
935
|
+
d = apis.GetThroughputDailyBillingInfoRequestSchema().dumps(d)
|
|
936
|
+
|
|
937
|
+
resp = self.invoke("GetThroughputDailyBillingInfo", d, **kwargs)
|
|
938
|
+
return apis.GetThroughputDailyBillingInfoResponseSchema().loads(resp)
|
|
939
|
+
|
|
940
|
+
def grant_firewall(
|
|
941
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
942
|
+
) -> dict:
|
|
943
|
+
"""GrantFirewall - 将防火墙应用到资源上
|
|
944
|
+
|
|
945
|
+
**Request**
|
|
946
|
+
|
|
947
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
948
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
949
|
+
- **FWId** (str) - (Required) 防火墙资源ID
|
|
950
|
+
- **ResourceId** (str) - (Required) 所应用资源ID
|
|
951
|
+
- **ResourceType** (str) - (Required) 绑定防火墙的资源类型,枚举值为:"unatgw",NAT网关; "uhost",云主机; "upm",物理云主机; "hadoophost",hadoop节点; "fortresshost",堡垒机; "udhost",私有专区主机;"udockhost",容器;"dbaudit",数据库审计;”uni“,虚拟网卡;“cube”,Cube容器实例;“ulb”,负载均衡实例。
|
|
952
|
+
|
|
953
|
+
**Response**
|
|
954
|
+
|
|
955
|
+
|
|
956
|
+
"""
|
|
957
|
+
# build request
|
|
958
|
+
d = {
|
|
959
|
+
"ProjectId": self.config.project_id,
|
|
960
|
+
"Region": self.config.region,
|
|
961
|
+
}
|
|
962
|
+
req and d.update(req)
|
|
963
|
+
d = apis.GrantFirewallRequestSchema().dumps(d)
|
|
964
|
+
|
|
965
|
+
resp = self.invoke("GrantFirewall", d, **kwargs)
|
|
966
|
+
return apis.GrantFirewallResponseSchema().loads(resp)
|
|
967
|
+
|
|
968
|
+
def modify_eip_bandwidth(
|
|
969
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
970
|
+
) -> dict:
|
|
971
|
+
"""ModifyEIPBandwidth - 调整弹性IP的外网带宽
|
|
972
|
+
|
|
973
|
+
**Request**
|
|
974
|
+
|
|
975
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
976
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
977
|
+
- **Bandwidth** (int) - (Required) 弹性IP的外网带宽, 单位为Mbps. 各地域的带宽值范围如下:流量计费[1-200],带宽计费[1-800]
|
|
978
|
+
- **EIPId** (str) - (Required) 弹性IP的资源ID
|
|
979
|
+
|
|
980
|
+
**Response**
|
|
981
|
+
|
|
982
|
+
|
|
983
|
+
"""
|
|
984
|
+
# build request
|
|
985
|
+
d = {
|
|
986
|
+
"ProjectId": self.config.project_id,
|
|
987
|
+
"Region": self.config.region,
|
|
988
|
+
}
|
|
989
|
+
req and d.update(req)
|
|
990
|
+
d = apis.ModifyEIPBandwidthRequestSchema().dumps(d)
|
|
991
|
+
|
|
992
|
+
resp = self.invoke("ModifyEIPBandwidth", d, **kwargs)
|
|
993
|
+
return apis.ModifyEIPBandwidthResponseSchema().loads(resp)
|
|
994
|
+
|
|
995
|
+
def modify_eip_weight(
|
|
996
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
997
|
+
) -> dict:
|
|
998
|
+
"""ModifyEIPWeight - 修改弹性IP的外网出口权重
|
|
999
|
+
|
|
1000
|
+
**Request**
|
|
1001
|
+
|
|
1002
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1003
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1004
|
+
- **EIPId** (str) - (Required) 弹性IP的资源ID
|
|
1005
|
+
- **Weight** (int) - (Required) 外网出口权重,范围[0-100];该权重值只在EIP绑定资源为主机/网卡(非直通模式)时有效;同一个主机/网卡主动访问外网时,将使用权重最高的EIP作为源IP;权重相同时,行为不确定
|
|
1006
|
+
|
|
1007
|
+
**Response**
|
|
1008
|
+
|
|
1009
|
+
|
|
1010
|
+
"""
|
|
1011
|
+
# build request
|
|
1012
|
+
d = {
|
|
1013
|
+
"ProjectId": self.config.project_id,
|
|
1014
|
+
"Region": self.config.region,
|
|
1015
|
+
}
|
|
1016
|
+
req and d.update(req)
|
|
1017
|
+
d = apis.ModifyEIPWeightRequestSchema().dumps(d)
|
|
1018
|
+
|
|
1019
|
+
resp = self.invoke("ModifyEIPWeight", d, **kwargs)
|
|
1020
|
+
return apis.ModifyEIPWeightResponseSchema().loads(resp)
|
|
1021
|
+
|
|
1022
|
+
def release_eip(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
|
|
1023
|
+
"""ReleaseEIP - 释放弹性IP资源, 所释放弹性IP必须为非绑定状态.
|
|
1024
|
+
|
|
1025
|
+
**Request**
|
|
1026
|
+
|
|
1027
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
1028
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
1029
|
+
- **EIPId** (str) - (Required) 弹性IP的资源ID
|
|
1030
|
+
|
|
1031
|
+
**Response**
|
|
1032
|
+
|
|
1033
|
+
|
|
1034
|
+
"""
|
|
1035
|
+
# build request
|
|
1036
|
+
d = {
|
|
1037
|
+
"ProjectId": self.config.project_id,
|
|
1038
|
+
"Region": self.config.region,
|
|
1039
|
+
}
|
|
1040
|
+
req and d.update(req)
|
|
1041
|
+
d = apis.ReleaseEIPRequestSchema().dumps(d)
|
|
1042
|
+
|
|
1043
|
+
resp = self.invoke("ReleaseEIP", d, **kwargs)
|
|
1044
|
+
return apis.ReleaseEIPResponseSchema().loads(resp)
|
|
1045
|
+
|
|
1046
|
+
def release_share_bandwidth(
|
|
1047
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1048
|
+
) -> dict:
|
|
1049
|
+
"""ReleaseShareBandwidth - 关闭共享带宽
|
|
1050
|
+
|
|
1051
|
+
**Request**
|
|
1052
|
+
|
|
1053
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
1054
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
1055
|
+
- **EIPBandwidth** (int) - (Required) 关闭共享带宽后,各EIP恢复为的带宽值
|
|
1056
|
+
- **ShareBandwidthId** (str) - (Required) 共享带宽ID
|
|
1057
|
+
- **PayMode** (str) - 默认为 Bandwidth 带宽计费
|
|
1058
|
+
|
|
1059
|
+
**Response**
|
|
1060
|
+
|
|
1061
|
+
|
|
1062
|
+
"""
|
|
1063
|
+
# build request
|
|
1064
|
+
d = {
|
|
1065
|
+
"ProjectId": self.config.project_id,
|
|
1066
|
+
"Region": self.config.region,
|
|
1067
|
+
}
|
|
1068
|
+
req and d.update(req)
|
|
1069
|
+
d = apis.ReleaseShareBandwidthRequestSchema().dumps(d)
|
|
1070
|
+
|
|
1071
|
+
resp = self.invoke("ReleaseShareBandwidth", d, **kwargs)
|
|
1072
|
+
return apis.ReleaseShareBandwidthResponseSchema().loads(resp)
|
|
1073
|
+
|
|
1074
|
+
def resize_share_bandwidth(
|
|
1075
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1076
|
+
) -> dict:
|
|
1077
|
+
"""ResizeShareBandwidth - 调整共享带宽的带宽值
|
|
1078
|
+
|
|
1079
|
+
**Request**
|
|
1080
|
+
|
|
1081
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1082
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1083
|
+
- **ShareBandwidth** (int) - (Required) 带宽值,单位为Mb,范围 [20-5000] (最大值受地域限制)
|
|
1084
|
+
- **ShareBandwidthId** (str) - (Required) 共享带宽的Id
|
|
1085
|
+
|
|
1086
|
+
**Response**
|
|
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.ResizeShareBandwidthRequestSchema().dumps(d)
|
|
1097
|
+
|
|
1098
|
+
resp = self.invoke("ResizeShareBandwidth", d, **kwargs)
|
|
1099
|
+
return apis.ResizeShareBandwidthResponseSchema().loads(resp)
|
|
1100
|
+
|
|
1101
|
+
def set_eip_pay_mode(
|
|
1102
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1103
|
+
) -> dict:
|
|
1104
|
+
"""SetEIPPayMode - 设置弹性IP计费模式, 切换时会涉及付费/退费.
|
|
1105
|
+
|
|
1106
|
+
**Request**
|
|
1107
|
+
|
|
1108
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
1109
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
1110
|
+
- **Bandwidth** (int) - (Required) 调整的目标带宽值, 单位Mbps. 各地域的带宽值范围如下: 流量计费[1-200],其余情况[1-800]
|
|
1111
|
+
- **EIPId** (str) - (Required) 弹性IP的资源Id
|
|
1112
|
+
- **PayMode** (str) - (Required) 计费模式. 枚举值:"Traffic", 流量计费模式; "Bandwidth", 带宽计费模式
|
|
1113
|
+
|
|
1114
|
+
**Response**
|
|
1115
|
+
|
|
1116
|
+
|
|
1117
|
+
"""
|
|
1118
|
+
# build request
|
|
1119
|
+
d = {
|
|
1120
|
+
"ProjectId": self.config.project_id,
|
|
1121
|
+
"Region": self.config.region,
|
|
1122
|
+
}
|
|
1123
|
+
req and d.update(req)
|
|
1124
|
+
d = apis.SetEIPPayModeRequestSchema().dumps(d)
|
|
1125
|
+
|
|
1126
|
+
resp = self.invoke("SetEIPPayMode", d, **kwargs)
|
|
1127
|
+
return apis.SetEIPPayModeResponseSchema().loads(resp)
|
|
1128
|
+
|
|
1129
|
+
def un_bind_eip(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
|
|
1130
|
+
"""UnBindEIP - 将弹性IP从资源上解绑
|
|
1131
|
+
|
|
1132
|
+
**Request**
|
|
1133
|
+
|
|
1134
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
1135
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
1136
|
+
- **EIPId** (str) - (Required) 弹性IP的资源Id
|
|
1137
|
+
- **ResourceId** (str) - (Required) 弹性IP请求解绑的资源ID
|
|
1138
|
+
- **ResourceType** (str) - (Required) 弹性IP请求解绑的资源类型, 枚举值为: uhost: 云主机; ulb, 负载均衡器 upm: 物理机; hadoophost: 大数据集群;fortresshost:堡垒机;udockhost:容器;udhost:私有专区主机;natgw:NAT网关;udb:udb;vpngw:ipsec vpn;ucdr:云灾备;dbaudit:数据库审计;
|
|
1139
|
+
|
|
1140
|
+
**Response**
|
|
1141
|
+
|
|
1142
|
+
|
|
1143
|
+
"""
|
|
1144
|
+
# build request
|
|
1145
|
+
d = {
|
|
1146
|
+
"ProjectId": self.config.project_id,
|
|
1147
|
+
"Region": self.config.region,
|
|
1148
|
+
}
|
|
1149
|
+
req and d.update(req)
|
|
1150
|
+
d = apis.UnBindEIPRequestSchema().dumps(d)
|
|
1151
|
+
|
|
1152
|
+
resp = self.invoke("UnBindEIP", d, **kwargs)
|
|
1153
|
+
return apis.UnBindEIPResponseSchema().loads(resp)
|
|
1154
|
+
|
|
1155
|
+
def update_eip_attribute(
|
|
1156
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1157
|
+
) -> dict:
|
|
1158
|
+
"""UpdateEIPAttribute - 更新弹性IP名称,业务组,备注等属性字段
|
|
1159
|
+
|
|
1160
|
+
**Request**
|
|
1161
|
+
|
|
1162
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1163
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1164
|
+
- **EIPId** (str) - (Required) EIP资源ID
|
|
1165
|
+
- **Name** (str) - 名字(Name Tag Remark都为空则报错)
|
|
1166
|
+
- **Remark** (str) - 备注
|
|
1167
|
+
- **Tag** (str) - 业务
|
|
1168
|
+
|
|
1169
|
+
**Response**
|
|
1170
|
+
|
|
1171
|
+
|
|
1172
|
+
"""
|
|
1173
|
+
# build request
|
|
1174
|
+
d = {
|
|
1175
|
+
"ProjectId": self.config.project_id,
|
|
1176
|
+
"Region": self.config.region,
|
|
1177
|
+
}
|
|
1178
|
+
req and d.update(req)
|
|
1179
|
+
d = apis.UpdateEIPAttributeRequestSchema().dumps(d)
|
|
1180
|
+
|
|
1181
|
+
resp = self.invoke("UpdateEIPAttribute", d, **kwargs)
|
|
1182
|
+
return apis.UpdateEIPAttributeResponseSchema().loads(resp)
|
|
1183
|
+
|
|
1184
|
+
def update_firewall(
|
|
1185
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1186
|
+
) -> dict:
|
|
1187
|
+
"""UpdateFirewall - 更新防火墙规则
|
|
1188
|
+
|
|
1189
|
+
**Request**
|
|
1190
|
+
|
|
1191
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1192
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1193
|
+
- **FWId** (str) - (Required) 防火墙资源ID
|
|
1194
|
+
- **Rule** (list) - (Required) 防火墙规则,例如:TCP|22|192.168.1.1/22|DROP|LOW|禁用22端口,第一个参数代表协议:第二个参数代表端口号,第三个参数为ip,第四个参数为ACCEPT(接受)和DROP(拒绝),第五个参数优先级:HIGH(高),MEDIUM(中),LOW(低),第六个参数为该条规则的自定义备注, 备注最大长度64
|
|
1195
|
+
|
|
1196
|
+
**Response**
|
|
1197
|
+
|
|
1198
|
+
- **FWId** (str) - 防火墙id
|
|
1199
|
+
|
|
1200
|
+
"""
|
|
1201
|
+
# build request
|
|
1202
|
+
d = {
|
|
1203
|
+
"ProjectId": self.config.project_id,
|
|
1204
|
+
"Region": self.config.region,
|
|
1205
|
+
}
|
|
1206
|
+
req and d.update(req)
|
|
1207
|
+
d = apis.UpdateFirewallRequestSchema().dumps(d)
|
|
1208
|
+
|
|
1209
|
+
resp = self.invoke("UpdateFirewall", d, **kwargs)
|
|
1210
|
+
return apis.UpdateFirewallResponseSchema().loads(resp)
|
|
1211
|
+
|
|
1212
|
+
def update_firewall_attribute(
|
|
1213
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1214
|
+
) -> dict:
|
|
1215
|
+
"""UpdateFirewallAttribute - 更新防火墙规则
|
|
1216
|
+
|
|
1217
|
+
**Request**
|
|
1218
|
+
|
|
1219
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
1220
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
1221
|
+
- **FWId** (str) - (Required) 防火墙资源ID
|
|
1222
|
+
- **Name** (str) - 防火墙名称,默认为空,为空则不做修改。Name,Tag,Remark必须填写1个及以上
|
|
1223
|
+
- **Remark** (str) - 防火墙备注,默认为空,为空则不做修改。Name,Tag,Remark必须填写1个及以上
|
|
1224
|
+
- **Tag** (str) - 防火墙业务组,默认为空,为空则不做修改。Name,Tag,Remark必须填写1个及以上
|
|
1225
|
+
|
|
1226
|
+
**Response**
|
|
1227
|
+
|
|
1228
|
+
|
|
1229
|
+
"""
|
|
1230
|
+
# build request
|
|
1231
|
+
d = {
|
|
1232
|
+
"ProjectId": self.config.project_id,
|
|
1233
|
+
"Region": self.config.region,
|
|
1234
|
+
}
|
|
1235
|
+
req and d.update(req)
|
|
1236
|
+
d = apis.UpdateFirewallAttributeRequestSchema().dumps(d)
|
|
1237
|
+
|
|
1238
|
+
resp = self.invoke("UpdateFirewallAttribute", d, **kwargs)
|
|
1239
|
+
return apis.UpdateFirewallAttributeResponseSchema().loads(resp)
|
|
1240
|
+
|
|
1241
|
+
_deprecated = {
|
|
1242
|
+
"allocate_e_ip": "allocate_eip",
|
|
1243
|
+
"associate_e_ip_with_share_bandwidth": "associate_eip_with_share_bandwidth",
|
|
1244
|
+
"bind_e_ip": "bind_eip",
|
|
1245
|
+
"describe_e_ip": "describe_eip",
|
|
1246
|
+
"disassociate_e_ip_with_share_bandwidth": "disassociate_eip_with_share_bandwidth",
|
|
1247
|
+
"get_e_ip_pay_mode": "get_eip_pay_mode",
|
|
1248
|
+
"get_e_ip_price": "get_eip_price",
|
|
1249
|
+
"get_e_ip_upgrade_price": "get_eip_upgrade_price",
|
|
1250
|
+
"modify_e_ip_bandwidth": "modify_eip_bandwidth",
|
|
1251
|
+
"modify_e_ip_weight": "modify_eip_weight",
|
|
1252
|
+
"release_e_ip": "release_eip",
|
|
1253
|
+
"set_e_ip_pay_mode": "set_eip_pay_mode",
|
|
1254
|
+
"un_bind_e_ip": "un_bind_eip",
|
|
1255
|
+
"update_e_ip_attribute": "update_eip_attribute",
|
|
1256
|
+
"release_v_ip": "release_vip",
|
|
1257
|
+
"allocate_v_ip": "allocate_vip",
|
|
1258
|
+
"describe_v_ip": "describe_vip",
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
def __getattr__(self, item):
|
|
1262
|
+
if item in self._deprecated:
|
|
1263
|
+
instead_of = self._deprecated[item]
|
|
1264
|
+
msg = (
|
|
1265
|
+
"the method {} is deprecated, "
|
|
1266
|
+
"please use {} instead, "
|
|
1267
|
+
"this method will remove after 0.5.0 version"
|
|
1268
|
+
)
|
|
1269
|
+
self.logger.warning(msg.format(item, instead_of))
|
|
1270
|
+
return getattr(self, self._deprecated[item])
|
|
1271
|
+
|
|
1272
|
+
raise AttributeError(
|
|
1273
|
+
(
|
|
1274
|
+
"'{}' object has no attribute '{}'".format(
|
|
1275
|
+
self.__class__.__name__, item
|
|
1276
|
+
)
|
|
1277
|
+
)
|
|
1278
|
+
)
|