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,127 @@
|
|
|
1
|
+
""" Code is generated by ucloud-model, DO NOT EDIT IT. """
|
|
2
|
+
|
|
3
|
+
from ucloud.core.typesystem import schema, fields
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class AccessKeySchema(schema.ResponseSchema):
|
|
7
|
+
"""AccessKey - 密钥信息实例"""
|
|
8
|
+
|
|
9
|
+
fields = {
|
|
10
|
+
"AccessKeyID": fields.Str(required=False, load_from="AccessKeyID"),
|
|
11
|
+
"AccessKeySecret": fields.Str(
|
|
12
|
+
required=False, load_from="AccessKeySecret"
|
|
13
|
+
),
|
|
14
|
+
"CreatedAt": fields.Int(required=False, load_from="CreatedAt"),
|
|
15
|
+
"DeletedAt": fields.Int(required=False, load_from="DeletedAt"),
|
|
16
|
+
"Description": fields.Str(required=False, load_from="Description"),
|
|
17
|
+
"ExpiredAt": fields.Int(required=False, load_from="ExpiredAt"),
|
|
18
|
+
"Status": fields.Str(required=False, load_from="Status"),
|
|
19
|
+
"UpdatedAt": fields.Int(required=False, load_from="UpdatedAt"),
|
|
20
|
+
"UserId": fields.Int(required=False, load_from="UserId"),
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class GroupSchema(schema.ResponseSchema):
|
|
25
|
+
"""Group - 用户组模型"""
|
|
26
|
+
|
|
27
|
+
fields = {
|
|
28
|
+
"CreatedAt": fields.Int(required=False, load_from="CreatedAt"),
|
|
29
|
+
"Description": fields.Str(required=True, load_from="Description"),
|
|
30
|
+
"GroupName": fields.Str(required=True, load_from="GroupName"),
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class IAMPolicySchema(schema.ResponseSchema):
|
|
35
|
+
"""IAMPolicy - 获取IAM权限策略详情"""
|
|
36
|
+
|
|
37
|
+
fields = {
|
|
38
|
+
"CreatedAt": fields.Int(required=False, load_from="CreatedAt"),
|
|
39
|
+
"Description": fields.Str(required=False, load_from="Description"),
|
|
40
|
+
"Document": fields.Str(required=False, load_from="Document"),
|
|
41
|
+
"PolicyName": fields.Str(required=False, load_from="PolicyName"),
|
|
42
|
+
"PolicyURN": fields.Str(required=False, load_from="PolicyURN"),
|
|
43
|
+
"ScopeType": fields.Str(required=False, load_from="ScopeType"),
|
|
44
|
+
"UpdatedAt": fields.Int(required=False, load_from="UpdatedAt"),
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class LoginProfileSchema(schema.ResponseSchema):
|
|
49
|
+
"""LoginProfile - 登录资料"""
|
|
50
|
+
|
|
51
|
+
fields = {
|
|
52
|
+
"MFABindRequired": fields.Bool(
|
|
53
|
+
required=True, load_from="MFABindRequired"
|
|
54
|
+
),
|
|
55
|
+
"MaxPasswordAge": fields.Int(required=True, load_from="MaxPasswordAge"),
|
|
56
|
+
"Status": fields.Str(required=True, load_from="Status"),
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class UserSchema(schema.ResponseSchema):
|
|
61
|
+
"""User - 用户模型"""
|
|
62
|
+
|
|
63
|
+
fields = {
|
|
64
|
+
"CreatedAt": fields.Int(required=False, load_from="CreatedAt"),
|
|
65
|
+
"DisplayName": fields.Str(required=False, load_from="DisplayName"),
|
|
66
|
+
"Email": fields.Str(required=True, load_from="Email"),
|
|
67
|
+
"Status": fields.Str(required=False, load_from="Status"),
|
|
68
|
+
"UserName": fields.Str(required=True, load_from="UserName"),
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class EntitySchema(schema.ResponseSchema):
|
|
73
|
+
"""Entity - 权限策略的实体"""
|
|
74
|
+
|
|
75
|
+
fields = {
|
|
76
|
+
"AttachedAt": fields.Int(required=True, load_from="AttachedAt"),
|
|
77
|
+
"EntityKind": fields.Str(required=True, load_from="EntityKind"),
|
|
78
|
+
"EntityName": fields.Str(required=True, load_from="EntityName"),
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
class PolicySchema(schema.ResponseSchema):
|
|
83
|
+
"""Policy - 权限策略"""
|
|
84
|
+
|
|
85
|
+
fields = {
|
|
86
|
+
"AttachedAt": fields.Int(required=False, load_from="AttachedAt"),
|
|
87
|
+
"CreatedAt": fields.Int(required=False, load_from="CreatedAt"),
|
|
88
|
+
"Description": fields.Str(required=False, load_from="Description"),
|
|
89
|
+
"PolicyName": fields.Str(required=True, load_from="PolicyName"),
|
|
90
|
+
"PolicyURN": fields.Str(required=True, load_from="PolicyURN"),
|
|
91
|
+
"ProjectID": fields.Str(required=False, load_from="ProjectID"),
|
|
92
|
+
"Scope": fields.Str(required=False, load_from="Scope"),
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class ProjectSchema(schema.ResponseSchema):
|
|
97
|
+
"""Project - 项目模型"""
|
|
98
|
+
|
|
99
|
+
fields = {
|
|
100
|
+
"CreatedAt": fields.Int(required=True, load_from="CreatedAt"),
|
|
101
|
+
"ProjectID": fields.Str(required=True, load_from="ProjectID"),
|
|
102
|
+
"ProjectName": fields.Str(required=True, load_from="ProjectName"),
|
|
103
|
+
"UserCount": fields.Int(required=True, load_from="UserCount"),
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
class UsersSchema(schema.ResponseSchema):
|
|
108
|
+
"""Users - 用户模型"""
|
|
109
|
+
|
|
110
|
+
fields = {
|
|
111
|
+
"CreatedAt": fields.Int(required=False, load_from="CreatedAt"),
|
|
112
|
+
"DisplayName": fields.Str(required=False, load_from="DisplayName"),
|
|
113
|
+
"Email": fields.Str(required=True, load_from="Email"),
|
|
114
|
+
"Status": fields.Str(required=False, load_from="Status"),
|
|
115
|
+
"UserName": fields.Str(required=True, load_from="UserName"),
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
class UserForGroupSchema(schema.ResponseSchema):
|
|
120
|
+
"""UserForGroup - 用户模型"""
|
|
121
|
+
|
|
122
|
+
fields = {
|
|
123
|
+
"DisplayName": fields.Str(required=False, load_from="DisplayName"),
|
|
124
|
+
"Email": fields.Str(required=True, load_from="Email"),
|
|
125
|
+
"JoinedAt": fields.Int(required=False, load_from="JoinedAt"),
|
|
126
|
+
"UserName": fields.Str(required=True, load_from="UserName"),
|
|
127
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,522 @@
|
|
|
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.ipsecvpn.schemas import apis
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class IPSecVPNClient(Client):
|
|
11
|
+
def __init__(
|
|
12
|
+
self, config: dict, transport=None, middleware=None, logger=None
|
|
13
|
+
):
|
|
14
|
+
super(IPSecVPNClient, self).__init__(
|
|
15
|
+
config, transport, middleware, logger
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
def create_remote_vpn_gateway(
|
|
19
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
20
|
+
) -> dict:
|
|
21
|
+
"""CreateRemoteVPNGateway - 创建客户VPN网关
|
|
22
|
+
|
|
23
|
+
**Request**
|
|
24
|
+
|
|
25
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
26
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
27
|
+
- **RemoteVPNGatewayAddr** (str) - (Required) 客户VPN网关地址
|
|
28
|
+
- **RemoteVPNGatewayName** (str) - (Required) 客户VPN网关名称
|
|
29
|
+
- **Remark** (str) - 备注,默认为空
|
|
30
|
+
- **Tag** (str) - 业务组名称,默认为 "Default"
|
|
31
|
+
|
|
32
|
+
**Response**
|
|
33
|
+
|
|
34
|
+
- **RemoteVPNGatewayId** (str) - 新建客户VPN网关的资源ID
|
|
35
|
+
|
|
36
|
+
"""
|
|
37
|
+
# build request
|
|
38
|
+
d = {
|
|
39
|
+
"ProjectId": self.config.project_id,
|
|
40
|
+
"Region": self.config.region,
|
|
41
|
+
}
|
|
42
|
+
req and d.update(req)
|
|
43
|
+
d = apis.CreateRemoteVPNGatewayRequestSchema().dumps(d)
|
|
44
|
+
|
|
45
|
+
# build options
|
|
46
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
47
|
+
|
|
48
|
+
resp = self.invoke("CreateRemoteVPNGateway", d, **kwargs)
|
|
49
|
+
return apis.CreateRemoteVPNGatewayResponseSchema().loads(resp)
|
|
50
|
+
|
|
51
|
+
def create_vpn_gateway(
|
|
52
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
53
|
+
) -> dict:
|
|
54
|
+
"""CreateVPNGateway - 创建VPN网关
|
|
55
|
+
|
|
56
|
+
**Request**
|
|
57
|
+
|
|
58
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
59
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
60
|
+
- **Grade** (str) - (Required) 购买的VPN网关规格,枚举值为: Standard, 标准型; Enhanced, 增强型
|
|
61
|
+
- **VPCId** (str) - (Required) 新建VPN网关所属VPC的资源ID
|
|
62
|
+
- **VPNGatewayName** (str) - (Required) 新建VPN网关名称
|
|
63
|
+
- **BusinessId** (str) - 业务组ID
|
|
64
|
+
- **ChargeType** (str) - 付费方式, 枚举值为: Year, 按年付费; Month, 按月付费;Dynamic, 按需付费(需开启权限);Trial, 试用(需开启权限);默认为按月付费
|
|
65
|
+
- **CouponId** (str) - 代金券ID, 默认不使用
|
|
66
|
+
- **EIPId** (str) - 若要绑定EIP,在此填上EIP的资源ID
|
|
67
|
+
- **Quantity** (int) - 购买时长, 默认: 1
|
|
68
|
+
- **Remark** (str) - 备注,默认为空
|
|
69
|
+
- **Tag** (str) - 业务组名称,默认为 "Default"
|
|
70
|
+
|
|
71
|
+
**Response**
|
|
72
|
+
|
|
73
|
+
- **VPNGatewayId** (str) - 新建VPN网关的资源ID
|
|
74
|
+
|
|
75
|
+
"""
|
|
76
|
+
# build request
|
|
77
|
+
d = {
|
|
78
|
+
"ProjectId": self.config.project_id,
|
|
79
|
+
"Region": self.config.region,
|
|
80
|
+
}
|
|
81
|
+
req and d.update(req)
|
|
82
|
+
d = apis.CreateVPNGatewayRequestSchema().dumps(d)
|
|
83
|
+
|
|
84
|
+
# build options
|
|
85
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
86
|
+
|
|
87
|
+
resp = self.invoke("CreateVPNGateway", d, **kwargs)
|
|
88
|
+
return apis.CreateVPNGatewayResponseSchema().loads(resp)
|
|
89
|
+
|
|
90
|
+
def create_vpn_tunnel(
|
|
91
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
92
|
+
) -> dict:
|
|
93
|
+
"""CreateVPNTunnel - 创建VPN隧道
|
|
94
|
+
|
|
95
|
+
**Request**
|
|
96
|
+
|
|
97
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
98
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
99
|
+
- **IKEPreSharedKey** (str) - (Required) 预共享密钥
|
|
100
|
+
- **IKEVersion** (str) - (Required) ike版本,枚举值: "IKE V1","IKE V2",默认v1
|
|
101
|
+
- **IPSecLocalSubnetIds** (list) - (Required) 指定VPN连接的本地子网的资源ID,最多可填写10个。
|
|
102
|
+
- **IPSecRemoteSubnets** (list) - (Required) 指定VPN连接的客户网段,最多可填写20个。
|
|
103
|
+
- **RemoteVPNGatewayId** (str) - (Required) 客户VPN网关的资源ID
|
|
104
|
+
- **VPCId** (str) - (Required) vpcId
|
|
105
|
+
- **VPNGatewayId** (str) - (Required) VPN网关的资源ID
|
|
106
|
+
- **VPNTunnelName** (str) - (Required) VPN隧道名称
|
|
107
|
+
- **IKEAuthenticationAlgorithm** (str) - IKE协商过程中使用的认证算法,"md5", "sha1", "sha2-256"。默认值为“sha1”
|
|
108
|
+
- **IKEDhGroup** (str) - IKE协商过程中使用的DH组,枚举值,"1", "2", "5", "14", "15", "16"。默认为“15”
|
|
109
|
+
- **IKEEncryptionAlgorithm** (str) - IKE协商过程中使用的加密算法,枚举值,"aes128", "aes192", "aes256", "aes512", "3des"。默认值为“aes128”
|
|
110
|
+
- **IKEExchangeMode** (str) - IKE协商过程中使用的模式,枚举值,主模式,“main”;野蛮模式,“aggressive”。IKEV1默认为主模式“main”,IKEV2时不使用该参数。
|
|
111
|
+
- **IKELocalId** (str) - 本端标识。枚举值,自动识别,“auto”;IP地址或域名。默认为自动识别“auto”。IKEV2必填该参数
|
|
112
|
+
- **IKERemoteId** (str) - 客户端标识。枚举值,自动识别,“auto”;IP地址或域名。默认为“自动识别“auto”。IKEV2必填该参数
|
|
113
|
+
- **IKESALifetime** (str) - IKE中SA的生存时间,可填写范围为600-604800。默认为86400。
|
|
114
|
+
- **IPSecAuthenticationAlgorithm** (str) - IPSec隧道中使用的认证算法,枚举值,"md5", "sha1","sha2-256"。默认值为“sha1”
|
|
115
|
+
- **IPSecCloseAction** (str) - IPSec隧道关闭后的处理动作,枚举值:“none”,流量触发;“restart”,自动重联,默认为none
|
|
116
|
+
- **IPSecEncryptionAlgorithm** (str) - IPSec隧道中使用的加密算法,枚举值,"aes128", "aes192", "aes256", "aes512", "3des"。默认值为“aes128”
|
|
117
|
+
- **IPSecPFSDhGroup** (str) - IPSec的PFS是否开启,枚举值,,不开启,"disable";数字表示DH组, "1", "2", "5", "14", "15", "16"。默认为“disable”。
|
|
118
|
+
- **IPSecProtocol** (str) - 使用的安全协议,枚举值,“esp”,“ah”。默认为“esp”
|
|
119
|
+
- **IPSecSALifetime** (str) - IPSec中SA的生存时间,可填写范围为1200 - 604800。默认为3600
|
|
120
|
+
- **IPSecSALifetimeBytes** (str) - IPSec中SA的生存时间(以字节计)。可选为8000 – 20000000。默认使用SA生存时间,
|
|
121
|
+
- **Remark** (str) - 备注,默认为空
|
|
122
|
+
- **Tag** (str) - 业务组,默认为“Default”
|
|
123
|
+
|
|
124
|
+
**Response**
|
|
125
|
+
|
|
126
|
+
- **VPNTunnelId** (str) - VPN隧道的资源ID
|
|
127
|
+
|
|
128
|
+
"""
|
|
129
|
+
# build request
|
|
130
|
+
d = {
|
|
131
|
+
"ProjectId": self.config.project_id,
|
|
132
|
+
"Region": self.config.region,
|
|
133
|
+
}
|
|
134
|
+
req and d.update(req)
|
|
135
|
+
d = apis.CreateVPNTunnelRequestSchema().dumps(d)
|
|
136
|
+
|
|
137
|
+
# build options
|
|
138
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
139
|
+
|
|
140
|
+
resp = self.invoke("CreateVPNTunnel", d, **kwargs)
|
|
141
|
+
return apis.CreateVPNTunnelResponseSchema().loads(resp)
|
|
142
|
+
|
|
143
|
+
def delete_remote_vpn_gateway(
|
|
144
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
145
|
+
) -> dict:
|
|
146
|
+
"""DeleteRemoteVPNGateway - 删除客户VPN网关
|
|
147
|
+
|
|
148
|
+
**Request**
|
|
149
|
+
|
|
150
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
151
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
152
|
+
- **RemoteVPNGatewayId** (str) - (Required) 客户VPN网关的资源ID
|
|
153
|
+
|
|
154
|
+
**Response**
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
"""
|
|
158
|
+
# build request
|
|
159
|
+
d = {
|
|
160
|
+
"ProjectId": self.config.project_id,
|
|
161
|
+
"Region": self.config.region,
|
|
162
|
+
}
|
|
163
|
+
req and d.update(req)
|
|
164
|
+
d = apis.DeleteRemoteVPNGatewayRequestSchema().dumps(d)
|
|
165
|
+
|
|
166
|
+
resp = self.invoke("DeleteRemoteVPNGateway", d, **kwargs)
|
|
167
|
+
return apis.DeleteRemoteVPNGatewayResponseSchema().loads(resp)
|
|
168
|
+
|
|
169
|
+
def delete_vpn_gateway(
|
|
170
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
171
|
+
) -> dict:
|
|
172
|
+
"""DeleteVPNGateway - 删除VPN网关
|
|
173
|
+
|
|
174
|
+
**Request**
|
|
175
|
+
|
|
176
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
177
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
178
|
+
- **VPNGatewayId** (str) - (Required) VPN网关的资源ID
|
|
179
|
+
- **ReleaseEip** (bool) - 删除VPN时是否一并释放EIP。false,只解绑EIP不删除EIP;true,解绑并释放EIP。默认是false
|
|
180
|
+
|
|
181
|
+
**Response**
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
"""
|
|
185
|
+
# build request
|
|
186
|
+
d = {
|
|
187
|
+
"ProjectId": self.config.project_id,
|
|
188
|
+
"Region": self.config.region,
|
|
189
|
+
}
|
|
190
|
+
req and d.update(req)
|
|
191
|
+
d = apis.DeleteVPNGatewayRequestSchema().dumps(d)
|
|
192
|
+
|
|
193
|
+
resp = self.invoke("DeleteVPNGateway", d, **kwargs)
|
|
194
|
+
return apis.DeleteVPNGatewayResponseSchema().loads(resp)
|
|
195
|
+
|
|
196
|
+
def delete_vpn_tunnel(
|
|
197
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
198
|
+
) -> dict:
|
|
199
|
+
"""DeleteVPNTunnel - 删除VPN隧道
|
|
200
|
+
|
|
201
|
+
**Request**
|
|
202
|
+
|
|
203
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
204
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
205
|
+
- **VPNTunnelId** (str) - (Required) VPN隧道的资源ID
|
|
206
|
+
|
|
207
|
+
**Response**
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
"""
|
|
211
|
+
# build request
|
|
212
|
+
d = {
|
|
213
|
+
"ProjectId": self.config.project_id,
|
|
214
|
+
"Region": self.config.region,
|
|
215
|
+
}
|
|
216
|
+
req and d.update(req)
|
|
217
|
+
d = apis.DeleteVPNTunnelRequestSchema().dumps(d)
|
|
218
|
+
|
|
219
|
+
resp = self.invoke("DeleteVPNTunnel", d, **kwargs)
|
|
220
|
+
return apis.DeleteVPNTunnelResponseSchema().loads(resp)
|
|
221
|
+
|
|
222
|
+
def describe_remote_vpn_gateway(
|
|
223
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
224
|
+
) -> dict:
|
|
225
|
+
"""DescribeRemoteVPNGateway - 获取客户VPN网关信息
|
|
226
|
+
|
|
227
|
+
**Request**
|
|
228
|
+
|
|
229
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
230
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
231
|
+
- **Limit** (int) - 数据分页值, 默认为20
|
|
232
|
+
- **Offset** (int) - 数据偏移量, 默认为0
|
|
233
|
+
- **RemoteVPNGatewayIds** (list) - 客户VPN网关的资源ID,例如RemoteVPNGatewayIds.0代表希望获取客户VPN网关1的信息,RemoteVPNGatewayIds.1代表客户VPN网关2,如果为空,则返回当前Region中所有客户VPN网关实例的信息
|
|
234
|
+
- **Tag** (str) - 业务组名称,若指定则返回业务组下所有客户VPN网关信息
|
|
235
|
+
|
|
236
|
+
**Response**
|
|
237
|
+
|
|
238
|
+
- **DataSet** (list) - 见 **RemoteVPNGatewayDataSet** 模型定义
|
|
239
|
+
- **TotalCount** (int) - 符合条件的客户VPN网关总数
|
|
240
|
+
|
|
241
|
+
**Response Model**
|
|
242
|
+
|
|
243
|
+
**RemoteVPNGatewayDataSet**
|
|
244
|
+
- **CreateTime** (int) - 创建时间
|
|
245
|
+
- **Remark** (str) - 备注
|
|
246
|
+
- **RemoteVPNGatewayAddr** (str) - 客户网关IP地址
|
|
247
|
+
- **RemoteVPNGatewayId** (str) - 客户网关ID
|
|
248
|
+
- **RemoteVPNGatewayName** (str) - 客户网关名称
|
|
249
|
+
- **Tag** (str) - 用户组
|
|
250
|
+
- **TunnelCount** (int) - 活跃的隧道数量
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
"""
|
|
254
|
+
# build request
|
|
255
|
+
d = {
|
|
256
|
+
"ProjectId": self.config.project_id,
|
|
257
|
+
"Region": self.config.region,
|
|
258
|
+
}
|
|
259
|
+
req and d.update(req)
|
|
260
|
+
d = apis.DescribeRemoteVPNGatewayRequestSchema().dumps(d)
|
|
261
|
+
|
|
262
|
+
resp = self.invoke("DescribeRemoteVPNGateway", d, **kwargs)
|
|
263
|
+
return apis.DescribeRemoteVPNGatewayResponseSchema().loads(resp)
|
|
264
|
+
|
|
265
|
+
def describe_vpn_gateway(
|
|
266
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
267
|
+
) -> dict:
|
|
268
|
+
"""DescribeVPNGateway - 获取VPN网关信息
|
|
269
|
+
|
|
270
|
+
**Request**
|
|
271
|
+
|
|
272
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
273
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
274
|
+
- **Limit** (int) - 数据分页值。默认为20
|
|
275
|
+
- **Offset** (int) - 数据偏移量。默认为0
|
|
276
|
+
- **Tag** (str) - 业务组名称,若指定则返回指定的业务组下的所有VPN网关的信息。
|
|
277
|
+
- **VPCId** (str) - VPC的资源ID,返回指定的VPC下的所有VPN网关的信息。默认返回当前Region中所有VPN网关实例的信息
|
|
278
|
+
- **VPNGatewayIds** (list) - VPN网关的资源ID,例如VPNGatewayIds.0代表希望获取VPN网关1的信息,VPNGatewayIds.1代表VPN网关2,如果为空,则返回当前Region中所有VPN网关的信息
|
|
279
|
+
|
|
280
|
+
**Response**
|
|
281
|
+
|
|
282
|
+
- **DataSet** (list) - 见 **VPNGatewayDataSet** 模型定义
|
|
283
|
+
- **TotalCount** (int) - 满足条件的VPN网关总数
|
|
284
|
+
|
|
285
|
+
**Response Model**
|
|
286
|
+
|
|
287
|
+
**VPNGatewayDataSet**
|
|
288
|
+
- **AutoRenew** (str) - 是否自动续费
|
|
289
|
+
- **ChargeType** (str) - 付费类型
|
|
290
|
+
- **CreateTime** (int) - 创建时间
|
|
291
|
+
- **EIP** (str) - 绑定EIP的IP地址
|
|
292
|
+
- **EIPId** (str) - EIPID
|
|
293
|
+
- **EIPType** (str) - EIP类型
|
|
294
|
+
- **ExpireTime** (int) - 到期时间
|
|
295
|
+
- **Grade** (str) - 网关类型
|
|
296
|
+
- **Remark** (str) - 网关备注
|
|
297
|
+
- **Tag** (str) - 网关业务组
|
|
298
|
+
- **VPCId** (str) - 所属VPCId
|
|
299
|
+
- **VPCName** (str) - 所属VPC名字
|
|
300
|
+
- **VPNGatewayId** (str) - 网关Id
|
|
301
|
+
- **VPNGatewayName** (str) - 网关名字
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
"""
|
|
305
|
+
# build request
|
|
306
|
+
d = {
|
|
307
|
+
"ProjectId": self.config.project_id,
|
|
308
|
+
"Region": self.config.region,
|
|
309
|
+
}
|
|
310
|
+
req and d.update(req)
|
|
311
|
+
d = apis.DescribeVPNGatewayRequestSchema().dumps(d)
|
|
312
|
+
|
|
313
|
+
resp = self.invoke("DescribeVPNGateway", d, **kwargs)
|
|
314
|
+
return apis.DescribeVPNGatewayResponseSchema().loads(resp)
|
|
315
|
+
|
|
316
|
+
def describe_vpn_tunnel(
|
|
317
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
318
|
+
) -> dict:
|
|
319
|
+
"""DescribeVPNTunnel - 获取VPN隧道信息
|
|
320
|
+
|
|
321
|
+
**Request**
|
|
322
|
+
|
|
323
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
324
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
325
|
+
- **Limit** (int) - 数据分页值, 默认为20
|
|
326
|
+
- **Offset** (int) - 数据偏移量, 默认为0
|
|
327
|
+
- **Tag** (str) - 业务组名称,若指定则返回指定的业务组下的所有VPN网关的信息
|
|
328
|
+
- **VPNTunnelIds** (list) - VPN隧道的资源ID,例如VPNTunnelIds.0代表希望获取信息的VPN隧道1,VPNTunneIds.1代表VPN隧道2,如果为空,则返回当前Region中所有的VPN隧道实例
|
|
329
|
+
|
|
330
|
+
**Response**
|
|
331
|
+
|
|
332
|
+
- **DataSet** (list) - 见 **VPNTunnelDataSet** 模型定义
|
|
333
|
+
- **TotalCount** (int) - VPN隧道总数
|
|
334
|
+
|
|
335
|
+
**Response Model**
|
|
336
|
+
|
|
337
|
+
**VPNTunnelDataSet**
|
|
338
|
+
- **CreateTime** (int) - 创建时间
|
|
339
|
+
- **IKEData** (dict) - 见 **IKEData** 模型定义
|
|
340
|
+
- **IPSecData** (dict) - 见 **IPSecData** 模型定义
|
|
341
|
+
- **Remark** (str) - 备注
|
|
342
|
+
- **RemoteVPNGatewayId** (str) - 对端网关Id
|
|
343
|
+
- **RemoteVPNGatewayName** (str) - 对端网关名字
|
|
344
|
+
- **Tag** (str) - 用户组
|
|
345
|
+
- **VPCId** (str) - 所属VPCId
|
|
346
|
+
- **VPCName** (str) - 所属VOC名字
|
|
347
|
+
- **VPNGatewayId** (str) - 所属VPN网关id
|
|
348
|
+
- **VPNGatewayName** (str) - VPN网关名字
|
|
349
|
+
- **VPNTunnelId** (str) - 隧道id
|
|
350
|
+
- **VPNTunnelName** (str) - 隧道名称
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
**IKEData**
|
|
354
|
+
- **IKEAuthenticationAlgorithm** (str) - IKE认证算法
|
|
355
|
+
- **IKEDhGroup** (str) - IKEDH组
|
|
356
|
+
- **IKEEncryptionAlgorithm** (str) - IKE加密算法
|
|
357
|
+
- **IKEExchangeMode** (str) - IKEv1协商模式
|
|
358
|
+
- **IKELocalId** (str) - IKE本地ID标识
|
|
359
|
+
- **IKEPreSharedKey** (str) - IKE预共享秘钥
|
|
360
|
+
- **IKERemoteId** (str) - IKE对端ID标识
|
|
361
|
+
- **IKESALifetime** (str) - IKE秘钥生存时间
|
|
362
|
+
- **IKEVersion** (str) - IKE版本
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
**IPSecData**
|
|
366
|
+
- **IPSecAuthenticationAlgorithm** (str) - IPSec通道中使用的认证算法
|
|
367
|
+
- **IPSecEncryptionAlgorithm** (str) - IPSec通道中使用的加密算法
|
|
368
|
+
- **IPSecLocalSubnetIds** (list) - 指定VPN连接的本地子网,用逗号分隔
|
|
369
|
+
- **IPSecPFSDhGroup** (str) - 是否开启PFS功能,Disable表示关闭,数字表示DH组
|
|
370
|
+
- **IPSecProtocol** (str) - 使用的安全协议,ESP或AH
|
|
371
|
+
- **IPSecRemoteSubnets** (list) - 指定VPN连接的客户网段,用逗号分隔
|
|
372
|
+
- **IPSecSALifetime** (str) - IPSec中SA的生存时间
|
|
373
|
+
- **IPSecSALifetimeBytes** (str) - IPSec中SA的生存时间(以字节计)
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
"""
|
|
377
|
+
# build request
|
|
378
|
+
d = {
|
|
379
|
+
"ProjectId": self.config.project_id,
|
|
380
|
+
"Region": self.config.region,
|
|
381
|
+
}
|
|
382
|
+
req and d.update(req)
|
|
383
|
+
d = apis.DescribeVPNTunnelRequestSchema().dumps(d)
|
|
384
|
+
|
|
385
|
+
resp = self.invoke("DescribeVPNTunnel", d, **kwargs)
|
|
386
|
+
return apis.DescribeVPNTunnelResponseSchema().loads(resp)
|
|
387
|
+
|
|
388
|
+
def get_vpn_gateway_price(
|
|
389
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
390
|
+
) -> dict:
|
|
391
|
+
"""GetVPNGatewayPrice - 获取VPN价格
|
|
392
|
+
|
|
393
|
+
**Request**
|
|
394
|
+
|
|
395
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
396
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
397
|
+
- **Grade** (str) - (Required) VPN网关规格。枚举值,包括:标准型:Standard,增强型:Enhanced。
|
|
398
|
+
- **ChargeType** (str) - 付费方式, 枚举值为: Year, 按年付费; Month, 按月付费; Dynamic, 按需付费(需开启权限); 默认为获取三种价格
|
|
399
|
+
- **Quantity** (int) - 购买时长, 默认: 1
|
|
400
|
+
|
|
401
|
+
**Response**
|
|
402
|
+
|
|
403
|
+
- **PriceSet** (list) - 见 **VPNGatewayPriceSet** 模型定义
|
|
404
|
+
|
|
405
|
+
**Response Model**
|
|
406
|
+
|
|
407
|
+
**VPNGatewayPriceSet**
|
|
408
|
+
- **ChargeType** (str) - VPN网关付费方式
|
|
409
|
+
- **Price** (float) - VPN网关价格, 单位"元"
|
|
410
|
+
- **PurchaseValue** (int) - 资源有效期, 以Unix Timestamp表示
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
"""
|
|
414
|
+
# build request
|
|
415
|
+
d = {
|
|
416
|
+
"ProjectId": self.config.project_id,
|
|
417
|
+
"Region": self.config.region,
|
|
418
|
+
}
|
|
419
|
+
req and d.update(req)
|
|
420
|
+
d = apis.GetVPNGatewayPriceRequestSchema().dumps(d)
|
|
421
|
+
|
|
422
|
+
resp = self.invoke("GetVPNGatewayPrice", d, **kwargs)
|
|
423
|
+
return apis.GetVPNGatewayPriceResponseSchema().loads(resp)
|
|
424
|
+
|
|
425
|
+
def get_vpn_gateway_upgrade_price(
|
|
426
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
427
|
+
) -> dict:
|
|
428
|
+
"""GetVPNGatewayUpgradePrice - 获取VPN网关规格改动价格
|
|
429
|
+
|
|
430
|
+
**Request**
|
|
431
|
+
|
|
432
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
433
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
434
|
+
- **Grade** (str) - (Required) 更改的VPN网关规格,枚举值为: Standard, 标准型; Enhanced, 增强型。
|
|
435
|
+
- **VPNGatewayId** (str) - (Required) VPN网关的资源ID
|
|
436
|
+
|
|
437
|
+
**Response**
|
|
438
|
+
|
|
439
|
+
- **Price** (float) - 调整规格后的VPN网关价格, 单位为"元", 如需退费此处为负值
|
|
440
|
+
|
|
441
|
+
"""
|
|
442
|
+
# build request
|
|
443
|
+
d = {
|
|
444
|
+
"ProjectId": self.config.project_id,
|
|
445
|
+
"Region": self.config.region,
|
|
446
|
+
}
|
|
447
|
+
req and d.update(req)
|
|
448
|
+
d = apis.GetVPNGatewayUpgradePriceRequestSchema().dumps(d)
|
|
449
|
+
|
|
450
|
+
resp = self.invoke("GetVPNGatewayUpgradePrice", d, **kwargs)
|
|
451
|
+
return apis.GetVPNGatewayUpgradePriceResponseSchema().loads(resp)
|
|
452
|
+
|
|
453
|
+
def update_vpn_gateway(
|
|
454
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
455
|
+
) -> dict:
|
|
456
|
+
"""UpdateVPNGateway - 更改VPN网关规格
|
|
457
|
+
|
|
458
|
+
**Request**
|
|
459
|
+
|
|
460
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
461
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
462
|
+
- **Grade** (str) - (Required) 网关规格。枚举值为: Standard, 标准型; Enhanced, 增强型。
|
|
463
|
+
- **VPNGatewayId** (str) - (Required) VPN网关的资源ID
|
|
464
|
+
|
|
465
|
+
**Response**
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
"""
|
|
469
|
+
# build request
|
|
470
|
+
d = {
|
|
471
|
+
"ProjectId": self.config.project_id,
|
|
472
|
+
"Region": self.config.region,
|
|
473
|
+
}
|
|
474
|
+
req and d.update(req)
|
|
475
|
+
d = apis.UpdateVPNGatewayRequestSchema().dumps(d)
|
|
476
|
+
|
|
477
|
+
resp = self.invoke("UpdateVPNGateway", d, **kwargs)
|
|
478
|
+
return apis.UpdateVPNGatewayResponseSchema().loads(resp)
|
|
479
|
+
|
|
480
|
+
def update_vpn_tunnel_attribute(
|
|
481
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
482
|
+
) -> dict:
|
|
483
|
+
"""UpdateVPNTunnelAttribute - 更新VPN隧道属性
|
|
484
|
+
|
|
485
|
+
**Request**
|
|
486
|
+
|
|
487
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
488
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
489
|
+
- **VPNTunnelId** (str) - (Required) VPN隧道的资源ID
|
|
490
|
+
- **IKEAuthenticationAlgorithm** (str) - IKE协商过程中使用的认证算法
|
|
491
|
+
- **IKEDhGroup** (str) - IKE协商过程中使用的DH组
|
|
492
|
+
- **IKEEncryptionAlgorithm** (str) - IKE协商过程中使用的加密算法
|
|
493
|
+
- **IKEExchangeMode** (str) - IKE协商过程中使用的模式,可选“主动模式”与“野蛮模式”。IKEV2不使用该参数。
|
|
494
|
+
- **IKELocalId** (str) - 本端标识。不填时默认使用之前的参数,结合IKEversion进行校验,IKEV2时不能为auto。
|
|
495
|
+
- **IKEPreSharedKey** (str) - 预共享密钥
|
|
496
|
+
- **IKERemoteId** (str) - 客户端标识。不填时默认使用之前的参数,结合IKEversion进行校验,IKEV2时不能为auto。
|
|
497
|
+
- **IKESALifetime** (str) - IKE中SA的生存时间
|
|
498
|
+
- **IKEVersion** (str) - 枚举值:"IKE V1","IKE V2"
|
|
499
|
+
- **IPSecAuthenticationAlgorithm** (str) - IPSec隧道中使用的认证算法
|
|
500
|
+
- **IPSecCloseAction** (str) - IPSec隧道关闭后的处理动作,默认与原本一致,若原本为空,必传。枚举值:“none”,不处理(推荐为none,流量会自动触发隧道重建);“restart”重建
|
|
501
|
+
- **IPSecEncryptionAlgorithm** (str) - IPSec隧道中使用的加密算法
|
|
502
|
+
- **IPSecLocalSubnetIds** (list) - 指定VPN连接的本地子网的id,用逗号分隔
|
|
503
|
+
- **IPSecPFSDhGroup** (str) - IPSec中的PFS是否开启
|
|
504
|
+
- **IPSecProtocol** (str) - 使用的安全协议,ESP或AH
|
|
505
|
+
- **IPSecRemoteSubnets** (list) - 指定VPN连接的客户网段,用逗号分隔
|
|
506
|
+
- **IPSecSALifetime** (str) - IPSec中SA的生存时间
|
|
507
|
+
- **IPSecSALifetimeBytes** (str) - IPSec中SA的生存时间(以字节计)
|
|
508
|
+
|
|
509
|
+
**Response**
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
"""
|
|
513
|
+
# build request
|
|
514
|
+
d = {
|
|
515
|
+
"ProjectId": self.config.project_id,
|
|
516
|
+
"Region": self.config.region,
|
|
517
|
+
}
|
|
518
|
+
req and d.update(req)
|
|
519
|
+
d = apis.UpdateVPNTunnelAttributeRequestSchema().dumps(d)
|
|
520
|
+
|
|
521
|
+
resp = self.invoke("UpdateVPNTunnelAttribute", d, **kwargs)
|
|
522
|
+
return apis.UpdateVPNTunnelAttributeResponseSchema().loads(resp)
|
|
File without changes
|