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,2463 @@
|
|
|
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.udb.schemas import apis
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class UDBClient(Client):
|
|
11
|
+
def __init__(
|
|
12
|
+
self, config: dict, transport=None, middleware=None, logger=None
|
|
13
|
+
):
|
|
14
|
+
super(UDBClient, self).__init__(config, transport, middleware, logger)
|
|
15
|
+
|
|
16
|
+
def backup_udb_instance(
|
|
17
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
18
|
+
) -> dict:
|
|
19
|
+
"""BackupUDBInstance - 备份UDB实例
|
|
20
|
+
|
|
21
|
+
**Request**
|
|
22
|
+
|
|
23
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
24
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
25
|
+
- **BackupName** (str) - (Required) 备份名称
|
|
26
|
+
- **DBId** (str) - (Required) DB实例Id,该值可以通过DescribeUDBInstance获取
|
|
27
|
+
- **BackupMethod** (str) - 使用的备份方式。默认使用逻辑备份(快照备份即物理备份。SSD版本的mysql/mongodb实例支持设置为snapshot,NVMe版本的mysql实例支持设置为xtrabackup)
|
|
28
|
+
- **Blacklist** (str) - 备份黑名单列表,以 ; 分隔。注意:只有逻辑备份下备份黑名单才生效,快照备份备份黑名单下无效
|
|
29
|
+
- **ForceBackup** (bool) - true表示逻辑备份时是使用 --force 参数,false表示不使用 --force 参数。物理备份此参数无效。
|
|
30
|
+
- **UseBlacklist** (bool) - 是否使用黑名单备份,默认false
|
|
31
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
32
|
+
|
|
33
|
+
**Response**
|
|
34
|
+
|
|
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.BackupUDBInstanceRequestSchema().dumps(d)
|
|
44
|
+
|
|
45
|
+
resp = self.invoke("BackupUDBInstance", d, **kwargs)
|
|
46
|
+
return apis.BackupUDBInstanceResponseSchema().loads(resp)
|
|
47
|
+
|
|
48
|
+
def backup_udb_instance_binlog(
|
|
49
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
50
|
+
) -> dict:
|
|
51
|
+
"""BackupUDBInstanceBinlog - 备份UDB指定时间段的binlog列表
|
|
52
|
+
|
|
53
|
+
**Request**
|
|
54
|
+
|
|
55
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
56
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
57
|
+
- **BackupFile** (str) - (Required) 需要备份文件,可通过DescribeUDBInstanceBinlog获得 如果要传入多个文件名,以空格键分割,用单引号包含.
|
|
58
|
+
- **DBId** (str) - (Required) DB实例Id,该值可以通过DescribeUDBInstance获取
|
|
59
|
+
- **BackupName** (str) - DB备份文件名称
|
|
60
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
61
|
+
|
|
62
|
+
**Response**
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
"""
|
|
66
|
+
# build request
|
|
67
|
+
d = {
|
|
68
|
+
"ProjectId": self.config.project_id,
|
|
69
|
+
"Region": self.config.region,
|
|
70
|
+
}
|
|
71
|
+
req and d.update(req)
|
|
72
|
+
d = apis.BackupUDBInstanceBinlogRequestSchema().dumps(d)
|
|
73
|
+
|
|
74
|
+
resp = self.invoke("BackupUDBInstanceBinlog", d, **kwargs)
|
|
75
|
+
return apis.BackupUDBInstanceBinlogResponseSchema().loads(resp)
|
|
76
|
+
|
|
77
|
+
def backup_udb_instance_error_log(
|
|
78
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
79
|
+
) -> dict:
|
|
80
|
+
"""BackupUDBInstanceErrorLog - 备份UDB指定时间段的errorlog
|
|
81
|
+
|
|
82
|
+
**Request**
|
|
83
|
+
|
|
84
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
85
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
86
|
+
- **BackupName** (str) - (Required) 备份名称
|
|
87
|
+
- **DBId** (str) - (Required) DB实例Id,该值可以通过DescribeUDBInstance获取
|
|
88
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
89
|
+
|
|
90
|
+
**Response**
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
"""
|
|
94
|
+
# build request
|
|
95
|
+
d = {
|
|
96
|
+
"ProjectId": self.config.project_id,
|
|
97
|
+
"Region": self.config.region,
|
|
98
|
+
}
|
|
99
|
+
req and d.update(req)
|
|
100
|
+
d = apis.BackupUDBInstanceErrorLogRequestSchema().dumps(d)
|
|
101
|
+
|
|
102
|
+
resp = self.invoke("BackupUDBInstanceErrorLog", d, **kwargs)
|
|
103
|
+
return apis.BackupUDBInstanceErrorLogResponseSchema().loads(resp)
|
|
104
|
+
|
|
105
|
+
def backup_udb_instance_slow_log(
|
|
106
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
107
|
+
) -> dict:
|
|
108
|
+
"""BackupUDBInstanceSlowLog - 备份UDB指定时间段的slowlog分析结果
|
|
109
|
+
|
|
110
|
+
**Request**
|
|
111
|
+
|
|
112
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
113
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
114
|
+
- **BackupName** (str) - (Required) 备份文件名称
|
|
115
|
+
- **BeginTime** (int) - (Required) 过滤条件:起始时间(时间戳)
|
|
116
|
+
- **DBId** (str) - (Required) DB实例Id,该值可以通过DescribeUDBInstance获取
|
|
117
|
+
- **EndTime** (int) - (Required) 过滤条件:结束时间(时间戳)
|
|
118
|
+
|
|
119
|
+
**Response**
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
"""
|
|
123
|
+
# build request
|
|
124
|
+
d = {
|
|
125
|
+
"ProjectId": self.config.project_id,
|
|
126
|
+
"Region": self.config.region,
|
|
127
|
+
}
|
|
128
|
+
req and d.update(req)
|
|
129
|
+
d = apis.BackupUDBInstanceSlowLogRequestSchema().dumps(d)
|
|
130
|
+
|
|
131
|
+
resp = self.invoke("BackupUDBInstanceSlowLog", d, **kwargs)
|
|
132
|
+
return apis.BackupUDBInstanceSlowLogResponseSchema().loads(resp)
|
|
133
|
+
|
|
134
|
+
def change_udb_param_group(
|
|
135
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
136
|
+
) -> dict:
|
|
137
|
+
"""ChangeUDBParamGroup - 修改配置文件
|
|
138
|
+
|
|
139
|
+
**Request**
|
|
140
|
+
|
|
141
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
142
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
143
|
+
- **DBId** (str) - (Required) DB实例Id
|
|
144
|
+
- **GroupId** (str) - (Required) 参数组Id
|
|
145
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
146
|
+
|
|
147
|
+
**Response**
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
"""
|
|
151
|
+
# build request
|
|
152
|
+
d = {
|
|
153
|
+
"ProjectId": self.config.project_id,
|
|
154
|
+
"Region": self.config.region,
|
|
155
|
+
}
|
|
156
|
+
req and d.update(req)
|
|
157
|
+
d = apis.ChangeUDBParamGroupRequestSchema().dumps(d)
|
|
158
|
+
|
|
159
|
+
resp = self.invoke("ChangeUDBParamGroup", d, **kwargs)
|
|
160
|
+
return apis.ChangeUDBParamGroupResponseSchema().loads(resp)
|
|
161
|
+
|
|
162
|
+
def check_recover_udb_instance(
|
|
163
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
164
|
+
) -> dict:
|
|
165
|
+
"""CheckRecoverUDBInstance - 核查db是否可以使用回档功能
|
|
166
|
+
|
|
167
|
+
**Request**
|
|
168
|
+
|
|
169
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
170
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
171
|
+
- **SrcDBId** (str) - (Required) 源实例的Id(只支持普通版DB不支持高可用)
|
|
172
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
173
|
+
|
|
174
|
+
**Response**
|
|
175
|
+
|
|
176
|
+
- **LastestTime** (int) - 核查成功返回值为可以回档到的最近时刻,核查失败不返回
|
|
177
|
+
|
|
178
|
+
"""
|
|
179
|
+
# build request
|
|
180
|
+
d = {
|
|
181
|
+
"ProjectId": self.config.project_id,
|
|
182
|
+
"Region": self.config.region,
|
|
183
|
+
}
|
|
184
|
+
req and d.update(req)
|
|
185
|
+
d = apis.CheckRecoverUDBInstanceRequestSchema().dumps(d)
|
|
186
|
+
|
|
187
|
+
resp = self.invoke("CheckRecoverUDBInstance", d, **kwargs)
|
|
188
|
+
return apis.CheckRecoverUDBInstanceResponseSchema().loads(resp)
|
|
189
|
+
|
|
190
|
+
def check_udb_instance_to_ha_allowance(
|
|
191
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
192
|
+
) -> dict:
|
|
193
|
+
"""CheckUDBInstanceToHAAllowance - 核查db是否可以升级为高可用
|
|
194
|
+
|
|
195
|
+
**Request**
|
|
196
|
+
|
|
197
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
198
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
199
|
+
- **DBId** (str) - (Required) 实例的Id,该值可以通过DescribeUDBInstance获取
|
|
200
|
+
|
|
201
|
+
**Response**
|
|
202
|
+
|
|
203
|
+
- **Allowance** (str) - Yes ,No ,Yes即可以升级,No为不可以升级
|
|
204
|
+
|
|
205
|
+
"""
|
|
206
|
+
# build request
|
|
207
|
+
d = {
|
|
208
|
+
"ProjectId": self.config.project_id,
|
|
209
|
+
"Region": self.config.region,
|
|
210
|
+
}
|
|
211
|
+
req and d.update(req)
|
|
212
|
+
d = apis.CheckUDBInstanceToHAAllowanceRequestSchema().dumps(d)
|
|
213
|
+
|
|
214
|
+
resp = self.invoke("CheckUDBInstanceToHAAllowance", d, **kwargs)
|
|
215
|
+
return apis.CheckUDBInstanceToHAAllowanceResponseSchema().loads(resp)
|
|
216
|
+
|
|
217
|
+
def clear_udb_log(
|
|
218
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
219
|
+
) -> dict:
|
|
220
|
+
"""ClearUDBLog - 清除UDB实例的log
|
|
221
|
+
|
|
222
|
+
**Request**
|
|
223
|
+
|
|
224
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
225
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
226
|
+
- **DBId** (str) - (Required) DB实例的id,该值可以通过DescribeUDBInstance获取
|
|
227
|
+
- **LogType** (int) - (Required) 日志类型,10-error(暂不支持)、20-slow(暂不支持 )、30-binlog
|
|
228
|
+
- **BeforeTime** (int) - 删除时间点(至少前一天)之前log,采用时间戳(秒),默认当 前时间点前一天
|
|
229
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
230
|
+
|
|
231
|
+
**Response**
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
"""
|
|
235
|
+
# build request
|
|
236
|
+
d = {
|
|
237
|
+
"ProjectId": self.config.project_id,
|
|
238
|
+
"Region": self.config.region,
|
|
239
|
+
}
|
|
240
|
+
req and d.update(req)
|
|
241
|
+
d = apis.ClearUDBLogRequestSchema().dumps(d)
|
|
242
|
+
|
|
243
|
+
resp = self.invoke("ClearUDBLog", d, **kwargs)
|
|
244
|
+
return apis.ClearUDBLogResponseSchema().loads(resp)
|
|
245
|
+
|
|
246
|
+
def create_mongo_db_replica_set(
|
|
247
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
248
|
+
) -> dict:
|
|
249
|
+
"""CreateMongoDBReplicaSet - 一键创建DB副本集
|
|
250
|
+
|
|
251
|
+
**Request**
|
|
252
|
+
|
|
253
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
254
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
255
|
+
- **AdminPassword** (str) - (Required) 管理员密码
|
|
256
|
+
- **DBTypeId** (str) - (Required) DB类型id对应的字符串形式 mongodb-3.4,mongodb-3.6,mongodb-4.0
|
|
257
|
+
- **DiskSpace** (int) - (Required) 磁盘空间(GB), 暂时支持20G - 3000G
|
|
258
|
+
- **MemoryLimit** (int) - (Required) 内存限制(MB),目前支持以下几档 2000M/4000M/ 6000M/8000M/12000M/16000M/ 24000M/32000M/48000M/ 64000M/96000M
|
|
259
|
+
- **Name** (str) - (Required) PrimaryDB实例名称,至少6位
|
|
260
|
+
- **ParamGroupId** (int) - (Required) DB实例使用的配置参数组id
|
|
261
|
+
- **Port** (int) - (Required) 端口号
|
|
262
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
263
|
+
- **AdminUser** (str) - 管理员帐户名,默认root
|
|
264
|
+
- **BackupCount** (int) - 备份策略,每周备份数量,默认7次
|
|
265
|
+
- **BackupDuration** (int) - 备份策略,备份时间间隔,单位小时计,默认24小时
|
|
266
|
+
- **BackupTime** (int) - 备份策略,备份开始时间,单位小时计,默认1点
|
|
267
|
+
- **CPU** (int) - cpu核数
|
|
268
|
+
- **ChargeType** (str) - Year, Month, Dynamic,Trial,默认: Month
|
|
269
|
+
- **ClusterId** (str) - 所属分片集群的ID
|
|
270
|
+
- **CouponId** (list) - CouponId.0 代表第一个代金券id,对于传入多个代金券id,后面为 CouponId.1, CouponId.2 以此类推
|
|
271
|
+
- **Quantity** (int) - 购买时长(N个月),默认值1个月。如果为0,代表购买到月底。
|
|
272
|
+
- **SubnetId** (str) - 子网ID
|
|
273
|
+
- **VPCId** (str) - VPC的ID
|
|
274
|
+
|
|
275
|
+
**Response**
|
|
276
|
+
|
|
277
|
+
- **DBIds** (list) - 返回所有副本集成员的Id
|
|
278
|
+
|
|
279
|
+
"""
|
|
280
|
+
# build request
|
|
281
|
+
d = {
|
|
282
|
+
"ProjectId": self.config.project_id,
|
|
283
|
+
"Region": self.config.region,
|
|
284
|
+
}
|
|
285
|
+
req and d.update(req)
|
|
286
|
+
d = apis.CreateMongoDBReplicaSetRequestSchema().dumps(d)
|
|
287
|
+
|
|
288
|
+
# build options
|
|
289
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
290
|
+
|
|
291
|
+
resp = self.invoke("CreateMongoDBReplicaSet", d, **kwargs)
|
|
292
|
+
return apis.CreateMongoDBReplicaSetResponseSchema().loads(resp)
|
|
293
|
+
|
|
294
|
+
def create_udb_instance(
|
|
295
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
296
|
+
) -> dict:
|
|
297
|
+
"""CreateUDBInstance - 创建UDB实例(包括创建mysql master节点、mongodb primary/configsvr节点和从备份恢复实例)
|
|
298
|
+
|
|
299
|
+
**Request**
|
|
300
|
+
|
|
301
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
302
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
303
|
+
- **AdminPassword** (str) - (Required) 管理员密码
|
|
304
|
+
- **DBTypeId** (str) - (Required) DB类型,mysql/mongodb/postgesql/sqlserver按版本细分 mysql-8.0, mysql-5.5, percona-5.5, mysql-5.6, percona-5.6, mysql-5.7, percona-5.7, mariadb-10.0, postgresql-9.6, postgresql-10.4, postgresql-12.8, postgresql-13.4,mongodb-2.6, mongodb-3.0, mongodb-3.6, mongodb-4.0, sqlserver-2017
|
|
305
|
+
- **DiskSpace** (int) - (Required) 磁盘空间(GB), 暂时支持20G - 32T
|
|
306
|
+
- **Name** (str) - (Required) 实例名称,至少6位
|
|
307
|
+
- **ParamGroupId** (int) - (Required) DB实例使用的配置参数组id
|
|
308
|
+
- **Port** (int) - (Required) 端口号,mysql默认3306,mongodb默认27017,postgresql默认5432
|
|
309
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
310
|
+
- **AdminUser** (str) - 管理员帐户名,默认root
|
|
311
|
+
- **BackupCount** (int) - 备份策略,每周备份数量,默认7次
|
|
312
|
+
- **BackupDuration** (int) - 备份策略,备份时间间隔,单位小时计,默认24小时
|
|
313
|
+
- **BackupId** (int) - 备份id,如果指定,则表明从备份恢复实例
|
|
314
|
+
- **BackupTime** (int) - 备份策略,备份开始时间,单位小时计,默认1点
|
|
315
|
+
- **BackupZone** (str) - 跨可用区高可用备库所在可用区,参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
316
|
+
- **CPU** (int) - cpu核数,如果db类型为sqlserver,必传参数
|
|
317
|
+
- **CaseSensitivityParam** (int) - mysql大小写参数, 0 为大小写敏感, 1 为大小写不敏感, 目前只针对mysql8.0有效
|
|
318
|
+
- **ChargeType** (str) - Year, Month, Dynamic,Trial,默认: Month
|
|
319
|
+
- **ClusterRole** (str) - 当DB类型(DBTypeId)为mongodb时,需要指定mongo的角色,可选值为configsrv (配置节点),shardsrv (数据节点)
|
|
320
|
+
- **CouponId** (str) - 使用的代金券id
|
|
321
|
+
- **DBSubVersion** (str) - mysql小版本号,支持指定小版本创建
|
|
322
|
+
- **DisableSemisync** (bool) - 是否开启异步高可用,默认不填,可置为true
|
|
323
|
+
- **InstanceMode** (str) - UDB实例模式类型, 可选值如下: "Normal": 普通版UDB实例 "HA": 高可用版UDB实例 默认是"Normal"
|
|
324
|
+
- **InstanceType** (str) - UDB数据库机型: "SATA_SSD": "SSD机型" , "PCIE_SSD": "SSD高性能机型" , "Normal_Volume": "标准大容量机型", "SATA_SSD_Volume": "SSD大容量机型" , "PCIE_SSD_Volume": "SSD高性能大容量机型", "NVMe_SSD": "快杰机型"
|
|
325
|
+
- **MachineType** (str) - 规格类型ID,当SpecificationType为1时有效
|
|
326
|
+
- **MemoryLimit** (int) - 内存限制(MB),目前支持以下几档 2000M/4000M/ 6000M/8000M/12000M/16000M/ 24000M/32000M/48000M/ 64000M/96000M/128000M/192000M/256000M/320000M
|
|
327
|
+
- **Quantity** (int) - 购买时长,默认值1
|
|
328
|
+
- **SSDType** (str) - SSD类型,可选值为"SATA"、“NVMe”,默认为“SATA”
|
|
329
|
+
- **SpecificationType** (str) - 实例计算规格类型,0或不传代表使用内存方式购买,1代表使用内存-cpu可选配比方式购买,需要填写MachineType
|
|
330
|
+
- **SubnetId** (str) - 子网ID
|
|
331
|
+
- **Tag** (str) - 实例所在的业务组名称
|
|
332
|
+
- **VPCId** (str) - VPC的ID
|
|
333
|
+
|
|
334
|
+
**Response**
|
|
335
|
+
|
|
336
|
+
- **DBId** (str) - BD实例id
|
|
337
|
+
|
|
338
|
+
"""
|
|
339
|
+
# build request
|
|
340
|
+
d = {
|
|
341
|
+
"ProjectId": self.config.project_id,
|
|
342
|
+
"Region": self.config.region,
|
|
343
|
+
}
|
|
344
|
+
req and d.update(req)
|
|
345
|
+
d = apis.CreateUDBInstanceRequestSchema().dumps(d)
|
|
346
|
+
|
|
347
|
+
# build options
|
|
348
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
349
|
+
|
|
350
|
+
resp = self.invoke("CreateUDBInstance", d, **kwargs)
|
|
351
|
+
return apis.CreateUDBInstanceResponseSchema().loads(resp)
|
|
352
|
+
|
|
353
|
+
def create_udb_instance_by_recovery(
|
|
354
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
355
|
+
) -> dict:
|
|
356
|
+
"""CreateUDBInstanceByRecovery - 创建db,将新创建的db恢复到指定db某个指定时间点
|
|
357
|
+
|
|
358
|
+
**Request**
|
|
359
|
+
|
|
360
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
361
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
362
|
+
- **Name** (str) - (Required) 实例名称,至少6位
|
|
363
|
+
- **RecoveryTime** (int) - (Required) 恢复到某个时间点的时间戳(UTC时间格式,默认单位秒)
|
|
364
|
+
- **SrcDBId** (str) - (Required) 源实例的Id
|
|
365
|
+
- **AdminPassword** (str) - 管理员密码 (指定库表回档到新实例时有效)
|
|
366
|
+
- **ChargeType** (str) - Year, Month, Dynamic,Trial,默认: Dynamic
|
|
367
|
+
- **CouponId** (str) - 使用的代金券id
|
|
368
|
+
- **EnableIpV6** (bool) - 是否创建使用ipv6 资源, 默认为false, 或者不填, 创建ipv6为true
|
|
369
|
+
- **MachineType** (str) - 规格类型ID,当SpecificationType为1时有效
|
|
370
|
+
- **Quantity** (int) - 购买时长,默认值1
|
|
371
|
+
- **SpecificationType** (int) - 实例计算规格类型,0或不传代表使用内存方式购买,1代表使用内存-cpu可选配比方式购买,需要填写MachineType
|
|
372
|
+
- **SubnetId** (str) - 子网ID
|
|
373
|
+
- **Tables** (str) - 指定需要恢复的表, 如果指定该字段则回档实例只有指定的表数据,格式为(库名.表名), 指定多个用逗号隔开,eg: [ udb.test, mysql_school.my_student]
|
|
374
|
+
- **UDBCId** (str) - 专区的Id
|
|
375
|
+
- **UseSSD** (bool) - 指定是否是否使用SSD,默认使用主库的配置
|
|
376
|
+
- **VPCId** (str) - VPC的ID
|
|
377
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
378
|
+
|
|
379
|
+
**Response**
|
|
380
|
+
|
|
381
|
+
- **DBId** (str) - db实例id
|
|
382
|
+
|
|
383
|
+
"""
|
|
384
|
+
# build request
|
|
385
|
+
d = {
|
|
386
|
+
"ProjectId": self.config.project_id,
|
|
387
|
+
"Region": self.config.region,
|
|
388
|
+
}
|
|
389
|
+
req and d.update(req)
|
|
390
|
+
d = apis.CreateUDBInstanceByRecoveryRequestSchema().dumps(d)
|
|
391
|
+
|
|
392
|
+
# build options
|
|
393
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
394
|
+
|
|
395
|
+
resp = self.invoke("CreateUDBInstanceByRecovery", d, **kwargs)
|
|
396
|
+
return apis.CreateUDBInstanceByRecoveryResponseSchema().loads(resp)
|
|
397
|
+
|
|
398
|
+
def create_udb_param_group(
|
|
399
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
400
|
+
) -> dict:
|
|
401
|
+
"""CreateUDBParamGroup - 从已有配置文件创建新配置文件
|
|
402
|
+
|
|
403
|
+
**Request**
|
|
404
|
+
|
|
405
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
406
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
407
|
+
- **DBTypeId** (str) - (Required) DB类型id,mysql/mongodb/postgesql按版本细分 1:mysql-5.1,2:mysql-5.5,3:percona-5.5,4:mysql-5.6,5:percona-5.6,6:mysql-5.7,7:percona-5.7,8:mariadb-10.0,9:mongodb-2.4,10:mongodb-2.6,11:mongodb-3.0,12:mongodb-3.2,13:postgresql-9.4,14:postgresql-9.6
|
|
408
|
+
- **Description** (str) - (Required) 参数组描述
|
|
409
|
+
- **GroupName** (str) - (Required) 新配置参数组名称
|
|
410
|
+
- **SrcGroupId** (int) - (Required) 源参数组id
|
|
411
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
412
|
+
- **RegionFlag** (bool) - 是否是地域级别的配置文件,默认是false
|
|
413
|
+
|
|
414
|
+
**Response**
|
|
415
|
+
|
|
416
|
+
- **GroupId** (int) - 新配置参数组id
|
|
417
|
+
|
|
418
|
+
"""
|
|
419
|
+
# build request
|
|
420
|
+
d = {
|
|
421
|
+
"ProjectId": self.config.project_id,
|
|
422
|
+
"Region": self.config.region,
|
|
423
|
+
}
|
|
424
|
+
req and d.update(req)
|
|
425
|
+
d = apis.CreateUDBParamGroupRequestSchema().dumps(d)
|
|
426
|
+
|
|
427
|
+
# build options
|
|
428
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
429
|
+
|
|
430
|
+
resp = self.invoke("CreateUDBParamGroup", d, **kwargs)
|
|
431
|
+
return apis.CreateUDBParamGroupResponseSchema().loads(resp)
|
|
432
|
+
|
|
433
|
+
def create_udb_replication_instance(
|
|
434
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
435
|
+
) -> dict:
|
|
436
|
+
"""CreateUDBReplicationInstance - 创建MongoDB的副本节点(包括仲裁)
|
|
437
|
+
|
|
438
|
+
**Request**
|
|
439
|
+
|
|
440
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
441
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
442
|
+
- **Name** (str) - (Required) 实例名称,至少6位
|
|
443
|
+
- **SrcId** (str) - (Required) primary节点的DBId,该值可以通过DescribeUDBInstance获取
|
|
444
|
+
- **ChargeType** (str) - Year, Month, Dynamic,Trial,默认和主库保持一致
|
|
445
|
+
- **CouponId** (str) - 使用的代金券id
|
|
446
|
+
- **InstanceType** (str) - UDB数据库机型: "Normal": "标准机型" , "SATA_SSD": "SSD机型" , "PCIE_SSD": "SSD高性能机型" , "Normal_Volume": "标准大容量机型", "SATA_SSD_Volume": "SSD大容量机型" , "PCIE_SSD_Volume": "SSD高性能大容量机型", "NVMe_SSD": "快杰机型"
|
|
447
|
+
- **IsArbiter** (bool) - 是否是仲裁节点,默认false,仲裁节点按最小机型创建
|
|
448
|
+
- **Port** (int) - 端口号,默认27017,取值范围3306至65535。
|
|
449
|
+
- **Quantity** (str) - 购买时长,默认默认和主库保持一致
|
|
450
|
+
- **UseSSD** (bool) - 是否使用SSD,默认为true。目前主要可用区、海外机房、新机房只提供SSD资源,非SSD资源不再提供。
|
|
451
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
452
|
+
|
|
453
|
+
**Response**
|
|
454
|
+
|
|
455
|
+
- **DBId** (str) - 创建从节点的DBId
|
|
456
|
+
|
|
457
|
+
"""
|
|
458
|
+
# build request
|
|
459
|
+
d = {
|
|
460
|
+
"ProjectId": self.config.project_id,
|
|
461
|
+
"Region": self.config.region,
|
|
462
|
+
}
|
|
463
|
+
req and d.update(req)
|
|
464
|
+
d = apis.CreateUDBReplicationInstanceRequestSchema().dumps(d)
|
|
465
|
+
|
|
466
|
+
# build options
|
|
467
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
468
|
+
|
|
469
|
+
resp = self.invoke("CreateUDBReplicationInstance", d, **kwargs)
|
|
470
|
+
return apis.CreateUDBReplicationInstanceResponseSchema().loads(resp)
|
|
471
|
+
|
|
472
|
+
def create_udb_route_instance(
|
|
473
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
474
|
+
) -> dict:
|
|
475
|
+
"""CreateUDBRouteInstance - 创建mongos实例
|
|
476
|
+
|
|
477
|
+
**Request**
|
|
478
|
+
|
|
479
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
480
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
481
|
+
- **ConfigsvrId** (list) - (Required) 配置服务器的dbid,允许一个或者三个。
|
|
482
|
+
- **DBTypeId** (str) - (Required) DB类型id,mongodb按版本细分有1:mongodb-2.4,2:mongodb-2.6,3:mongodb-3.0,4:mongodb-3.2
|
|
483
|
+
- **DiskSpace** (int) - (Required) 磁盘空间(GB), 暂时支持20G - 500G
|
|
484
|
+
- **MemoryLimit** (int) - (Required) 内存限制(MB),目前支持以下几档 600M/1500M/3000M /6000M/15000M/30000M
|
|
485
|
+
- **Name** (str) - (Required) 实例名称,至少6位
|
|
486
|
+
- **ParamGroupId** (int) - (Required) DB实例使用的配置参数组id
|
|
487
|
+
- **Port** (int) - (Required) 端口号,mongodb默认27017
|
|
488
|
+
- **ChargeType** (str) - Year, Month, Dynamic,Trial,默认: Month
|
|
489
|
+
- **CouponId** (str) - 使用的代金券id
|
|
490
|
+
- **Quantity** (int) - 购买时长,默认值1
|
|
491
|
+
- **UseSSD** (bool) - 是否使用SSD,默认为ture
|
|
492
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
493
|
+
|
|
494
|
+
**Response**
|
|
495
|
+
|
|
496
|
+
- **DBId** (str) - db实例id
|
|
497
|
+
|
|
498
|
+
"""
|
|
499
|
+
# build request
|
|
500
|
+
d = {
|
|
501
|
+
"ProjectId": self.config.project_id,
|
|
502
|
+
"Region": self.config.region,
|
|
503
|
+
}
|
|
504
|
+
req and d.update(req)
|
|
505
|
+
d = apis.CreateUDBRouteInstanceRequestSchema().dumps(d)
|
|
506
|
+
|
|
507
|
+
# build options
|
|
508
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
509
|
+
|
|
510
|
+
resp = self.invoke("CreateUDBRouteInstance", d, **kwargs)
|
|
511
|
+
return apis.CreateUDBRouteInstanceResponseSchema().loads(resp)
|
|
512
|
+
|
|
513
|
+
def create_udb_slave(
|
|
514
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
515
|
+
) -> dict:
|
|
516
|
+
"""CreateUDBSlave - 创建UDB实例的slave
|
|
517
|
+
|
|
518
|
+
**Request**
|
|
519
|
+
|
|
520
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
521
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
522
|
+
- **Name** (str) - (Required) 实例名称,至少6位
|
|
523
|
+
- **SrcId** (str) - (Required) master实例的DBId,该值可以通过DescribeUDBInstance获取
|
|
524
|
+
- **ChargeType** (str) - Year, Month, Dynamic,Trial,默认和主库保持一致
|
|
525
|
+
- **CouponId** (str) - 使用的代金券id
|
|
526
|
+
- **DelaySeconds** (int) - 设置从库的延时复制时长(单位秒)
|
|
527
|
+
- **DiskSpace** (int) - 磁盘空间(GB), 暂时支持20G - 3000G(API支持,前端暂时只开放内存定制)
|
|
528
|
+
- **IsCreatePhysically** (bool) - 使用物理方式创建从库,目前仅限创建快杰从库,默认为false
|
|
529
|
+
- **IsLock** (bool) - 是否锁主库,默认为true
|
|
530
|
+
- **MachineType** (str) - 规格类型ID,当SpecificationType为1时有效
|
|
531
|
+
- **MemoryLimit** (int) - 内存限制(MB),目前支持以下几档 2000M/4000M/ 6000M/8000M/12000M/16000M/ 24000M/32000M/48000M/ 64000M/96000M/128000M/192000M/256000M/320000M
|
|
532
|
+
- **ParamGroupId** (int) - DB实例使用的配置参数组id,默认和主库保持一致
|
|
533
|
+
- **Port** (int) - 端口号
|
|
534
|
+
- **Quantity** (int) - 购买时长,默认默认和主库保持一致
|
|
535
|
+
- **SSDType** (str) - 仅对主为SSD型实例有效。 可选值"SATA","NVMe"
|
|
536
|
+
- **SpecificationType** (int) - 实例计算规格类型,0或不传代表使用内存方式购买,1代表使用内存-cpu可选配比方式购买,需要填写MachineType
|
|
537
|
+
- **SubnetId** (str) - 子网ID(如果不传用默认子网)
|
|
538
|
+
- **VPCId** (str) - VPCID(如果不传用默认的VPC)
|
|
539
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
540
|
+
|
|
541
|
+
**Response**
|
|
542
|
+
|
|
543
|
+
- **DBId** (str) - 创建slave的DBId
|
|
544
|
+
|
|
545
|
+
"""
|
|
546
|
+
# build request
|
|
547
|
+
d = {
|
|
548
|
+
"ProjectId": self.config.project_id,
|
|
549
|
+
"Region": self.config.region,
|
|
550
|
+
}
|
|
551
|
+
req and d.update(req)
|
|
552
|
+
d = apis.CreateUDBSlaveRequestSchema().dumps(d)
|
|
553
|
+
|
|
554
|
+
# build options
|
|
555
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
556
|
+
|
|
557
|
+
resp = self.invoke("CreateUDBSlave", d, **kwargs)
|
|
558
|
+
return apis.CreateUDBSlaveResponseSchema().loads(resp)
|
|
559
|
+
|
|
560
|
+
def delete_udb_backup(
|
|
561
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
562
|
+
) -> dict:
|
|
563
|
+
"""DeleteUDBBackup -
|
|
564
|
+
|
|
565
|
+
**Request**
|
|
566
|
+
|
|
567
|
+
- **ProjectId** (str) - (Config)
|
|
568
|
+
- **Region** (str) - (Config)
|
|
569
|
+
- **BackupId** (int) - (Required)
|
|
570
|
+
- **Zone** (str) - (Required)
|
|
571
|
+
- **BackupZone** (str) -
|
|
572
|
+
|
|
573
|
+
**Response**
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
"""
|
|
577
|
+
# build request
|
|
578
|
+
d = {
|
|
579
|
+
"ProjectId": self.config.project_id,
|
|
580
|
+
"Region": self.config.region,
|
|
581
|
+
}
|
|
582
|
+
req and d.update(req)
|
|
583
|
+
d = apis.DeleteUDBBackupRequestSchema().dumps(d)
|
|
584
|
+
|
|
585
|
+
# build options
|
|
586
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
587
|
+
|
|
588
|
+
resp = self.invoke("DeleteUDBBackup", d, **kwargs)
|
|
589
|
+
return apis.DeleteUDBBackupResponseSchema().loads(resp)
|
|
590
|
+
|
|
591
|
+
def delete_udb_instance(
|
|
592
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
593
|
+
) -> dict:
|
|
594
|
+
"""DeleteUDBInstance - 删除UDB实例
|
|
595
|
+
|
|
596
|
+
**Request**
|
|
597
|
+
|
|
598
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
599
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
600
|
+
- **DBId** (str) - (Required) DB实例的id,该值可以通过DescribeUDBInstance获取
|
|
601
|
+
- **UDBCId** (str) - 专区ID
|
|
602
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
603
|
+
|
|
604
|
+
**Response**
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
"""
|
|
608
|
+
# build request
|
|
609
|
+
d = {
|
|
610
|
+
"ProjectId": self.config.project_id,
|
|
611
|
+
"Region": self.config.region,
|
|
612
|
+
}
|
|
613
|
+
req and d.update(req)
|
|
614
|
+
d = apis.DeleteUDBInstanceRequestSchema().dumps(d)
|
|
615
|
+
|
|
616
|
+
resp = self.invoke("DeleteUDBInstance", d, **kwargs)
|
|
617
|
+
return apis.DeleteUDBInstanceResponseSchema().loads(resp)
|
|
618
|
+
|
|
619
|
+
def delete_udb_log_package(
|
|
620
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
621
|
+
) -> dict:
|
|
622
|
+
"""DeleteUDBLogPackage - 删除UDB日志包
|
|
623
|
+
|
|
624
|
+
**Request**
|
|
625
|
+
|
|
626
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
627
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
628
|
+
- **BackupId** (int) - (Required) 日志包id,可通过DescribeUDBLogPackage获得
|
|
629
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
630
|
+
- **BackupZone** (str) - 跨可用区高可用备库所在可用区
|
|
631
|
+
|
|
632
|
+
**Response**
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
"""
|
|
636
|
+
# build request
|
|
637
|
+
d = {
|
|
638
|
+
"ProjectId": self.config.project_id,
|
|
639
|
+
"Region": self.config.region,
|
|
640
|
+
}
|
|
641
|
+
req and d.update(req)
|
|
642
|
+
d = apis.DeleteUDBLogPackageRequestSchema().dumps(d)
|
|
643
|
+
|
|
644
|
+
resp = self.invoke("DeleteUDBLogPackage", d, **kwargs)
|
|
645
|
+
return apis.DeleteUDBLogPackageResponseSchema().loads(resp)
|
|
646
|
+
|
|
647
|
+
def delete_udb_param_group(
|
|
648
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
649
|
+
) -> dict:
|
|
650
|
+
"""DeleteUDBParamGroup - 删除配置参数组
|
|
651
|
+
|
|
652
|
+
**Request**
|
|
653
|
+
|
|
654
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
655
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
656
|
+
- **GroupId** (int) - (Required) 参数组id,可通过DescribeUDBParamGroup获取
|
|
657
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
658
|
+
- **RegionFlag** (bool) - 是否属于地域级别
|
|
659
|
+
|
|
660
|
+
**Response**
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
"""
|
|
664
|
+
# build request
|
|
665
|
+
d = {
|
|
666
|
+
"ProjectId": self.config.project_id,
|
|
667
|
+
"Region": self.config.region,
|
|
668
|
+
}
|
|
669
|
+
req and d.update(req)
|
|
670
|
+
d = apis.DeleteUDBParamGroupRequestSchema().dumps(d)
|
|
671
|
+
|
|
672
|
+
resp = self.invoke("DeleteUDBParamGroup", d, **kwargs)
|
|
673
|
+
return apis.DeleteUDBParamGroupResponseSchema().loads(resp)
|
|
674
|
+
|
|
675
|
+
def describe_mongo_db_sharded_cluster(
|
|
676
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
677
|
+
) -> dict:
|
|
678
|
+
"""DescribeMongoDBShardedCluster -
|
|
679
|
+
|
|
680
|
+
**Request**
|
|
681
|
+
|
|
682
|
+
- **ProjectId** (str) - (Config)
|
|
683
|
+
- **Region** (str) - (Config)
|
|
684
|
+
- **Limit** (int) - (Required)
|
|
685
|
+
- **Offset** (int) - (Required)
|
|
686
|
+
- **Zone** (str) - (Required)
|
|
687
|
+
- **ClusterRole** (str) -
|
|
688
|
+
- **ShardedCluster** (str) -
|
|
689
|
+
|
|
690
|
+
**Response**
|
|
691
|
+
|
|
692
|
+
- **DataSet** (list) - 见 **UDBInstanceSet** 模型定义
|
|
693
|
+
- **ShardedClusterSet** (list) - 见 **MongoDBShardedClusterSet** 模型定义
|
|
694
|
+
- **TotalCount** (int) -
|
|
695
|
+
|
|
696
|
+
**Response Model**
|
|
697
|
+
|
|
698
|
+
**UDBInstanceSet**
|
|
699
|
+
- **AdminUser** (str) -
|
|
700
|
+
- **BackupBeginTime** (int) -
|
|
701
|
+
- **BackupBlacklist** (str) -
|
|
702
|
+
- **BackupCount** (int) -
|
|
703
|
+
- **BackupDate** (str) -
|
|
704
|
+
- **BackupDuration** (int) -
|
|
705
|
+
- **BackupMethod** (str) -
|
|
706
|
+
- **BackupZone** (str) -
|
|
707
|
+
- **CPU** (int) -
|
|
708
|
+
- **CaseSensitivityParam** (int) -
|
|
709
|
+
- **ChargeType** (str) -
|
|
710
|
+
- **CluserRole** (str) -
|
|
711
|
+
- **ClusterRole** (str) -
|
|
712
|
+
- **CreateTime** (int) -
|
|
713
|
+
- **DBId** (str) -
|
|
714
|
+
- **DBSubVersion** (str) -
|
|
715
|
+
- **DBTypeId** (str) -
|
|
716
|
+
- **DataFileSize** (float) -
|
|
717
|
+
- **DataSet** (list) - 见 **UDBSlaveInstanceSet** 模型定义
|
|
718
|
+
- **DiskSpace** (int) -
|
|
719
|
+
- **DiskUsedSize** (float) -
|
|
720
|
+
- **EnableSSL** (int) -
|
|
721
|
+
- **ExpiredTime** (int) -
|
|
722
|
+
- **IPv6Address** (str) -
|
|
723
|
+
- **InstanceMode** (str) -
|
|
724
|
+
- **InstanceType** (str) -
|
|
725
|
+
- **InstanceTypeId** (int) -
|
|
726
|
+
- **LogFileSize** (float) -
|
|
727
|
+
- **MachineType** (str) -
|
|
728
|
+
- **MemoryLimit** (int) -
|
|
729
|
+
- **ModifyTime** (int) -
|
|
730
|
+
- **Name** (str) -
|
|
731
|
+
- **ParamGroupId** (int) -
|
|
732
|
+
- **Port** (int) -
|
|
733
|
+
- **Role** (str) -
|
|
734
|
+
- **SSDType** (str) -
|
|
735
|
+
- **SSLExpirationTime** (int) -
|
|
736
|
+
- **SpecificationType** (int) -
|
|
737
|
+
- **SrcDBId** (str) -
|
|
738
|
+
- **State** (str) -
|
|
739
|
+
- **SubnetId** (str) -
|
|
740
|
+
- **SystemFileSize** (float) -
|
|
741
|
+
- **Tag** (str) -
|
|
742
|
+
- **UseSSD** (bool) -
|
|
743
|
+
- **UserUFileData** (dict) - 见 **UFileDataSet** 模型定义
|
|
744
|
+
- **VPCId** (str) -
|
|
745
|
+
- **VirtualIP** (str) -
|
|
746
|
+
- **VirtualIPMac** (str) -
|
|
747
|
+
- **Zone** (str) -
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
**UDBSlaveInstanceSet**
|
|
751
|
+
- **AdminUser** (str) -
|
|
752
|
+
- **BackupBeginTime** (int) -
|
|
753
|
+
- **BackupBlacklist** (str) -
|
|
754
|
+
- **BackupCount** (int) -
|
|
755
|
+
- **BackupDate** (str) -
|
|
756
|
+
- **BackupDuration** (int) -
|
|
757
|
+
- **CaseSensitivityParam** (int) -
|
|
758
|
+
- **ChargeType** (str) -
|
|
759
|
+
- **ClusterRole** (str) -
|
|
760
|
+
- **CreateTime** (int) -
|
|
761
|
+
- **DBId** (str) -
|
|
762
|
+
- **DBTypeId** (str) -
|
|
763
|
+
- **DataFileSize** (float) -
|
|
764
|
+
- **DiskSpace** (int) -
|
|
765
|
+
- **DiskUsedSize** (float) -
|
|
766
|
+
- **ExpiredTime** (int) -
|
|
767
|
+
- **IPv6Address** (str) -
|
|
768
|
+
- **InstanceMode** (str) -
|
|
769
|
+
- **InstanceType** (str) -
|
|
770
|
+
- **InstanceTypeId** (int) -
|
|
771
|
+
- **LogFileSize** (float) -
|
|
772
|
+
- **MachineType** (str) -
|
|
773
|
+
- **MemoryLimit** (int) -
|
|
774
|
+
- **ModifyTime** (int) -
|
|
775
|
+
- **Name** (str) -
|
|
776
|
+
- **ParamGroupId** (int) -
|
|
777
|
+
- **Port** (int) -
|
|
778
|
+
- **ReplicationDelaySeconds** (int) -
|
|
779
|
+
- **Role** (str) -
|
|
780
|
+
- **SSDType** (str) -
|
|
781
|
+
- **SpecificationType** (int) -
|
|
782
|
+
- **SrcDBId** (str) -
|
|
783
|
+
- **State** (str) -
|
|
784
|
+
- **SubnetId** (str) -
|
|
785
|
+
- **SystemFileSize** (float) -
|
|
786
|
+
- **Tag** (str) -
|
|
787
|
+
- **UseSSD** (bool) -
|
|
788
|
+
- **VPCId** (str) -
|
|
789
|
+
- **VirtualIP** (str) -
|
|
790
|
+
- **VirtualIPMac** (str) -
|
|
791
|
+
- **Zone** (str) -
|
|
792
|
+
|
|
793
|
+
|
|
794
|
+
**UFileDataSet**
|
|
795
|
+
- **Bucket** (str) -
|
|
796
|
+
- **TokenID** (str) -
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
**MongoDBShardedClusterSet**
|
|
800
|
+
- **CreateTime** (int) -
|
|
801
|
+
- **DBId** (str) -
|
|
802
|
+
- **DBTypeId** (str) -
|
|
803
|
+
- **MongosCount** (int) -
|
|
804
|
+
- **Name** (str) -
|
|
805
|
+
- **ShardsrvCount** (int) -
|
|
806
|
+
- **SubnetId** (str) -
|
|
807
|
+
- **Tag** (str) -
|
|
808
|
+
- **VPCId** (str) -
|
|
809
|
+
- **VirtualIPs** (list) -
|
|
810
|
+
- **Zone** (str) -
|
|
811
|
+
|
|
812
|
+
|
|
813
|
+
"""
|
|
814
|
+
# build request
|
|
815
|
+
d = {
|
|
816
|
+
"ProjectId": self.config.project_id,
|
|
817
|
+
"Region": self.config.region,
|
|
818
|
+
}
|
|
819
|
+
req and d.update(req)
|
|
820
|
+
d = apis.DescribeMongoDBShardedClusterRequestSchema().dumps(d)
|
|
821
|
+
|
|
822
|
+
# build options
|
|
823
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
824
|
+
|
|
825
|
+
resp = self.invoke("DescribeMongoDBShardedCluster", d, **kwargs)
|
|
826
|
+
return apis.DescribeMongoDBShardedClusterResponseSchema().loads(resp)
|
|
827
|
+
|
|
828
|
+
def describe_udb_backup(
|
|
829
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
830
|
+
) -> dict:
|
|
831
|
+
"""DescribeUDBBackup - 列表UDB实例备份信息.Zone不填表示多可用区,填代表单可用区
|
|
832
|
+
|
|
833
|
+
**Request**
|
|
834
|
+
|
|
835
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
836
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
837
|
+
- **Limit** (int) - (Required) 分页显示的条目数,列表操作则指定
|
|
838
|
+
- **Offset** (int) - (Required) 分页显示的起始偏移,列表操作则指定
|
|
839
|
+
- **BackupType** (int) - 备份类型,取值为0或1,0表示自动,1表示手动
|
|
840
|
+
- **BeginTime** (int) - 过滤条件:起始时间(Unix时间戳)
|
|
841
|
+
- **ClassType** (str) - 如果未指定GroupId,则可选是否选取特定DB类型的配置(sql, nosql, postgresql, sqlserver)
|
|
842
|
+
- **DBId** (str) - DB实例Id,如果指定,则只获取该db的备份信息 该值可以通过DescribeUDBInstance获取
|
|
843
|
+
- **EndTime** (int) - 过滤条件:结束时间(Unix时间戳)
|
|
844
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
845
|
+
|
|
846
|
+
**Response**
|
|
847
|
+
|
|
848
|
+
- **DataSet** (list) - 见 **UDBBackupSet** 模型定义
|
|
849
|
+
- **TotalCount** (int) - 满足条件备份总数,如果指定dbid,则是该db备份总数
|
|
850
|
+
|
|
851
|
+
**Response Model**
|
|
852
|
+
|
|
853
|
+
**UDBBackupSet**
|
|
854
|
+
- **BackupEndTime** (int) - 备份完成时间(Unix时间戳)
|
|
855
|
+
- **BackupId** (int) - 备份id
|
|
856
|
+
- **BackupName** (str) - 备份名称
|
|
857
|
+
- **BackupSize** (int) - 备份文件大小(字节)
|
|
858
|
+
- **BackupTime** (int) - 备份时间(Unix时间戳)
|
|
859
|
+
- **BackupType** (int) - 备份类型,取值为0或1,0表示自动,1表示手动
|
|
860
|
+
- **BackupZone** (str) - 跨机房高可用备库所在可用区
|
|
861
|
+
- **DBId** (str) - dbid
|
|
862
|
+
- **DBName** (str) - 对应的db名称
|
|
863
|
+
- **ErrorInfo** (str) - 备份错误信息
|
|
864
|
+
- **MD5** (str) - 备份文件的MD5值,备份完成后显示,备份中或备份失败时为空,目前只支持Mysql NVMe机型与Mongo
|
|
865
|
+
- **State** (str) - 备份状态 Backuping // 备份中 Success // 备份成功 Failed // 备份失败 Expired // 备份过期
|
|
866
|
+
- **Zone** (str) - 备份所在可用区
|
|
867
|
+
|
|
868
|
+
|
|
869
|
+
"""
|
|
870
|
+
# build request
|
|
871
|
+
d = {
|
|
872
|
+
"ProjectId": self.config.project_id,
|
|
873
|
+
"Region": self.config.region,
|
|
874
|
+
}
|
|
875
|
+
req and d.update(req)
|
|
876
|
+
d = apis.DescribeUDBBackupRequestSchema().dumps(d)
|
|
877
|
+
|
|
878
|
+
resp = self.invoke("DescribeUDBBackup", d, **kwargs)
|
|
879
|
+
return apis.DescribeUDBBackupResponseSchema().loads(resp)
|
|
880
|
+
|
|
881
|
+
def describe_udb_backup_blacklist(
|
|
882
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
883
|
+
) -> dict:
|
|
884
|
+
"""DescribeUDBBackupBlacklist - 获取UDB实例的备份黑名单
|
|
885
|
+
|
|
886
|
+
**Request**
|
|
887
|
+
|
|
888
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
889
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
890
|
+
- **DBId** (str) - (Required) DB实例Id,该值可以通过DescribeUDBInstance获取
|
|
891
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
892
|
+
|
|
893
|
+
**Response**
|
|
894
|
+
|
|
895
|
+
- **Blacklist** (str) - DB的黑名单列表, db.%为指定库 dbname.tablename为指定表
|
|
896
|
+
|
|
897
|
+
"""
|
|
898
|
+
# build request
|
|
899
|
+
d = {
|
|
900
|
+
"ProjectId": self.config.project_id,
|
|
901
|
+
"Region": self.config.region,
|
|
902
|
+
}
|
|
903
|
+
req and d.update(req)
|
|
904
|
+
d = apis.DescribeUDBBackupBlacklistRequestSchema().dumps(d)
|
|
905
|
+
|
|
906
|
+
resp = self.invoke("DescribeUDBBackupBlacklist", d, **kwargs)
|
|
907
|
+
return apis.DescribeUDBBackupBlacklistResponseSchema().loads(resp)
|
|
908
|
+
|
|
909
|
+
def describe_udb_binlog_backup_url(
|
|
910
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
911
|
+
) -> dict:
|
|
912
|
+
"""DescribeUDBBinlogBackupURL - 获取UDB的Binlog或者错误日志或者慢查询日志的备份地址
|
|
913
|
+
|
|
914
|
+
**Request**
|
|
915
|
+
|
|
916
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
917
|
+
- **BackupId** (int) - (Required) DB实例日志备份ID,可以从DescribeUDBLogPackage结果当中获得
|
|
918
|
+
- **DBId** (str) - (Required) DB实例Id
|
|
919
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
920
|
+
|
|
921
|
+
**Response**
|
|
922
|
+
|
|
923
|
+
- **BackupPath** (str) - DB实例备份文件的公网地址
|
|
924
|
+
- **InnerBackupPath** (str) - DB实例备份文件的内网地址
|
|
925
|
+
|
|
926
|
+
"""
|
|
927
|
+
# build request
|
|
928
|
+
d = {
|
|
929
|
+
"Region": self.config.region,
|
|
930
|
+
}
|
|
931
|
+
req and d.update(req)
|
|
932
|
+
d = apis.DescribeUDBBinlogBackupURLRequestSchema().dumps(d)
|
|
933
|
+
|
|
934
|
+
resp = self.invoke("DescribeUDBBinlogBackupURL", d, **kwargs)
|
|
935
|
+
return apis.DescribeUDBBinlogBackupURLResponseSchema().loads(resp)
|
|
936
|
+
|
|
937
|
+
def describe_udb_instance(
|
|
938
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
939
|
+
) -> dict:
|
|
940
|
+
"""DescribeUDBInstance - 获取UDB实例信息,支持两类操作:(1)指定DBId用于获取该db的信息;(2)指定ClassType、Offset、Limit用于列表操作,查询某一个类型db。
|
|
941
|
+
|
|
942
|
+
**Request**
|
|
943
|
+
|
|
944
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
945
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
946
|
+
- **ClassType** (str) - DB种类,如果是列表操作,则需要指定,不区分大小写,其取值如下:mysql: SQL;mongo: NOSQL;postgresql: postgresql
|
|
947
|
+
- **DBId** (str) - DB实例id,如果指定则获取单个db实例的描述,否则为列表操作。 指定DBId时无需填写ClassType、Offset、Limit
|
|
948
|
+
- **IncludeSlaves** (bool) - 当只获取这个特定DBId的信息时,如果有该选项,那么把这个DBId实例的所有从库信息一起拉取并返回
|
|
949
|
+
- **IsInUDBC** (bool) - 是否查看专区里面DB
|
|
950
|
+
- **Limit** (int) - 分页显示数量,列表操作时必填
|
|
951
|
+
- **Offset** (int) - 分页显示起始偏移位置,列表操作时必填
|
|
952
|
+
- **Tag** (str) - 根据 业务组 筛选DB
|
|
953
|
+
- **UDBCId** (str) - IsInUDBC为True,UDBCId为空,说明查看整个可用区的专区的db,如果UDBId不为空则只查看此专区下面的db
|
|
954
|
+
- **VPCId** (str) - 根据VPCId筛选DB
|
|
955
|
+
- **Zone** (str) - 可用区,不填时默认全部可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
956
|
+
|
|
957
|
+
**Response**
|
|
958
|
+
|
|
959
|
+
- **DataSet** (list) - 见 **UDBInstanceSet** 模型定义
|
|
960
|
+
- **TotalCount** (int) - 用户db组的数量,对于 mysql: 主从结对数量,没有slave,则只有master mongodb: 副本集数量
|
|
961
|
+
|
|
962
|
+
**Response Model**
|
|
963
|
+
|
|
964
|
+
**UDBInstanceSet**
|
|
965
|
+
- **AdminUser** (str) - 管理员帐户名,默认root
|
|
966
|
+
- **BackupBeginTime** (int) - 备份策略,不可修改,开始时间,单位小时计,默认3点
|
|
967
|
+
- **BackupBlacklist** (str) - 备份策略,备份黑名单,mongodb则不适用
|
|
968
|
+
- **BackupCount** (int) - 备份策略,不可修改,备份文件保留的数量,默认7次
|
|
969
|
+
- **BackupDate** (str) - 备份日期标记位。共7位,每一位为一周中一天的备份情况 0表示关闭当天备份,1表示打开当天备份。最右边的一位 为星期天的备份开关,其余从右到左依次为星期一到星期 六的备份配置开关,每周必须至少设置两天备份。 例如:1100000 表示打开星期六和星期五的自动备份功能
|
|
970
|
+
- **BackupDuration** (int) - 备份策略,一天内备份时间间隔,单位小时,默认24小时
|
|
971
|
+
- **BackupMethod** (str) - 默认的备份方式,nobackup表示不备份, snapshot 表示使用快照备份,logic 表示使用逻辑备份,xtrabackup表示使用物理备份。
|
|
972
|
+
- **BackupZone** (str) - 跨可用区高可用备库所在可用区
|
|
973
|
+
- **CPU** (int) - CPU核数
|
|
974
|
+
- **CaseSensitivityParam** (int) - 0区分大小写, 1不分区
|
|
975
|
+
- **ChargeType** (str) - Year, Month, Dynamic,Trial,默认: Dynamic
|
|
976
|
+
- **ClusterRole** (str) - 当DB类型为mongodb时,返回该实例所在集群中的角色,包括:mongos、configsrv_sccc、configsrv_csrs、shardsrv_datanode、shardsrv_arbiter,其中congfigsrv分为sccc和csrs两种模式,shardsrv分为datanode和arbiter两种模式
|
|
977
|
+
- **CreateTime** (int) - DB实例创建时间,采用UTC计时时间戳
|
|
978
|
+
- **DBId** (str) - DB实例id
|
|
979
|
+
- **DBSubVersion** (str) - mysql实例提供具体小版本信息
|
|
980
|
+
- **DBTypeId** (str) - DB类型id,mysql/mongodb按版本细分各有一个id 目前id的取值范围为[1,7],数值对应的版本如下: 1:mysql-5.5,2:mysql-5.1,3:percona-5.5 4:mongodb-2.4,5:mongodb-2.6,6:mysql-5.6, 7:percona-5.6
|
|
981
|
+
- **DataFileSize** (float) - DB实例数据文件大小,单位GB
|
|
982
|
+
- **DataSet** (list) - 见 **UDBSlaveInstanceSet** 模型定义
|
|
983
|
+
- **DiskSpace** (int) - 磁盘空间(GB), 默认根据配置机型
|
|
984
|
+
- **DiskUsedSize** (float) - DB实例磁盘已使用空间,单位GB
|
|
985
|
+
- **EnableSSL** (int) - mysql是否开启了SSL;1->未开启 2->开启
|
|
986
|
+
- **ExpiredTime** (int) - DB实例过期时间,采用UTC计时时间戳
|
|
987
|
+
- **IPv6Address** (str) - 该实例的ipv6地址
|
|
988
|
+
- **InstanceMode** (str) - UDB实例模式类型, 可选值如下: “Normal”: 普通版UDB实例 “HA”: 高可用版UDB实例
|
|
989
|
+
- **InstanceType** (str) - UDB数据库机型
|
|
990
|
+
- **InstanceTypeId** (int) - UDB数据库机型ID (已弃用)
|
|
991
|
+
- **LogFileSize** (float) - DB实例日志文件大小,单位GB
|
|
992
|
+
- **MachineType** (str) - 数据库机型规格
|
|
993
|
+
- **MemoryLimit** (int) - 内存限制(MB),默认根据配置机型
|
|
994
|
+
- **ModifyTime** (int) - DB实例修改时间,采用UTC计时时间戳
|
|
995
|
+
- **Name** (str) - 实例名称,至少6位
|
|
996
|
+
- **ParamGroupId** (int) - DB实例使用的配置参数组id
|
|
997
|
+
- **Port** (int) - 端口号,mysql默认3306,mongodb默认27017
|
|
998
|
+
- **Role** (str) - DB实例角色,mysql区分master/slave,mongodb多种角色
|
|
999
|
+
- **SSDType** (str) - SSD类型,SATA/PCI-E/NVMe
|
|
1000
|
+
- **SSLExpirationTime** (int) - SSL到期时间
|
|
1001
|
+
- **SpecificationType** (int) - 是否使用可选cpu类型规格
|
|
1002
|
+
- **SrcDBId** (str) - 对mysql的slave而言是master的DBId,对master则为空, 对mongodb则是副本集id
|
|
1003
|
+
- **State** (str) - DB状态标记 Init:初始化中,Fail:安装失败,Starting:启动中,Running:运行,Shutdown:关闭中,Shutoff:已关闭,Delete:已删除,Upgrading:升级中,Promoting:提升为独库进行中,Recovering:恢复中,Recover fail:恢复失败, Remakeing:重做中,RemakeFail:重做失败,VersionUpgrading:小版本升级中,VersionUpgradeWaitForSwitch:高可用等待切换,VersionUpgradeFail:小版本升级失败,UpdatingSSL:修改SSL中,UpdateSSLFail:修改SSL失败,MajorVersionUpgrading:小版本升级中,MajorVersionUpgradeWaitForSwitch:高可用等待切换,MajorVersionUpgradeFail
|
|
1004
|
+
- **SubnetId** (str) - 子网ID
|
|
1005
|
+
- **SystemFileSize** (float) - DB实例系统文件大小,单位GB
|
|
1006
|
+
- **Tag** (str) - 获取资源其他信息
|
|
1007
|
+
- **UseSSD** (bool) - 是否使用SSD
|
|
1008
|
+
- **UserUFileData** (dict) - 见 **UFileDataSet** 模型定义
|
|
1009
|
+
- **VPCId** (str) - VPC的ID
|
|
1010
|
+
- **VirtualIP** (str) - DB实例虚ip
|
|
1011
|
+
- **VirtualIPMac** (str) - DB实例虚ip的mac地址
|
|
1012
|
+
- **Zone** (str) - DB实例所在可用区
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
**UDBSlaveInstanceSet**
|
|
1016
|
+
- **AdminUser** (str) - 管理员帐户名,默认root
|
|
1017
|
+
- **BackupBeginTime** (int) - 备份策略,不可修改,开始时间,单位小时计,默认3点
|
|
1018
|
+
- **BackupBlacklist** (str) - 备份策略,备份黑名单,mongodb则不适用
|
|
1019
|
+
- **BackupCount** (int) - 备份策略,不可修改,备份文件保留的数量,默认7次
|
|
1020
|
+
- **BackupDate** (str) - 备份日期标记位。共7位,每一位为一周中一天的备份情况 0表示关闭当天备份,1表示打开当天备份。最右边的一位 为星期天的备份开关,其余从右到左依次为星期一到星期 六的备份配置开关,每周必须至少设置两天备份。 例如:1100000 表示打开星期六和星期五的自动备份功能
|
|
1021
|
+
- **BackupDuration** (int) - 备份策略,一天内备份时间间隔,单位小时,默认24小时
|
|
1022
|
+
- **CaseSensitivityParam** (int) - 0 区分大小写, 1不区分, 只针对mysql8.0
|
|
1023
|
+
- **ChargeType** (str) - Year, Month, Dynamic,Trial,默认: Dynamic
|
|
1024
|
+
- **ClusterRole** (str) - 当DB类型为mongodb时,返回该实例所在集群中的角色,包括:mongos、configsrv_sccc、configsrv_csrs、shardsrv_datanode、shardsrv_arbiter,其中congfigsrv分为sccc和csrs两种模式,shardsrv分为datanode和arbiter两种模式
|
|
1025
|
+
- **CreateTime** (int) - DB实例创建时间,采用UTC计时时间戳
|
|
1026
|
+
- **DBId** (str) - DB实例id
|
|
1027
|
+
- **DBTypeId** (str) - DB类型id,mysql/mongodb按版本细分各有一个id 目前id的取值范围为[1,7],数值对应的版本如下: 1:mysql-5.5,2:mysql-5.1,3:percona-5.5 4:mongodb-2.4,5:mongodb-2.6,6:mysql-5.6, 7:percona-5.6
|
|
1028
|
+
- **DataFileSize** (float) - DB实例数据文件大小,单位GB
|
|
1029
|
+
- **DiskSpace** (int) - 磁盘空间(GB), 默认根据配置机型
|
|
1030
|
+
- **DiskUsedSize** (float) - DB实例磁盘已使用空间,单位GB
|
|
1031
|
+
- **ExpiredTime** (int) - DB实例过期时间,采用UTC计时时间戳
|
|
1032
|
+
- **InstanceMode** (str) - UDB实例模式类型, 可选值如下: "Normal": 普通版UDB实例;"HA": 高可用版UDB实例
|
|
1033
|
+
- **InstanceType** (str) - UDB数据库机型
|
|
1034
|
+
- **InstanceTypeId** (int) - UDB数据库机型ID
|
|
1035
|
+
- **LogFileSize** (float) - DB实例日志文件大小,单位GB
|
|
1036
|
+
- **MachineType** (str) - 规格类型ID,当SpecificationType为1时有效
|
|
1037
|
+
- **MemoryLimit** (int) - 内存限制(MB),默认根据配置机型
|
|
1038
|
+
- **ModifyTime** (int) - DB实例修改时间,采用UTC计时时间戳
|
|
1039
|
+
- **Name** (str) - 实例名称,至少6位
|
|
1040
|
+
- **ParamGroupId** (int) - DB实例使用的配置参数组id
|
|
1041
|
+
- **Port** (int) - 端口号,mysql默认3306,mongodb默认27017
|
|
1042
|
+
- **ReplicationDelaySeconds** (int) - 延时从库时长
|
|
1043
|
+
- **Role** (str) - DB实例角色,mysql区分master/slave,mongodb多种角色
|
|
1044
|
+
- **SSDType** (str) - SSD类型,SATA/PCI-E
|
|
1045
|
+
- **SpecificationType** (int) - 实例计算规格类型,0或不传代表使用内存方式购买,1代表使用内存-cpu可选配比方式购买,需要填写MachineType
|
|
1046
|
+
- **SrcDBId** (str) - 对mysql的slave而言是master的DBId,对master则为空, 对mongodb则是副本集id
|
|
1047
|
+
- **State** (str) - DB状态标记 Init:初始化中,Fail:安装失败,Starting:启动中,Running:运行,Shutdown:关闭中,Shutoff:已关闭,Delete:已删除,Upgrading:升级中,Promoting:提升为独库进行中,Recovering:恢复中,Recover fail:恢复失败,Remakeing:重做中,RemakeFail:重做失败, MajorVersionUpgrading:小版本升级中,MajorVersionUpgradeWaitForSwitch:高可用等待切换,MajorVersionUpgradeFail
|
|
1048
|
+
- **SubnetId** (str) - 子网ID
|
|
1049
|
+
- **SystemFileSize** (float) - DB实例系统文件大小,单位GB
|
|
1050
|
+
- **Tag** (str) - 获取资源其他信息
|
|
1051
|
+
- **UseSSD** (bool) - 是否使用SSD
|
|
1052
|
+
- **VPCId** (str) - VPC的ID
|
|
1053
|
+
- **VirtualIP** (str) - DB实例虚ip
|
|
1054
|
+
- **VirtualIPMac** (str) - DB实例虚ip的mac地址
|
|
1055
|
+
- **Zone** (str) - 可用区
|
|
1056
|
+
|
|
1057
|
+
|
|
1058
|
+
**UFileDataSet**
|
|
1059
|
+
- **Bucket** (str) - bucket名称
|
|
1060
|
+
- **TokenID** (str) - Ufile的令牌tokenid
|
|
1061
|
+
|
|
1062
|
+
|
|
1063
|
+
"""
|
|
1064
|
+
# build request
|
|
1065
|
+
d = {
|
|
1066
|
+
"ProjectId": self.config.project_id,
|
|
1067
|
+
"Region": self.config.region,
|
|
1068
|
+
}
|
|
1069
|
+
req and d.update(req)
|
|
1070
|
+
d = apis.DescribeUDBInstanceRequestSchema().dumps(d)
|
|
1071
|
+
|
|
1072
|
+
resp = self.invoke("DescribeUDBInstance", d, **kwargs)
|
|
1073
|
+
return apis.DescribeUDBInstanceResponseSchema().loads(resp)
|
|
1074
|
+
|
|
1075
|
+
def describe_udb_instance_backup_state(
|
|
1076
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1077
|
+
) -> dict:
|
|
1078
|
+
"""DescribeUDBInstanceBackupState - 获取UDB实例备份状态
|
|
1079
|
+
|
|
1080
|
+
**Request**
|
|
1081
|
+
|
|
1082
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
1083
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
1084
|
+
- **BackupId** (int) - (Required) 备份记录ID
|
|
1085
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
1086
|
+
- **BackupZone** (str) - 跨可用区高可用备库所在可用区,参见[可用区列表]
|
|
1087
|
+
|
|
1088
|
+
**Response**
|
|
1089
|
+
|
|
1090
|
+
- **BackupEndTime** (int) -
|
|
1091
|
+
- **BackupSize** (int) -
|
|
1092
|
+
- **State** (str) - 备份状态 0 Backuping // 备份中 1 Success // 备份成功 2 Failed // 备份失败 3 Expired // 备份过期
|
|
1093
|
+
|
|
1094
|
+
"""
|
|
1095
|
+
# build request
|
|
1096
|
+
d = {
|
|
1097
|
+
"ProjectId": self.config.project_id,
|
|
1098
|
+
"Region": self.config.region,
|
|
1099
|
+
}
|
|
1100
|
+
req and d.update(req)
|
|
1101
|
+
d = apis.DescribeUDBInstanceBackupStateRequestSchema().dumps(d)
|
|
1102
|
+
|
|
1103
|
+
resp = self.invoke("DescribeUDBInstanceBackupState", d, **kwargs)
|
|
1104
|
+
return apis.DescribeUDBInstanceBackupStateResponseSchema().loads(resp)
|
|
1105
|
+
|
|
1106
|
+
def describe_udb_instance_backup_url(
|
|
1107
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1108
|
+
) -> dict:
|
|
1109
|
+
"""DescribeUDBInstanceBackupURL - 获取UDB备份下载地址
|
|
1110
|
+
|
|
1111
|
+
**Request**
|
|
1112
|
+
|
|
1113
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1114
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1115
|
+
- **BackupId** (int) - (Required) DB实例备份ID,该值可以通过DescribeUDBBackup获取
|
|
1116
|
+
- **DBId** (str) - (Required) DB实例Id,该值可通过DescribeUDBInstance获取
|
|
1117
|
+
- **ValidTime** (int) - DB响应中URL的过期时间,该值最小默认4小时,最大7天。不填默认为四小时。(单位/秒)
|
|
1118
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1119
|
+
|
|
1120
|
+
**Response**
|
|
1121
|
+
|
|
1122
|
+
- **BackupPath** (str) - DB实例备份文件公网的地址
|
|
1123
|
+
- **InnerBackupPath** (str) - DB实例备份文件内网的地址
|
|
1124
|
+
- **MD5** (str) - 备份文件的md5值
|
|
1125
|
+
|
|
1126
|
+
"""
|
|
1127
|
+
# build request
|
|
1128
|
+
d = {
|
|
1129
|
+
"ProjectId": self.config.project_id,
|
|
1130
|
+
"Region": self.config.region,
|
|
1131
|
+
}
|
|
1132
|
+
req and d.update(req)
|
|
1133
|
+
d = apis.DescribeUDBInstanceBackupURLRequestSchema().dumps(d)
|
|
1134
|
+
|
|
1135
|
+
resp = self.invoke("DescribeUDBInstanceBackupURL", d, **kwargs)
|
|
1136
|
+
return apis.DescribeUDBInstanceBackupURLResponseSchema().loads(resp)
|
|
1137
|
+
|
|
1138
|
+
def describe_udb_instance_binlog(
|
|
1139
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1140
|
+
) -> dict:
|
|
1141
|
+
"""DescribeUDBInstanceBinlog - 获取UDB指定时间段的binlog列表
|
|
1142
|
+
|
|
1143
|
+
**Request**
|
|
1144
|
+
|
|
1145
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
1146
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
1147
|
+
- **BeginTime** (int) - (Required) 过滤条件:起始时间(时间戳)
|
|
1148
|
+
- **DBId** (str) - (Required) DB实例Id
|
|
1149
|
+
- **EndTime** (int) - (Required) 过滤条件:结束时间(时间戳)
|
|
1150
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
1151
|
+
|
|
1152
|
+
**Response**
|
|
1153
|
+
|
|
1154
|
+
- **DataSet** (list) - 见 **UDBInstanceBinlogSet** 模型定义
|
|
1155
|
+
|
|
1156
|
+
**Response Model**
|
|
1157
|
+
|
|
1158
|
+
**UDBInstanceBinlogSet**
|
|
1159
|
+
- **BeginTime** (int) - Binlog文件生成时间(时间戳)
|
|
1160
|
+
- **EndTime** (int) - Binlog文件结束时间(时间戳)
|
|
1161
|
+
- **Name** (str) - Binlog文件名
|
|
1162
|
+
- **Size** (int) - Binlog文件大小
|
|
1163
|
+
|
|
1164
|
+
|
|
1165
|
+
"""
|
|
1166
|
+
# build request
|
|
1167
|
+
d = {
|
|
1168
|
+
"ProjectId": self.config.project_id,
|
|
1169
|
+
"Region": self.config.region,
|
|
1170
|
+
}
|
|
1171
|
+
req and d.update(req)
|
|
1172
|
+
d = apis.DescribeUDBInstanceBinlogRequestSchema().dumps(d)
|
|
1173
|
+
|
|
1174
|
+
resp = self.invoke("DescribeUDBInstanceBinlog", d, **kwargs)
|
|
1175
|
+
return apis.DescribeUDBInstanceBinlogResponseSchema().loads(resp)
|
|
1176
|
+
|
|
1177
|
+
def describe_udb_instance_binlog_backup_state(
|
|
1178
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1179
|
+
) -> dict:
|
|
1180
|
+
"""DescribeUDBInstanceBinlogBackupState - 获取udb实例备份状态
|
|
1181
|
+
|
|
1182
|
+
**Request**
|
|
1183
|
+
|
|
1184
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
1185
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
1186
|
+
- **BackupId** (int) - (Required) 备份记录ID
|
|
1187
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
1188
|
+
- **BackupZone** (str) - 跨可用区高可用备库所在可用区
|
|
1189
|
+
|
|
1190
|
+
**Response**
|
|
1191
|
+
|
|
1192
|
+
- **State** (str) - 备份状态 0 Backuping // 备份中 1 Success // 备份成功 2 Failed // 备份失败 3 Expired // 备份过期
|
|
1193
|
+
|
|
1194
|
+
"""
|
|
1195
|
+
# build request
|
|
1196
|
+
d = {
|
|
1197
|
+
"ProjectId": self.config.project_id,
|
|
1198
|
+
"Region": self.config.region,
|
|
1199
|
+
}
|
|
1200
|
+
req and d.update(req)
|
|
1201
|
+
d = apis.DescribeUDBInstanceBinlogBackupStateRequestSchema().dumps(d)
|
|
1202
|
+
|
|
1203
|
+
resp = self.invoke("DescribeUDBInstanceBinlogBackupState", d, **kwargs)
|
|
1204
|
+
return apis.DescribeUDBInstanceBinlogBackupStateResponseSchema().loads(
|
|
1205
|
+
resp
|
|
1206
|
+
)
|
|
1207
|
+
|
|
1208
|
+
def describe_udb_instance_log(
|
|
1209
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1210
|
+
) -> dict:
|
|
1211
|
+
"""DescribeUDBInstanceLog - 查询某一段时间内UDB的错误日志或慢查询日志
|
|
1212
|
+
|
|
1213
|
+
**Request**
|
|
1214
|
+
|
|
1215
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1216
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1217
|
+
- **BeginTime** (int) - (Required) 查询的日志开始的时间戳(Unix Timestamp)。对于实时查询,这个参数应该是上次轮询请求时的时间戳,后台会返回从该值到当前时间的日志内容。
|
|
1218
|
+
- **DBId** (str) - (Required) 实例ID
|
|
1219
|
+
- **EndTime** (int) - (Required) 查询日志的结束时间戳(Unix Timestamp),对于实时查询不传该值,与BeginTime的差值不超过24小时:(EndTime-BeginTime) < 24*60*60
|
|
1220
|
+
- **LogType** (str) - (Required) 查询日志的类型error:错误日志;slow:慢日志
|
|
1221
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1222
|
+
|
|
1223
|
+
**Response**
|
|
1224
|
+
|
|
1225
|
+
- **Log** (str) - 查询到的日志内容,一段纯文本
|
|
1226
|
+
- **NextTime** (str) - 此次查询到的日志的下一个时间,用于下一次轮询时的BeginTime参数;如果日志查询结束则返回为空,前端结束查询
|
|
1227
|
+
|
|
1228
|
+
"""
|
|
1229
|
+
# build request
|
|
1230
|
+
d = {
|
|
1231
|
+
"ProjectId": self.config.project_id,
|
|
1232
|
+
"Region": self.config.region,
|
|
1233
|
+
}
|
|
1234
|
+
req and d.update(req)
|
|
1235
|
+
d = apis.DescribeUDBInstanceLogRequestSchema().dumps(d)
|
|
1236
|
+
|
|
1237
|
+
resp = self.invoke("DescribeUDBInstanceLog", d, **kwargs)
|
|
1238
|
+
return apis.DescribeUDBInstanceLogResponseSchema().loads(resp)
|
|
1239
|
+
|
|
1240
|
+
def describe_udb_instance_price(
|
|
1241
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1242
|
+
) -> dict:
|
|
1243
|
+
"""DescribeUDBInstancePrice - 获取UDB实例价格信息
|
|
1244
|
+
|
|
1245
|
+
**Request**
|
|
1246
|
+
|
|
1247
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1248
|
+
- **DBTypeId** (str) - (Required) UDB实例的DB版本字符串
|
|
1249
|
+
- **DiskSpace** (int) - (Required) 磁盘空间(GB),暂时支持20(GB) - 3000(GB), 输入不带单位
|
|
1250
|
+
- **MemoryLimit** (int) - (Required) 内存限制(MB),单位为MB.目前支持:2000-96000
|
|
1251
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1252
|
+
- **CPU** (int) - CPU个数,如果db类型为sqlserver,则为必填参数
|
|
1253
|
+
- **ChargeType** (str) - Year,按年付费; Month,按月付费 Dynamic,按需付费(需开启权限) Trial,试用(需开启权限)默认为月付
|
|
1254
|
+
- **Count** (int) - 购买DB实例数量,最大数量为10台, 默认为1台
|
|
1255
|
+
- **InstanceMode** (str) - 实例的部署类型。可选值为:Normal: 普通单点实例,Slave: 从库实例,HA: 高可用部署实例,默认是Normal
|
|
1256
|
+
- **InstanceType** (str) - UDB数据库机型: "SATA_SSD": "SSD机型" , "PCIE_SSD": "SSD高性能机型" , "Normal_Volume": "标准大容量机型", "SATA_SSD_Volume": "SSD大容量机型" , "PCIE_SSD_Volume": "SSD高性能大容量机型", "NVMe_SSD": "快杰机型"
|
|
1257
|
+
- **MachineType** (str) - 规格类型ID,当SpecificationType为1时有效
|
|
1258
|
+
- **Quantity** (int) - DB购买多少个"计费时间单位",默认值为1。比如:买2个月,Quantity就是2。如果计费单位是“按月”,并且Quantity为0,表示“购买到月底”
|
|
1259
|
+
- **SSDType** (str) - SSD类型,可选值为"SATA"、“NVMe”. 默认为“SATA”
|
|
1260
|
+
- **SpecificationType** (int) - 实例计算规格类型,0或不传代表使用内存方式购买,1代表使用内存-cpu可选配比方式购买,需要填写MachineType
|
|
1261
|
+
|
|
1262
|
+
**Response**
|
|
1263
|
+
|
|
1264
|
+
- **DataSet** (list) - 见 **UDBInstancePriceSet** 模型定义
|
|
1265
|
+
|
|
1266
|
+
**Response Model**
|
|
1267
|
+
|
|
1268
|
+
**UDBInstancePriceSet**
|
|
1269
|
+
- **ChargeType** (str) - Year, Month, Dynamic,Trial
|
|
1270
|
+
- **Price** (int) - 价格,单位为分
|
|
1271
|
+
|
|
1272
|
+
|
|
1273
|
+
"""
|
|
1274
|
+
# build request
|
|
1275
|
+
d = {
|
|
1276
|
+
"Region": self.config.region,
|
|
1277
|
+
}
|
|
1278
|
+
req and d.update(req)
|
|
1279
|
+
d = apis.DescribeUDBInstancePriceRequestSchema().dumps(d)
|
|
1280
|
+
|
|
1281
|
+
resp = self.invoke("DescribeUDBInstancePrice", d, **kwargs)
|
|
1282
|
+
return apis.DescribeUDBInstancePriceResponseSchema().loads(resp)
|
|
1283
|
+
|
|
1284
|
+
def describe_udb_instance_state(
|
|
1285
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1286
|
+
) -> dict:
|
|
1287
|
+
"""DescribeUDBInstanceState - 获取UDB实例状态
|
|
1288
|
+
|
|
1289
|
+
**Request**
|
|
1290
|
+
|
|
1291
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1292
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1293
|
+
- **DBId** (str) - (Required) 实例的Id,该值可以通过DescribeUDBInstance获取
|
|
1294
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1295
|
+
|
|
1296
|
+
**Response**
|
|
1297
|
+
|
|
1298
|
+
- **State** (str) - DB状态标记 Init:初始化中;Fail:安装失败; Starting:启动中; Running : 运行 ;Shutdown:关闭中; Shutoff :已关闭; Delete:已删除; Upgrading:升级中; Promoting: 提升为独库进行中; Recovering: 恢复中; Recover fail:恢复失败。
|
|
1299
|
+
|
|
1300
|
+
"""
|
|
1301
|
+
# build request
|
|
1302
|
+
d = {
|
|
1303
|
+
"ProjectId": self.config.project_id,
|
|
1304
|
+
"Region": self.config.region,
|
|
1305
|
+
}
|
|
1306
|
+
req and d.update(req)
|
|
1307
|
+
d = apis.DescribeUDBInstanceStateRequestSchema().dumps(d)
|
|
1308
|
+
|
|
1309
|
+
resp = self.invoke("DescribeUDBInstanceState", d, **kwargs)
|
|
1310
|
+
return apis.DescribeUDBInstanceStateResponseSchema().loads(resp)
|
|
1311
|
+
|
|
1312
|
+
def describe_udb_instance_upgrade_price(
|
|
1313
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1314
|
+
) -> dict:
|
|
1315
|
+
"""DescribeUDBInstanceUpgradePrice - 获取UDB实例升降级价格信息
|
|
1316
|
+
|
|
1317
|
+
**Request**
|
|
1318
|
+
|
|
1319
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1320
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1321
|
+
- **DBId** (str) - (Required) 实例的Id
|
|
1322
|
+
- **DiskSpace** (int) - (Required) 磁盘空间(GB), 暂时支持20G - 500G
|
|
1323
|
+
- **MemoryLimit** (int) - (Required) 内存限制(MB)
|
|
1324
|
+
- **CPU** (int) - CPU核数 快杰SQLServer升降级必传
|
|
1325
|
+
- **InstanceType** (str) - "SATA_SSD", "NVMe_SSD"
|
|
1326
|
+
- **MachineType** (str) - 规格类型ID,当SpecificationType为1时有效
|
|
1327
|
+
- **OrderStartTime** (int) - 获取指定时间开始后面的升级价格, 不填的话 是默认当前时间
|
|
1328
|
+
- **SSDType** (str) - "SATA", "NVMe"
|
|
1329
|
+
- **SpecificationType** (int) - 实例计算规格类型,0或不传代表使用内存方式购买,1代表使用内存-cpu可选配比方式购买,需要填写MachineType
|
|
1330
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1331
|
+
|
|
1332
|
+
**Response**
|
|
1333
|
+
|
|
1334
|
+
- **Price** (int) - 价格,单位为分
|
|
1335
|
+
|
|
1336
|
+
"""
|
|
1337
|
+
# build request
|
|
1338
|
+
d = {
|
|
1339
|
+
"ProjectId": self.config.project_id,
|
|
1340
|
+
"Region": self.config.region,
|
|
1341
|
+
}
|
|
1342
|
+
req and d.update(req)
|
|
1343
|
+
d = apis.DescribeUDBInstanceUpgradePriceRequestSchema().dumps(d)
|
|
1344
|
+
|
|
1345
|
+
resp = self.invoke("DescribeUDBInstanceUpgradePrice", d, **kwargs)
|
|
1346
|
+
return apis.DescribeUDBInstanceUpgradePriceResponseSchema().loads(resp)
|
|
1347
|
+
|
|
1348
|
+
def describe_udb_log_backup_url(
|
|
1349
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1350
|
+
) -> dict:
|
|
1351
|
+
"""DescribeUDBLogBackupURL - 获取UDB的错误日志或者慢查询日志备份地址
|
|
1352
|
+
|
|
1353
|
+
**Request**
|
|
1354
|
+
|
|
1355
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1356
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1357
|
+
- **BackupId** (int) - (Required) DB实例日志备份ID, 可以从DescribeUDBLogPackage结果当中获得。
|
|
1358
|
+
- **DBId** (str) - (Required) DB实例Id
|
|
1359
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1360
|
+
|
|
1361
|
+
**Response**
|
|
1362
|
+
|
|
1363
|
+
- **BackupPath** (str) - 备份外网URL
|
|
1364
|
+
- **UsernetPath** (str) - 备份用户网URL
|
|
1365
|
+
|
|
1366
|
+
"""
|
|
1367
|
+
# build request
|
|
1368
|
+
d = {
|
|
1369
|
+
"ProjectId": self.config.project_id,
|
|
1370
|
+
"Region": self.config.region,
|
|
1371
|
+
}
|
|
1372
|
+
req and d.update(req)
|
|
1373
|
+
d = apis.DescribeUDBLogBackupURLRequestSchema().dumps(d)
|
|
1374
|
+
|
|
1375
|
+
resp = self.invoke("DescribeUDBLogBackupURL", d, **kwargs)
|
|
1376
|
+
return apis.DescribeUDBLogBackupURLResponseSchema().loads(resp)
|
|
1377
|
+
|
|
1378
|
+
def describe_udb_log_package(
|
|
1379
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1380
|
+
) -> dict:
|
|
1381
|
+
"""DescribeUDBLogPackage - 列表UDB实例binlog或slowlog或errorlog备份信息
|
|
1382
|
+
|
|
1383
|
+
**Request**
|
|
1384
|
+
|
|
1385
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1386
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1387
|
+
- **Limit** (int) - (Required) 分页显示的条目数,列表操作则指定
|
|
1388
|
+
- **Offset** (int) - (Required) 分页显示的起始偏移,列表操作则指定
|
|
1389
|
+
- **BeginTime** (int) - 过滤条件:起始时间(时间戳)
|
|
1390
|
+
- **DBId** (str) - DB实例Id,如果指定,则只获取该db的备份信息; 当Type为2时必填
|
|
1391
|
+
- **EndTime** (int) - 过滤条件:结束时间(时间戳)
|
|
1392
|
+
- **Type** (int) - 需要列出的备份文件类型,每种类型的值如下: 2 代表 BINLOG_BACKUP; 3 代表 SLOW_QUERY_BACKUP; 4 代表 ERRORLOG_BACKUP;
|
|
1393
|
+
- **Types** (list) - Types作为Type的补充,支持多值传入,可以获取多个类型的日志记录,如:Types.0=2&Types.1=3
|
|
1394
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1395
|
+
|
|
1396
|
+
**Response**
|
|
1397
|
+
|
|
1398
|
+
- **DataSet** (list) - 见 **LogPackageDataSet** 模型定义
|
|
1399
|
+
- **TotalCount** (int) - 备份总数,如果指定dbid,则是该db备份总数
|
|
1400
|
+
|
|
1401
|
+
**Response Model**
|
|
1402
|
+
|
|
1403
|
+
**LogPackageDataSet**
|
|
1404
|
+
- **BackupId** (int) - 备份id
|
|
1405
|
+
- **BackupName** (str) - 备份名称
|
|
1406
|
+
- **BackupSize** (int) - 备份文件大小
|
|
1407
|
+
- **BackupTime** (int) - 备份时间
|
|
1408
|
+
- **BackupType** (int) - 备份类型,包括2-binlog备份,3-slowlog备份
|
|
1409
|
+
- **BackupZone** (str) - 跨可用区高可用备库所在可用区
|
|
1410
|
+
- **BinlogType** (str) - binlog备份类型 Manual //手动备份 Auto //自动备份
|
|
1411
|
+
- **DBId** (str) - dbid
|
|
1412
|
+
- **DBName** (str) - 对应的db名称
|
|
1413
|
+
- **State** (str) - 备份状态 Backuping // 备份中 Success // 备份成功 Failed // 备份失败 Expired // 备份过期
|
|
1414
|
+
- **Zone** (str) - 所在可用区
|
|
1415
|
+
|
|
1416
|
+
|
|
1417
|
+
"""
|
|
1418
|
+
# build request
|
|
1419
|
+
d = {
|
|
1420
|
+
"ProjectId": self.config.project_id,
|
|
1421
|
+
"Region": self.config.region,
|
|
1422
|
+
}
|
|
1423
|
+
req and d.update(req)
|
|
1424
|
+
d = apis.DescribeUDBLogPackageRequestSchema().dumps(d)
|
|
1425
|
+
|
|
1426
|
+
resp = self.invoke("DescribeUDBLogPackage", d, **kwargs)
|
|
1427
|
+
return apis.DescribeUDBLogPackageResponseSchema().loads(resp)
|
|
1428
|
+
|
|
1429
|
+
def describe_udb_param_group(
|
|
1430
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1431
|
+
) -> dict:
|
|
1432
|
+
"""DescribeUDBParamGroup - 获取参数组详细参数信息
|
|
1433
|
+
|
|
1434
|
+
**Request**
|
|
1435
|
+
|
|
1436
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1437
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1438
|
+
- **Limit** (int) - (Required) 分页显示的条目数,列表操作则指定
|
|
1439
|
+
- **Offset** (int) - (Required) 分页显示的起始偏移,列表操作则指定
|
|
1440
|
+
- **ClassType** (str) - 如果未指定GroupId,则可选是否选取特定DB类型的配置(sql, nosql, postgresql, sqlserver)
|
|
1441
|
+
- **GroupId** (int) - 参数组id,如果指定则获取描述,否则是列表操作,需要 指定Offset/Limit
|
|
1442
|
+
- **IsInUDBC** (bool) - 是否选取专区中配置
|
|
1443
|
+
- **RegionFlag** (bool) - 当请求没有填写Zone时,如果指定为true,表示只拉取跨可用区的相关配置文件,否则,拉取所有机房的配置文件(包括每个单可用区和跨可用区)
|
|
1444
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1445
|
+
|
|
1446
|
+
**Response**
|
|
1447
|
+
|
|
1448
|
+
- **DataSet** (list) - 见 **UDBParamGroupSet** 模型定义
|
|
1449
|
+
- **TotalCount** (int) - 参数组总数,列表操作时才会有该参数
|
|
1450
|
+
|
|
1451
|
+
**Response Model**
|
|
1452
|
+
|
|
1453
|
+
**UDBParamGroupSet**
|
|
1454
|
+
- **DBTypeId** (str) - DB类型id,mysql/mongodb按版本细分各有一个id 目前id的取值范围为[1,7],数值对应的版本如下 1:mysql-5.5,2:mysql-5.1,3:percona-5.5 4:mongodb-2.4,5:mongodb-2.6,6:mysql-5.6 7:percona-5.6
|
|
1455
|
+
- **Description** (str) - 参数组描述
|
|
1456
|
+
- **GroupId** (int) - 参数组id
|
|
1457
|
+
- **GroupName** (str) - 参数组名称
|
|
1458
|
+
- **Modifiable** (bool) - 参数组是否可修改
|
|
1459
|
+
- **ParamMember** (list) - 见 **UDBParamMemberSet** 模型定义
|
|
1460
|
+
- **RegionFlag** (bool) -
|
|
1461
|
+
- **Zone** (str) -
|
|
1462
|
+
|
|
1463
|
+
|
|
1464
|
+
**UDBParamMemberSet**
|
|
1465
|
+
- **AllowedVal** (str) - 允许的值(根据参数类型,用分隔符表示)
|
|
1466
|
+
- **ApplyType** (int) - 参数值应用类型,取值范围为{0,10,20},各值代表 意义为0-unknown、10-static、20-dynamic
|
|
1467
|
+
- **FormatType** (int) - 允许值的格式类型,取值范围为{0,10,20},意义分 别为PVFT_UNKOWN=0,PVFT_RANGE=10, PVFT_ENUM=20
|
|
1468
|
+
- **Key** (str) - 参数名称
|
|
1469
|
+
- **Modifiable** (bool) - 是否可更改,默认为false
|
|
1470
|
+
- **Value** (str) - 参数值
|
|
1471
|
+
- **ValueType** (int) - 参数值应用类型,取值范围为{0,10,20,30},各值 代表意义为 0-unknown、10-int、20-string、 30-bool
|
|
1472
|
+
|
|
1473
|
+
|
|
1474
|
+
"""
|
|
1475
|
+
# build request
|
|
1476
|
+
d = {
|
|
1477
|
+
"ProjectId": self.config.project_id,
|
|
1478
|
+
"Region": self.config.region,
|
|
1479
|
+
}
|
|
1480
|
+
req and d.update(req)
|
|
1481
|
+
d = apis.DescribeUDBParamGroupRequestSchema().dumps(d)
|
|
1482
|
+
|
|
1483
|
+
resp = self.invoke("DescribeUDBParamGroup", d, **kwargs)
|
|
1484
|
+
return apis.DescribeUDBParamGroupResponseSchema().loads(resp)
|
|
1485
|
+
|
|
1486
|
+
def describe_udb_splitting_info(
|
|
1487
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1488
|
+
) -> dict:
|
|
1489
|
+
"""DescribeUDBSplittingInfo - 描述读写分离功能的详细信息
|
|
1490
|
+
|
|
1491
|
+
**Request**
|
|
1492
|
+
|
|
1493
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1494
|
+
- **MasterDBId** (str) - (Required) DB实例ID
|
|
1495
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1496
|
+
|
|
1497
|
+
**Response**
|
|
1498
|
+
|
|
1499
|
+
- **DBTypeId** (str) - 数据库版本
|
|
1500
|
+
- **DataSet** (list) - 见 **UDBRWSplittingSet** 模型定义
|
|
1501
|
+
- **DelayThreshold** (int) - 时间阈值
|
|
1502
|
+
- **MasterDBId** (str) - DB实例ID
|
|
1503
|
+
- **Port** (int) - 端口号
|
|
1504
|
+
- **RWIP** (str) - 读写分离IP
|
|
1505
|
+
- **RWState** (str) - 读写分离状态
|
|
1506
|
+
- **ReadModel** (str) - 读写分离策略
|
|
1507
|
+
- **Zone** (str) - 可用区
|
|
1508
|
+
|
|
1509
|
+
**Response Model**
|
|
1510
|
+
|
|
1511
|
+
**UDBRWSplittingSet**
|
|
1512
|
+
- **DBId** (str) - DB实例ID
|
|
1513
|
+
- **ReadWeight** (int) - 读写分离比重
|
|
1514
|
+
- **Role** (str) - 主库/从库
|
|
1515
|
+
- **State** (str) - DB状态
|
|
1516
|
+
- **VirtualIP** (str) - DBIP
|
|
1517
|
+
|
|
1518
|
+
|
|
1519
|
+
"""
|
|
1520
|
+
# build request
|
|
1521
|
+
d = {
|
|
1522
|
+
"Region": self.config.region,
|
|
1523
|
+
}
|
|
1524
|
+
req and d.update(req)
|
|
1525
|
+
d = apis.DescribeUDBSplittingInfoRequestSchema().dumps(d)
|
|
1526
|
+
|
|
1527
|
+
resp = self.invoke("DescribeUDBSplittingInfo", d, **kwargs)
|
|
1528
|
+
return apis.DescribeUDBSplittingInfoResponseSchema().loads(resp)
|
|
1529
|
+
|
|
1530
|
+
def describe_udb_type(
|
|
1531
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1532
|
+
) -> dict:
|
|
1533
|
+
"""DescribeUDBType - 获取UDB支持的类型信息
|
|
1534
|
+
|
|
1535
|
+
**Request**
|
|
1536
|
+
|
|
1537
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1538
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1539
|
+
- **BackupZone** (str) - 跨可用区高可用DB的备库所在区域,仅当该可用区支持跨可用区高可用时填入。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1540
|
+
- **CompatibleWithDBType** (str) - 返回从备份创建实例时,该版本号所支持的备份创建版本。如果没传,则表示不是从备份创建。
|
|
1541
|
+
- **DBClusterType** (str) - DB实例类型,如mysql,sqlserver,mongo,postgresql
|
|
1542
|
+
- **DBSubVersion** (str) - 返回从备份创建实例时,该小版本号所支持的备份创建小版本。如果没传,则表示不是从备份创建。
|
|
1543
|
+
- **DiskType** (str) - 返回支持某种磁盘类型的DB类型,如Normal、SSD、NVMe_SSD。如果没传,则表示任何磁盘类型均可。
|
|
1544
|
+
- **InstanceMode** (str) - 返回支持某种实例类型的DB类型。如果没传,则表示任何实例类型均可。normal:单点,ha:高可用,sharded_cluster:分片集群
|
|
1545
|
+
|
|
1546
|
+
**Response**
|
|
1547
|
+
|
|
1548
|
+
- **DataSet** (list) - 见 **UDBTypeSet** 模型定义
|
|
1549
|
+
|
|
1550
|
+
**Response Model**
|
|
1551
|
+
|
|
1552
|
+
**UDBTypeSet**
|
|
1553
|
+
- **DBSubVersion** (str) - mysql子版本,如mysql-8.0.25,mysql-8.0.16
|
|
1554
|
+
- **DBTypeId** (str) - DB类型id,mysql/mongodb按版本细分各有一个id, 目前id的取值范围为[1,7],数值对应的版本如下: 1:mysql-5.5,2:mysql-5.1,3:percona-5.5 4:mongodb-2.4,5:mongodb-2.6,6:mysql-5.6, 7:percona-5.6
|
|
1555
|
+
|
|
1556
|
+
|
|
1557
|
+
"""
|
|
1558
|
+
# build request
|
|
1559
|
+
d = {
|
|
1560
|
+
"Region": self.config.region,
|
|
1561
|
+
}
|
|
1562
|
+
req and d.update(req)
|
|
1563
|
+
d = apis.DescribeUDBTypeRequestSchema().dumps(d)
|
|
1564
|
+
|
|
1565
|
+
resp = self.invoke("DescribeUDBType", d, **kwargs)
|
|
1566
|
+
return apis.DescribeUDBTypeResponseSchema().loads(resp)
|
|
1567
|
+
|
|
1568
|
+
def disable_udb_rw_splitting(
|
|
1569
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1570
|
+
) -> dict:
|
|
1571
|
+
"""DisableUDBRWSplitting - 关闭DB的读写分离功能
|
|
1572
|
+
|
|
1573
|
+
**Request**
|
|
1574
|
+
|
|
1575
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1576
|
+
- **MasterDBId** (str) - (Required) DB实例ID(master)
|
|
1577
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1578
|
+
|
|
1579
|
+
**Response**
|
|
1580
|
+
|
|
1581
|
+
|
|
1582
|
+
"""
|
|
1583
|
+
# build request
|
|
1584
|
+
d = {
|
|
1585
|
+
"Region": self.config.region,
|
|
1586
|
+
}
|
|
1587
|
+
req and d.update(req)
|
|
1588
|
+
d = apis.DisableUDBRWSplittingRequestSchema().dumps(d)
|
|
1589
|
+
|
|
1590
|
+
resp = self.invoke("DisableUDBRWSplitting", d, **kwargs)
|
|
1591
|
+
return apis.DisableUDBRWSplittingResponseSchema().loads(resp)
|
|
1592
|
+
|
|
1593
|
+
def edit_udb_backup_blacklist(
|
|
1594
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1595
|
+
) -> dict:
|
|
1596
|
+
"""EditUDBBackupBlacklist - 编辑UDB实例的备份黑名单
|
|
1597
|
+
|
|
1598
|
+
**Request**
|
|
1599
|
+
|
|
1600
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
1601
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
1602
|
+
- **Blacklist** (str) - (Required) 黑名单,规范示例,指定库mysql.%;test.%; 指定表city.address;
|
|
1603
|
+
- **DBId** (str) - (Required) DB实例Id,该值可以通过DescribeUDBInstance获取
|
|
1604
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
1605
|
+
|
|
1606
|
+
**Response**
|
|
1607
|
+
|
|
1608
|
+
|
|
1609
|
+
"""
|
|
1610
|
+
# build request
|
|
1611
|
+
d = {
|
|
1612
|
+
"ProjectId": self.config.project_id,
|
|
1613
|
+
"Region": self.config.region,
|
|
1614
|
+
}
|
|
1615
|
+
req and d.update(req)
|
|
1616
|
+
d = apis.EditUDBBackupBlacklistRequestSchema().dumps(d)
|
|
1617
|
+
|
|
1618
|
+
resp = self.invoke("EditUDBBackupBlacklist", d, **kwargs)
|
|
1619
|
+
return apis.EditUDBBackupBlacklistResponseSchema().loads(resp)
|
|
1620
|
+
|
|
1621
|
+
def enable_udb_rw_splitting(
|
|
1622
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1623
|
+
) -> dict:
|
|
1624
|
+
"""EnableUDBRWSplitting - 开启DB的读写分离功能
|
|
1625
|
+
|
|
1626
|
+
**Request**
|
|
1627
|
+
|
|
1628
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1629
|
+
- **MasterDBId** (str) - (Required) DB实例ID(主库)
|
|
1630
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1631
|
+
- **BackupZone** (str) - 备份的可用区。用于创建跨可用区读写分离的一个节点,跨机房的读写分离必须有这个参数
|
|
1632
|
+
|
|
1633
|
+
**Response**
|
|
1634
|
+
|
|
1635
|
+
- **MasterDBId** (str) - DB实例ID(主库)
|
|
1636
|
+
- **RWIp** (str) - 读写分离访问IP
|
|
1637
|
+
|
|
1638
|
+
"""
|
|
1639
|
+
# build request
|
|
1640
|
+
d = {
|
|
1641
|
+
"Region": self.config.region,
|
|
1642
|
+
}
|
|
1643
|
+
req and d.update(req)
|
|
1644
|
+
d = apis.EnableUDBRWSplittingRequestSchema().dumps(d)
|
|
1645
|
+
|
|
1646
|
+
resp = self.invoke("EnableUDBRWSplitting", d, **kwargs)
|
|
1647
|
+
return apis.EnableUDBRWSplittingResponseSchema().loads(resp)
|
|
1648
|
+
|
|
1649
|
+
def extract_udb_param_group(
|
|
1650
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1651
|
+
) -> dict:
|
|
1652
|
+
"""ExtractUDBParamGroup - 获取配置文件内容
|
|
1653
|
+
|
|
1654
|
+
**Request**
|
|
1655
|
+
|
|
1656
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1657
|
+
- **GroupId** (int) - (Required) 配置id
|
|
1658
|
+
- **RegionFlag** (bool) - 是否跨可用区,RegionFlag为true时表示跨可用区配置文件。如果RegionFlag=true,Zone可以不传,否则Zone必须传。
|
|
1659
|
+
- **Zone** (str) - 可用区。如果RegionFlag=false,必须传,反之,可不传。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1660
|
+
|
|
1661
|
+
**Response**
|
|
1662
|
+
|
|
1663
|
+
- **Content** (str) - 配置文件内容
|
|
1664
|
+
|
|
1665
|
+
"""
|
|
1666
|
+
# build request
|
|
1667
|
+
d = {
|
|
1668
|
+
"Region": self.config.region,
|
|
1669
|
+
}
|
|
1670
|
+
req and d.update(req)
|
|
1671
|
+
d = apis.ExtractUDBParamGroupRequestSchema().dumps(d)
|
|
1672
|
+
|
|
1673
|
+
resp = self.invoke("ExtractUDBParamGroup", d, **kwargs)
|
|
1674
|
+
return apis.ExtractUDBParamGroupResponseSchema().loads(resp)
|
|
1675
|
+
|
|
1676
|
+
def fetch_udb_instance_earliest_recover_time(
|
|
1677
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1678
|
+
) -> dict:
|
|
1679
|
+
"""FetchUDBInstanceEarliestRecoverTime - 获取UDB最早可回档的时间点
|
|
1680
|
+
|
|
1681
|
+
**Request**
|
|
1682
|
+
|
|
1683
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1684
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1685
|
+
- **DBId** (str) - (Required) DB实例Id
|
|
1686
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1687
|
+
|
|
1688
|
+
**Response**
|
|
1689
|
+
|
|
1690
|
+
- **EarliestTime** (int) - 获取最早可回档时间点
|
|
1691
|
+
|
|
1692
|
+
"""
|
|
1693
|
+
# build request
|
|
1694
|
+
d = {
|
|
1695
|
+
"ProjectId": self.config.project_id,
|
|
1696
|
+
"Region": self.config.region,
|
|
1697
|
+
}
|
|
1698
|
+
req and d.update(req)
|
|
1699
|
+
d = apis.FetchUDBInstanceEarliestRecoverTimeRequestSchema().dumps(d)
|
|
1700
|
+
|
|
1701
|
+
resp = self.invoke("FetchUDBInstanceEarliestRecoverTime", d, **kwargs)
|
|
1702
|
+
return apis.FetchUDBInstanceEarliestRecoverTimeResponseSchema().loads(
|
|
1703
|
+
resp
|
|
1704
|
+
)
|
|
1705
|
+
|
|
1706
|
+
def get_udb_client_conn_num(
|
|
1707
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1708
|
+
) -> dict:
|
|
1709
|
+
"""GetUDBClientConnNum - 输入一个DBID,能够获取客户端来源IP以及对应的连接数
|
|
1710
|
+
|
|
1711
|
+
**Request**
|
|
1712
|
+
|
|
1713
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1714
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1715
|
+
- **DBId** (str) - (Required) DB实例id
|
|
1716
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1717
|
+
|
|
1718
|
+
**Response**
|
|
1719
|
+
|
|
1720
|
+
- **DataSet** (list) - 见 **ConnNumMap** 模型定义
|
|
1721
|
+
|
|
1722
|
+
**Response Model**
|
|
1723
|
+
|
|
1724
|
+
**ConnNumMap**
|
|
1725
|
+
- **Ip** (str) - 客户端IP
|
|
1726
|
+
- **Num** (int) - 该Ip连接数
|
|
1727
|
+
|
|
1728
|
+
|
|
1729
|
+
"""
|
|
1730
|
+
# build request
|
|
1731
|
+
d = {
|
|
1732
|
+
"ProjectId": self.config.project_id,
|
|
1733
|
+
"Region": self.config.region,
|
|
1734
|
+
}
|
|
1735
|
+
req and d.update(req)
|
|
1736
|
+
d = apis.GetUDBClientConnNumRequestSchema().dumps(d)
|
|
1737
|
+
|
|
1738
|
+
resp = self.invoke("GetUDBClientConnNum", d, **kwargs)
|
|
1739
|
+
return apis.GetUDBClientConnNumResponseSchema().loads(resp)
|
|
1740
|
+
|
|
1741
|
+
def get_udb_instance_ssl_cert_url(
|
|
1742
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1743
|
+
) -> dict:
|
|
1744
|
+
"""GetUDBInstanceSSLCertURL - 获取SSL证书下载地址
|
|
1745
|
+
|
|
1746
|
+
**Request**
|
|
1747
|
+
|
|
1748
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1749
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1750
|
+
- **DBId** (str) - (Required) 实例ID
|
|
1751
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1752
|
+
- **ExpireTime** (int) - URL的过期时间,该值最小默认1小时,最大7天。(单位/秒)
|
|
1753
|
+
|
|
1754
|
+
**Response**
|
|
1755
|
+
|
|
1756
|
+
- **InnerUrl** (str) - 内网链接
|
|
1757
|
+
- **InternetUrl** (str) - 外网链接
|
|
1758
|
+
|
|
1759
|
+
"""
|
|
1760
|
+
# build request
|
|
1761
|
+
d = {
|
|
1762
|
+
"ProjectId": self.config.project_id,
|
|
1763
|
+
"Region": self.config.region,
|
|
1764
|
+
}
|
|
1765
|
+
req and d.update(req)
|
|
1766
|
+
d = apis.GetUDBInstanceSSLCertURLRequestSchema().dumps(d)
|
|
1767
|
+
|
|
1768
|
+
resp = self.invoke("GetUDBInstanceSSLCertURL", d, **kwargs)
|
|
1769
|
+
return apis.GetUDBInstanceSSLCertURLResponseSchema().loads(resp)
|
|
1770
|
+
|
|
1771
|
+
def list_udb_machine_type(
|
|
1772
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1773
|
+
) -> dict:
|
|
1774
|
+
"""ListUDBMachineType - 获取UDB云数据库支持的计算规格列表,暂不支持获取跨可用区实例的计算规格,目前支持的数据库品类包括:NVMe版和SSD云盘版MySQL
|
|
1775
|
+
|
|
1776
|
+
**Request**
|
|
1777
|
+
|
|
1778
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1779
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1780
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1781
|
+
- **InstanceMode** (str) - UDB实例模式类型, 可选值如下: "Normal": 普通版UDB实例 "HA": 高可用版UDB实例 默认是"Normal"
|
|
1782
|
+
|
|
1783
|
+
**Response**
|
|
1784
|
+
|
|
1785
|
+
- **DataSet** (list) - 见 **MachineType** 模型定义
|
|
1786
|
+
- **DefaultMachineType** (dict) - 见 **MachineType** 模型定义
|
|
1787
|
+
- **Message** (str) - 接口返回信息
|
|
1788
|
+
|
|
1789
|
+
**Response Model**
|
|
1790
|
+
|
|
1791
|
+
**MachineType**
|
|
1792
|
+
- **Cpu** (int) - 规格cpu核数
|
|
1793
|
+
- **Description** (str) - 计算规格描述,格式为"nCmG",表示n核mG内存实例
|
|
1794
|
+
- **Group** (str) - 内存/cpu配比
|
|
1795
|
+
- **ID** (str) - 计算规格id, 目前支持CPU和内存比1:2、1:4、1:8三类配比规格;规格的格式为:"机型.配比.CPU核数规格";机型支持o和n两种机型,分别代表快杰NVMe和SSD云盘机型;配比映射关系如下:2m代表CPU内存配比1比2,4m代表CPU内存配比1比4,8m代表CPU内存配比1比8,CPU核数规格射关系如下:small代表1C,medium代表2C,xlarge代表4C,2xlarge代表8C,4xlarge代表16C,8xlarge代表32C,16xlarge代表64C,例如 "o.mysql4m.medium"表示创建快杰NVMe机型2C8G的实例,"o.mysql8m.4xlarge"表示创建快杰NVMe机型16C128G的实例
|
|
1796
|
+
- **Memory** (int) - 规格内存大小,单位(GB)
|
|
1797
|
+
- **Os** (str) - 内部云主机机型,可选"o/n"
|
|
1798
|
+
|
|
1799
|
+
|
|
1800
|
+
"""
|
|
1801
|
+
# build request
|
|
1802
|
+
d = {
|
|
1803
|
+
"ProjectId": self.config.project_id,
|
|
1804
|
+
"Region": self.config.region,
|
|
1805
|
+
}
|
|
1806
|
+
req and d.update(req)
|
|
1807
|
+
d = apis.ListUDBMachineTypeRequestSchema().dumps(d)
|
|
1808
|
+
|
|
1809
|
+
resp = self.invoke("ListUDBMachineType", d, **kwargs)
|
|
1810
|
+
return apis.ListUDBMachineTypeResponseSchema().loads(resp)
|
|
1811
|
+
|
|
1812
|
+
def list_udb_user_tables(
|
|
1813
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1814
|
+
) -> dict:
|
|
1815
|
+
"""ListUDBUserTables - 查看udb实例所有的用户表集合 (只包括引擎为innodb和myisam的表)
|
|
1816
|
+
|
|
1817
|
+
**Request**
|
|
1818
|
+
|
|
1819
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1820
|
+
- **DBId** (str) - (Required) udb实例的ID
|
|
1821
|
+
|
|
1822
|
+
**Response**
|
|
1823
|
+
|
|
1824
|
+
- **Tables** (list) - 见 **UDBDatabaseData** 模型定义
|
|
1825
|
+
|
|
1826
|
+
**Response Model**
|
|
1827
|
+
|
|
1828
|
+
**UDBDatabaseData**
|
|
1829
|
+
- **DBName** (str) - 数据库名称
|
|
1830
|
+
- **TableDataSet** (list) - 见 **TableData** 模型定义
|
|
1831
|
+
|
|
1832
|
+
|
|
1833
|
+
**TableData**
|
|
1834
|
+
- **DBName** (str) - 表所属的库名称
|
|
1835
|
+
- **Engine** (str) - 表的引擎(innodb, myisam)
|
|
1836
|
+
- **TableName** (str) - 表名称
|
|
1837
|
+
|
|
1838
|
+
|
|
1839
|
+
"""
|
|
1840
|
+
# build request
|
|
1841
|
+
d = {
|
|
1842
|
+
"Region": self.config.region,
|
|
1843
|
+
}
|
|
1844
|
+
req and d.update(req)
|
|
1845
|
+
d = apis.ListUDBUserTablesRequestSchema().dumps(d)
|
|
1846
|
+
|
|
1847
|
+
resp = self.invoke("ListUDBUserTables", d, **kwargs)
|
|
1848
|
+
return apis.ListUDBUserTablesResponseSchema().loads(resp)
|
|
1849
|
+
|
|
1850
|
+
def modify_udb_instance_name(
|
|
1851
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1852
|
+
) -> dict:
|
|
1853
|
+
"""ModifyUDBInstanceName - 重命名UDB实例
|
|
1854
|
+
|
|
1855
|
+
**Request**
|
|
1856
|
+
|
|
1857
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1858
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1859
|
+
- **DBId** (str) - (Required) 实例的Id,该值可以通过DescribeUDBInstance获取
|
|
1860
|
+
- **Name** (str) - (Required) 实例的新名字, 长度要求为6~63位
|
|
1861
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1862
|
+
|
|
1863
|
+
**Response**
|
|
1864
|
+
|
|
1865
|
+
|
|
1866
|
+
"""
|
|
1867
|
+
# build request
|
|
1868
|
+
d = {
|
|
1869
|
+
"ProjectId": self.config.project_id,
|
|
1870
|
+
"Region": self.config.region,
|
|
1871
|
+
}
|
|
1872
|
+
req and d.update(req)
|
|
1873
|
+
d = apis.ModifyUDBInstanceNameRequestSchema().dumps(d)
|
|
1874
|
+
|
|
1875
|
+
resp = self.invoke("ModifyUDBInstanceName", d, **kwargs)
|
|
1876
|
+
return apis.ModifyUDBInstanceNameResponseSchema().loads(resp)
|
|
1877
|
+
|
|
1878
|
+
def modify_udb_instance_password(
|
|
1879
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1880
|
+
) -> dict:
|
|
1881
|
+
"""ModifyUDBInstancePassword - 修改DB实例的管理员密码
|
|
1882
|
+
|
|
1883
|
+
**Request**
|
|
1884
|
+
|
|
1885
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1886
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1887
|
+
- **DBId** (str) - (Required) 实例的ID,该值可以通过DescribeUDBInstance获取
|
|
1888
|
+
- **Password** (str) - (Required) 实例的新密码
|
|
1889
|
+
- **AccountName** (str) - sqlserver帐号,仅在sqlserver的情况下填该参数
|
|
1890
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1891
|
+
|
|
1892
|
+
**Response**
|
|
1893
|
+
|
|
1894
|
+
|
|
1895
|
+
"""
|
|
1896
|
+
# build request
|
|
1897
|
+
d = {
|
|
1898
|
+
"ProjectId": self.config.project_id,
|
|
1899
|
+
"Region": self.config.region,
|
|
1900
|
+
}
|
|
1901
|
+
req and d.update(req)
|
|
1902
|
+
d = apis.ModifyUDBInstancePasswordRequestSchema().dumps(d)
|
|
1903
|
+
|
|
1904
|
+
resp = self.invoke("ModifyUDBInstancePassword", d, **kwargs)
|
|
1905
|
+
return apis.ModifyUDBInstancePasswordResponseSchema().loads(resp)
|
|
1906
|
+
|
|
1907
|
+
def modify_udb_instance_remark_name(
|
|
1908
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1909
|
+
) -> dict:
|
|
1910
|
+
"""ModifyUDBInstanceRemarkName - 修改UDB实例备注信息
|
|
1911
|
+
|
|
1912
|
+
**Request**
|
|
1913
|
+
|
|
1914
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1915
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1916
|
+
- **DBId** (str) - (Required) 实例的Id,该值可以通过DescribeUDBInstance获取
|
|
1917
|
+
- **Name** (str) - (Required) 实例的新备注
|
|
1918
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1919
|
+
|
|
1920
|
+
**Response**
|
|
1921
|
+
|
|
1922
|
+
|
|
1923
|
+
"""
|
|
1924
|
+
# build request
|
|
1925
|
+
d = {
|
|
1926
|
+
"ProjectId": self.config.project_id,
|
|
1927
|
+
"Region": self.config.region,
|
|
1928
|
+
}
|
|
1929
|
+
req and d.update(req)
|
|
1930
|
+
d = apis.ModifyUDBInstanceRemarkNameRequestSchema().dumps(d)
|
|
1931
|
+
|
|
1932
|
+
resp = self.invoke("ModifyUDBInstanceRemarkName", d, **kwargs)
|
|
1933
|
+
return apis.ModifyUDBInstanceRemarkNameResponseSchema().loads(resp)
|
|
1934
|
+
|
|
1935
|
+
def modify_udb_instance_ssl(
|
|
1936
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1937
|
+
) -> dict:
|
|
1938
|
+
"""ModifyUDBInstanceSSL - 调整SSL的信息
|
|
1939
|
+
|
|
1940
|
+
**Request**
|
|
1941
|
+
|
|
1942
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1943
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1944
|
+
- **DBId** (str) - (Required) 实例ID
|
|
1945
|
+
- **EnableSSL** (int) - (Required) 是否开启SSL 1->关闭 2->开启
|
|
1946
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1947
|
+
- **ValidTime** (int) - SSL证书有效时间,1-5年,默认为1年
|
|
1948
|
+
|
|
1949
|
+
**Response**
|
|
1950
|
+
|
|
1951
|
+
|
|
1952
|
+
"""
|
|
1953
|
+
# build request
|
|
1954
|
+
d = {
|
|
1955
|
+
"ProjectId": self.config.project_id,
|
|
1956
|
+
"Region": self.config.region,
|
|
1957
|
+
}
|
|
1958
|
+
req and d.update(req)
|
|
1959
|
+
d = apis.ModifyUDBInstanceSSLRequestSchema().dumps(d)
|
|
1960
|
+
|
|
1961
|
+
resp = self.invoke("ModifyUDBInstanceSSL", d, **kwargs)
|
|
1962
|
+
return apis.ModifyUDBInstanceSSLResponseSchema().loads(resp)
|
|
1963
|
+
|
|
1964
|
+
def promote_udb_instance_to_ha(
|
|
1965
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1966
|
+
) -> dict:
|
|
1967
|
+
"""PromoteUDBInstanceToHA - 普通db升级为高可用(只针对mysql5.5及以上版本SSD机型的实例) ,对于NVMe机型的单点升级高可用,虽然也能使用该操作再加上SwitchUDBInstanceToHA,但是更建议直接调用新的API接口(UpgradeUDBInstanceToHA)
|
|
1968
|
+
|
|
1969
|
+
**Request**
|
|
1970
|
+
|
|
1971
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1972
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1973
|
+
- **DBId** (str) - (Required) 实例的Id,该值可以通过DescribeUDBInstance获取
|
|
1974
|
+
|
|
1975
|
+
**Response**
|
|
1976
|
+
|
|
1977
|
+
|
|
1978
|
+
"""
|
|
1979
|
+
# build request
|
|
1980
|
+
d = {
|
|
1981
|
+
"ProjectId": self.config.project_id,
|
|
1982
|
+
"Region": self.config.region,
|
|
1983
|
+
}
|
|
1984
|
+
req and d.update(req)
|
|
1985
|
+
d = apis.PromoteUDBInstanceToHARequestSchema().dumps(d)
|
|
1986
|
+
|
|
1987
|
+
resp = self.invoke("PromoteUDBInstanceToHA", d, **kwargs)
|
|
1988
|
+
return apis.PromoteUDBInstanceToHAResponseSchema().loads(resp)
|
|
1989
|
+
|
|
1990
|
+
def promote_udb_slave(
|
|
1991
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1992
|
+
) -> dict:
|
|
1993
|
+
"""PromoteUDBSlave - 从库提升为独立库
|
|
1994
|
+
|
|
1995
|
+
**Request**
|
|
1996
|
+
|
|
1997
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1998
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1999
|
+
- **DBId** (str) - (Required) 实例的Id,该值可以通过DescribeUDBInstance获取
|
|
2000
|
+
- **IsForce** (bool) - 是否强制(如果从库落后可能会禁止提升),默认false 如果落后情况下,强制提升丢失数据
|
|
2001
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2002
|
+
|
|
2003
|
+
**Response**
|
|
2004
|
+
|
|
2005
|
+
|
|
2006
|
+
"""
|
|
2007
|
+
# build request
|
|
2008
|
+
d = {
|
|
2009
|
+
"ProjectId": self.config.project_id,
|
|
2010
|
+
"Region": self.config.region,
|
|
2011
|
+
}
|
|
2012
|
+
req and d.update(req)
|
|
2013
|
+
d = apis.PromoteUDBSlaveRequestSchema().dumps(d)
|
|
2014
|
+
|
|
2015
|
+
resp = self.invoke("PromoteUDBSlave", d, **kwargs)
|
|
2016
|
+
return apis.PromoteUDBSlaveResponseSchema().loads(resp)
|
|
2017
|
+
|
|
2018
|
+
def resize_udb_instance(
|
|
2019
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2020
|
+
) -> dict:
|
|
2021
|
+
"""ResizeUDBInstance - 修改(升级和降级)UDB实例的配置,包括内存和磁盘的配置,对于内存升级无需关闭实例,其他场景需要事先关闭实例。两套参数可以配置升降机:1.配置UseSSD和SSDType 2.配置InstanceType,不需要配置InstanceMode。这两套第二套参数的优先级更高
|
|
2022
|
+
|
|
2023
|
+
**Request**
|
|
2024
|
+
|
|
2025
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
2026
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2027
|
+
- **DBId** (str) - (Required) 实例的Id
|
|
2028
|
+
- **DiskSpace** (int) - (Required) 磁盘空间(GB), 暂时支持20G-32T
|
|
2029
|
+
- **MemoryLimit** (int) - (Required) 内存限制(MB),目前支持以下几档 2000M/4000M/ 6000M/8000M/ 12000M/16000M/ 24000M/32000M/ 48000M/64000M/96000M/128000M/192000M/256000M/320000M。
|
|
2030
|
+
- **CPU** (int) - 数据库的CPU核数(只对普通版的SQLServer有用)
|
|
2031
|
+
- **CouponId** (str) - 使用的代金券id
|
|
2032
|
+
- **InstanceMode** (str) - UDB实例模式类型, 可选值如下: "Normal": 普通版UDB实例 "HA": 高可用版UDB实例 默认是"Normal"
|
|
2033
|
+
- **InstanceType** (str) - UDB数据库机型: "Normal": "标准机型" , "SATA_SSD": "SSD机型" , "PCIE_SSD": "SSD高性能机型" , "Normal_Volume": "标准大容量机型", "SATA_SSD_Volume": "SSD大容量机型" , "PCIE_SSD_Volume": "SSD高性能大容量机型",“NVMe_SSD”:“快杰机型”
|
|
2034
|
+
- **MachineType** (str) - 规格类型ID,当SpecificationType为1时有效
|
|
2035
|
+
- **SSDType** (str) - SSD类型,可选值为"SATA"、“NVMe”
|
|
2036
|
+
- **SpecificationType** (str) - 实例计算规格类型,0或不传代表使用内存方式购买,1代表使用内存-cpu可选配比方式购买,需要填写MachineType
|
|
2037
|
+
- **StartAfterUpgrade** (bool) - DB关闭状态下升降级,升降级后是否启动DB,默认为false
|
|
2038
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2039
|
+
|
|
2040
|
+
**Response**
|
|
2041
|
+
|
|
2042
|
+
|
|
2043
|
+
"""
|
|
2044
|
+
# build request
|
|
2045
|
+
d = {
|
|
2046
|
+
"ProjectId": self.config.project_id,
|
|
2047
|
+
"Region": self.config.region,
|
|
2048
|
+
}
|
|
2049
|
+
req and d.update(req)
|
|
2050
|
+
d = apis.ResizeUDBInstanceRequestSchema().dumps(d)
|
|
2051
|
+
|
|
2052
|
+
resp = self.invoke("ResizeUDBInstance", d, **kwargs)
|
|
2053
|
+
return apis.ResizeUDBInstanceResponseSchema().loads(resp)
|
|
2054
|
+
|
|
2055
|
+
def restart_rw_splitting(
|
|
2056
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2057
|
+
) -> dict:
|
|
2058
|
+
"""RestartRWSplitting - 读写分离中间件重启,对应docker重启,但是ip不变
|
|
2059
|
+
|
|
2060
|
+
**Request**
|
|
2061
|
+
|
|
2062
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2063
|
+
- **MasterDBId** (str) - (Required) 待关闭读写分离中间键ProxyId
|
|
2064
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2065
|
+
|
|
2066
|
+
**Response**
|
|
2067
|
+
|
|
2068
|
+
|
|
2069
|
+
"""
|
|
2070
|
+
# build request
|
|
2071
|
+
d = {
|
|
2072
|
+
"Region": self.config.region,
|
|
2073
|
+
}
|
|
2074
|
+
req and d.update(req)
|
|
2075
|
+
d = apis.RestartRWSplittingRequestSchema().dumps(d)
|
|
2076
|
+
|
|
2077
|
+
resp = self.invoke("RestartRWSplitting", d, **kwargs)
|
|
2078
|
+
return apis.RestartRWSplittingResponseSchema().loads(resp)
|
|
2079
|
+
|
|
2080
|
+
def restart_udb_instance(
|
|
2081
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2082
|
+
) -> dict:
|
|
2083
|
+
"""RestartUDBInstance - 重启UDB实例
|
|
2084
|
+
|
|
2085
|
+
**Request**
|
|
2086
|
+
|
|
2087
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
2088
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2089
|
+
- **DBId** (str) - (Required) 实例的Id,该值可以通过DescribeUDBInstance获取
|
|
2090
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2091
|
+
|
|
2092
|
+
**Response**
|
|
2093
|
+
|
|
2094
|
+
|
|
2095
|
+
"""
|
|
2096
|
+
# build request
|
|
2097
|
+
d = {
|
|
2098
|
+
"ProjectId": self.config.project_id,
|
|
2099
|
+
"Region": self.config.region,
|
|
2100
|
+
}
|
|
2101
|
+
req and d.update(req)
|
|
2102
|
+
d = apis.RestartUDBInstanceRequestSchema().dumps(d)
|
|
2103
|
+
|
|
2104
|
+
resp = self.invoke("RestartUDBInstance", d, **kwargs)
|
|
2105
|
+
return apis.RestartUDBInstanceResponseSchema().loads(resp)
|
|
2106
|
+
|
|
2107
|
+
def rollback_udb_instance(
|
|
2108
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2109
|
+
) -> dict:
|
|
2110
|
+
"""RollbackUDBInstance - 在原实例回档指定库表
|
|
2111
|
+
|
|
2112
|
+
**Request**
|
|
2113
|
+
|
|
2114
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2115
|
+
- **RecoveryTime** (str) - (Required) 恢复到某个时间点的时间戳(UTC时间格式,默认单位秒)
|
|
2116
|
+
- **SrcDBId** (str) - (Required) 源实例的Id
|
|
2117
|
+
- **Tables** (str) - (Required) 指定需要恢复的表,格式为(库名.表名), 指定多个用逗号隔开,eg: [ udb.test, mysql_school.my_student]
|
|
2118
|
+
|
|
2119
|
+
**Response**
|
|
2120
|
+
|
|
2121
|
+
- **DBId** (str) - 源实例的Id
|
|
2122
|
+
|
|
2123
|
+
"""
|
|
2124
|
+
# build request
|
|
2125
|
+
d = {
|
|
2126
|
+
"Region": self.config.region,
|
|
2127
|
+
}
|
|
2128
|
+
req and d.update(req)
|
|
2129
|
+
d = apis.RollbackUDBInstanceRequestSchema().dumps(d)
|
|
2130
|
+
|
|
2131
|
+
resp = self.invoke("RollbackUDBInstance", d, **kwargs)
|
|
2132
|
+
return apis.RollbackUDBInstanceResponseSchema().loads(resp)
|
|
2133
|
+
|
|
2134
|
+
def set_udb_rw_splitting(
|
|
2135
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2136
|
+
) -> dict:
|
|
2137
|
+
"""SetUDBRWSplitting - 设置读写分离的模式
|
|
2138
|
+
|
|
2139
|
+
**Request**
|
|
2140
|
+
|
|
2141
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
2142
|
+
- **DBIds** (list) - (Required) DBIds.0 代表UDB主节点, DBIds.1 到DBIds.n 代表1到N个从节点
|
|
2143
|
+
- **MasterDBId** (str) - (Required) DB实例ID(master)
|
|
2144
|
+
- **ReadModel** (str) - (Required) 读写分离策略
|
|
2145
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
2146
|
+
- **DelayThreshold** (int) - 时间阙值
|
|
2147
|
+
- **ReadPercents** (list) - udb主从节点的只读比例。ReadPercents.0代表主节点的只读比例,ReadPercents.1代表从节点1的读写比例, 以此类推
|
|
2148
|
+
|
|
2149
|
+
**Response**
|
|
2150
|
+
|
|
2151
|
+
|
|
2152
|
+
"""
|
|
2153
|
+
# build request
|
|
2154
|
+
d = {
|
|
2155
|
+
"Region": self.config.region,
|
|
2156
|
+
}
|
|
2157
|
+
req and d.update(req)
|
|
2158
|
+
d = apis.SetUDBRWSplittingRequestSchema().dumps(d)
|
|
2159
|
+
|
|
2160
|
+
resp = self.invoke("SetUDBRWSplitting", d, **kwargs)
|
|
2161
|
+
return apis.SetUDBRWSplittingResponseSchema().loads(resp)
|
|
2162
|
+
|
|
2163
|
+
def start_udb_instance(
|
|
2164
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2165
|
+
) -> dict:
|
|
2166
|
+
"""StartUDBInstance - 启动UDB实例
|
|
2167
|
+
|
|
2168
|
+
**Request**
|
|
2169
|
+
|
|
2170
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
2171
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2172
|
+
- **DBId** (str) - (Required) 实例的Id,该值可以通过DescribeUDBInstance获取
|
|
2173
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2174
|
+
|
|
2175
|
+
**Response**
|
|
2176
|
+
|
|
2177
|
+
|
|
2178
|
+
"""
|
|
2179
|
+
# build request
|
|
2180
|
+
d = {
|
|
2181
|
+
"ProjectId": self.config.project_id,
|
|
2182
|
+
"Region": self.config.region,
|
|
2183
|
+
}
|
|
2184
|
+
req and d.update(req)
|
|
2185
|
+
d = apis.StartUDBInstanceRequestSchema().dumps(d)
|
|
2186
|
+
|
|
2187
|
+
resp = self.invoke("StartUDBInstance", d, **kwargs)
|
|
2188
|
+
return apis.StartUDBInstanceResponseSchema().loads(resp)
|
|
2189
|
+
|
|
2190
|
+
def stop_udb_instance(
|
|
2191
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2192
|
+
) -> dict:
|
|
2193
|
+
"""StopUDBInstance - 关闭UDB实例
|
|
2194
|
+
|
|
2195
|
+
**Request**
|
|
2196
|
+
|
|
2197
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
2198
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2199
|
+
- **DBId** (str) - (Required) 实例的Id,该值可以通过DescribeUDBInstance获取
|
|
2200
|
+
- **ForceToKill** (bool) - 是否使用强制手段关闭DB,默认是false
|
|
2201
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2202
|
+
|
|
2203
|
+
**Response**
|
|
2204
|
+
|
|
2205
|
+
|
|
2206
|
+
"""
|
|
2207
|
+
# build request
|
|
2208
|
+
d = {
|
|
2209
|
+
"ProjectId": self.config.project_id,
|
|
2210
|
+
"Region": self.config.region,
|
|
2211
|
+
}
|
|
2212
|
+
req and d.update(req)
|
|
2213
|
+
d = apis.StopUDBInstanceRequestSchema().dumps(d)
|
|
2214
|
+
|
|
2215
|
+
resp = self.invoke("StopUDBInstance", d, **kwargs)
|
|
2216
|
+
return apis.StopUDBInstanceResponseSchema().loads(resp)
|
|
2217
|
+
|
|
2218
|
+
def switch_udb_ha_to_sentinel(
|
|
2219
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2220
|
+
) -> dict:
|
|
2221
|
+
"""SwitchUDBHAToSentinel - UDB高可用实例从HAProxy版本升级为Sentinel版本(不带HAProxy)升级耗时5-10秒
|
|
2222
|
+
|
|
2223
|
+
**Request**
|
|
2224
|
+
|
|
2225
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
2226
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2227
|
+
- **DBId** (str) - (Required) UDB的实例ID
|
|
2228
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2229
|
+
- **ForceSwitch** (bool) - 是否跳过预检查强制升级。
|
|
2230
|
+
|
|
2231
|
+
**Response**
|
|
2232
|
+
|
|
2233
|
+
|
|
2234
|
+
"""
|
|
2235
|
+
# build request
|
|
2236
|
+
d = {
|
|
2237
|
+
"ProjectId": self.config.project_id,
|
|
2238
|
+
"Region": self.config.region,
|
|
2239
|
+
}
|
|
2240
|
+
req and d.update(req)
|
|
2241
|
+
d = apis.SwitchUDBHAToSentinelRequestSchema().dumps(d)
|
|
2242
|
+
|
|
2243
|
+
resp = self.invoke("SwitchUDBHAToSentinel", d, **kwargs)
|
|
2244
|
+
return apis.SwitchUDBHAToSentinelResponseSchema().loads(resp)
|
|
2245
|
+
|
|
2246
|
+
def switch_udb_instance_to_ha(
|
|
2247
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2248
|
+
) -> dict:
|
|
2249
|
+
"""SwitchUDBInstanceToHA - 普通UDB切换为高可用(只针对mysql5.5及以上版本SSD机型的实例) ,原db状态为WaitForSwitch时,调用该api; 对于NVMe机型的单点升级高可用,虽然也能使用PromoteUDBInstanceToHA再加上该操作,但是更建议直接调用新的API接口(UpgradeUDBInstanceToHA)
|
|
2250
|
+
|
|
2251
|
+
**Request**
|
|
2252
|
+
|
|
2253
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
2254
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2255
|
+
- **DBId** (str) - (Required) 实例的Id,该值可以通过DescribeUDBInstance获取
|
|
2256
|
+
- **ChargeType** (str) - Year, Month, Dynamic,Trial,不填则按现在单点计费执行
|
|
2257
|
+
- **Quantity** (str) - 购买时长,需要和 ChargeType 搭配使用,否则使用单点计费策略的值
|
|
2258
|
+
- **Tag** (str) - 业务组
|
|
2259
|
+
|
|
2260
|
+
**Response**
|
|
2261
|
+
|
|
2262
|
+
- **DBId** (str) - 切换后高可用db实例的Id
|
|
2263
|
+
|
|
2264
|
+
"""
|
|
2265
|
+
# build request
|
|
2266
|
+
d = {
|
|
2267
|
+
"ProjectId": self.config.project_id,
|
|
2268
|
+
"Region": self.config.region,
|
|
2269
|
+
}
|
|
2270
|
+
req and d.update(req)
|
|
2271
|
+
d = apis.SwitchUDBInstanceToHARequestSchema().dumps(d)
|
|
2272
|
+
|
|
2273
|
+
resp = self.invoke("SwitchUDBInstanceToHA", d, **kwargs)
|
|
2274
|
+
return apis.SwitchUDBInstanceToHAResponseSchema().loads(resp)
|
|
2275
|
+
|
|
2276
|
+
def update_udb_instance_backup_strategy(
|
|
2277
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2278
|
+
) -> dict:
|
|
2279
|
+
"""UpdateUDBInstanceBackupStrategy - 修改UDB自动备份策略
|
|
2280
|
+
|
|
2281
|
+
**Request**
|
|
2282
|
+
|
|
2283
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
2284
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2285
|
+
- **DBId** (str) - (Required) 主节点的Id
|
|
2286
|
+
- **BackupDate** (str) - 备份时期标记位。共7位,每一位为一周中一天的备份情况,0表示关闭当天备份,1表示打开当天备份。最右边的一位为星期天的备份开关,其余从右到左依次为星期一到星期六的备份配置开关,每周必须至少设置两天备份。例如:1100000表示打开星期六和星期五的备份功能
|
|
2287
|
+
- **BackupMethod** (str) - 选择默认的备份方式,可选nobackup表示不备份, snapshot 表示使用快照备份,logic 表示使用逻辑备份。需要同时设置BackupDate字段。(快照备份即物理备份。SSD版本的mysql实例支持设置为snapshot,NVMe版本的mysql实例支持设置为xtrabackup)
|
|
2288
|
+
- **BackupTime** (int) - 备份的整点时间,范围[0,23]
|
|
2289
|
+
- **BinlogRemoteSaveDays** (int) - 远端binlog保存时长(天)
|
|
2290
|
+
- **EnableBinlogBackup** (bool) - 是否开启binlog备份, 默认为未开启
|
|
2291
|
+
- **ForceDump** (bool) - 当导出某些数据遇到问题后,是否强制导出其他剩余数据默认是false需要同时设置BackupDate字段
|
|
2292
|
+
- **UserBucket** (str) - 自动备份转存到用户自己的bucket名称,要包含到对应的token id里
|
|
2293
|
+
- **UserTokenID** (str) - 自动备份转存到用户自己的bucket 的tokenid, 需要用户自己自己设置权限
|
|
2294
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2295
|
+
|
|
2296
|
+
**Response**
|
|
2297
|
+
|
|
2298
|
+
|
|
2299
|
+
"""
|
|
2300
|
+
# build request
|
|
2301
|
+
d = {
|
|
2302
|
+
"ProjectId": self.config.project_id,
|
|
2303
|
+
"Region": self.config.region,
|
|
2304
|
+
}
|
|
2305
|
+
req and d.update(req)
|
|
2306
|
+
d = apis.UpdateUDBInstanceBackupStrategyRequestSchema().dumps(d)
|
|
2307
|
+
|
|
2308
|
+
resp = self.invoke("UpdateUDBInstanceBackupStrategy", d, **kwargs)
|
|
2309
|
+
return apis.UpdateUDBInstanceBackupStrategyResponseSchema().loads(resp)
|
|
2310
|
+
|
|
2311
|
+
def update_udb_instance_slave_backup_switch(
|
|
2312
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2313
|
+
) -> dict:
|
|
2314
|
+
"""UpdateUDBInstanceSlaveBackupSwitch - 开启或者关闭UDB从库备份
|
|
2315
|
+
|
|
2316
|
+
**Request**
|
|
2317
|
+
|
|
2318
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
2319
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
2320
|
+
- **BackupSwitch** (int) - (Required) 从库的备份开关,范围[0,1],0表示从库备份功能关闭,1 表示从库备份开关打开。
|
|
2321
|
+
- **MasterDBId** (str) - (Required) 主库的Id
|
|
2322
|
+
- **SlaveDBId** (str) - 从库的Id,如果从库备份开关设定为打开,则必须赋值。
|
|
2323
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
2324
|
+
|
|
2325
|
+
**Response**
|
|
2326
|
+
|
|
2327
|
+
|
|
2328
|
+
"""
|
|
2329
|
+
# build request
|
|
2330
|
+
d = {
|
|
2331
|
+
"ProjectId": self.config.project_id,
|
|
2332
|
+
"Region": self.config.region,
|
|
2333
|
+
}
|
|
2334
|
+
req and d.update(req)
|
|
2335
|
+
d = apis.UpdateUDBInstanceSlaveBackupSwitchRequestSchema().dumps(d)
|
|
2336
|
+
|
|
2337
|
+
resp = self.invoke("UpdateUDBInstanceSlaveBackupSwitch", d, **kwargs)
|
|
2338
|
+
return apis.UpdateUDBInstanceSlaveBackupSwitchResponseSchema().loads(
|
|
2339
|
+
resp
|
|
2340
|
+
)
|
|
2341
|
+
|
|
2342
|
+
def update_udb_param_group(
|
|
2343
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2344
|
+
) -> dict:
|
|
2345
|
+
"""UpdateUDBParamGroup - 更新UDB配置参数项
|
|
2346
|
+
|
|
2347
|
+
**Request**
|
|
2348
|
+
|
|
2349
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
2350
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
2351
|
+
- **GroupId** (int) - (Required) 配置参数组id,使用DescribeUDBParamGroup获得
|
|
2352
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
2353
|
+
- **Description** (str) - 配置文件的描述,不传时认为不修改
|
|
2354
|
+
- **Key** (str) - 参数名称(与Value配合使用)
|
|
2355
|
+
- **Name** (str) - 配置文件的名字,不传时认为不修改名字,传了则不能为空
|
|
2356
|
+
- **RegionFlag** (bool) - 该配置文件是否是地域级别配置文件,默认是false
|
|
2357
|
+
- **Value** (str) - 参数值(与Key配合使用)
|
|
2358
|
+
|
|
2359
|
+
**Response**
|
|
2360
|
+
|
|
2361
|
+
|
|
2362
|
+
"""
|
|
2363
|
+
# build request
|
|
2364
|
+
d = {
|
|
2365
|
+
"ProjectId": self.config.project_id,
|
|
2366
|
+
"Region": self.config.region,
|
|
2367
|
+
}
|
|
2368
|
+
req and d.update(req)
|
|
2369
|
+
d = apis.UpdateUDBParamGroupRequestSchema().dumps(d)
|
|
2370
|
+
|
|
2371
|
+
resp = self.invoke("UpdateUDBParamGroup", d, **kwargs)
|
|
2372
|
+
return apis.UpdateUDBParamGroupResponseSchema().loads(resp)
|
|
2373
|
+
|
|
2374
|
+
def upgrade_udb_instance_to_ha(
|
|
2375
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2376
|
+
) -> dict:
|
|
2377
|
+
"""UpgradeUDBInstanceToHA - 快杰普通db升级为高可用(只针对mysql5.5及以上版本Nvme机型的实例)
|
|
2378
|
+
|
|
2379
|
+
**Request**
|
|
2380
|
+
|
|
2381
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
2382
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2383
|
+
- **DBId** (str) - (Required) 实例的Id,该值可以通过DescribeUDBInstance获取
|
|
2384
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2385
|
+
|
|
2386
|
+
**Response**
|
|
2387
|
+
|
|
2388
|
+
|
|
2389
|
+
"""
|
|
2390
|
+
# build request
|
|
2391
|
+
d = {
|
|
2392
|
+
"ProjectId": self.config.project_id,
|
|
2393
|
+
"Region": self.config.region,
|
|
2394
|
+
}
|
|
2395
|
+
req and d.update(req)
|
|
2396
|
+
d = apis.UpgradeUDBInstanceToHARequestSchema().dumps(d)
|
|
2397
|
+
|
|
2398
|
+
resp = self.invoke("UpgradeUDBInstanceToHA", d, **kwargs)
|
|
2399
|
+
return apis.UpgradeUDBInstanceToHAResponseSchema().loads(resp)
|
|
2400
|
+
|
|
2401
|
+
def upgrade_udb_version(
|
|
2402
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2403
|
+
) -> dict:
|
|
2404
|
+
"""UpgradeUDBVersion - 升级db实例版本
|
|
2405
|
+
|
|
2406
|
+
**Request**
|
|
2407
|
+
|
|
2408
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
2409
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2410
|
+
- **DBId** (str) - (Required) db实例资源id
|
|
2411
|
+
- **DBSubVersion** (str) - (Required) db需要升级的小版本
|
|
2412
|
+
- **SwitchType** (str) - (Required) 切换类型,可选值为"immediately"和"customize",分别代表立即切换和自定义切换时间,自定义切换时间需要填写SwitchStartTime和SwitchEndTime
|
|
2413
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2414
|
+
- **SwitchEndTime** (int) - 该值为一个unix时间戳,代表开始预期切换实例结束的时间
|
|
2415
|
+
- **SwitchStartTime** (int) - 该值为一个unix时间戳,代表开始切换实例的时间
|
|
2416
|
+
|
|
2417
|
+
**Response**
|
|
2418
|
+
|
|
2419
|
+
- **Message** (str) - 返回信息
|
|
2420
|
+
|
|
2421
|
+
"""
|
|
2422
|
+
# build request
|
|
2423
|
+
d = {
|
|
2424
|
+
"ProjectId": self.config.project_id,
|
|
2425
|
+
"Region": self.config.region,
|
|
2426
|
+
}
|
|
2427
|
+
req and d.update(req)
|
|
2428
|
+
d = apis.UpgradeUDBVersionRequestSchema().dumps(d)
|
|
2429
|
+
|
|
2430
|
+
resp = self.invoke("UpgradeUDBVersion", d, **kwargs)
|
|
2431
|
+
return apis.UpgradeUDBVersionResponseSchema().loads(resp)
|
|
2432
|
+
|
|
2433
|
+
def upload_udb_param_group(
|
|
2434
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2435
|
+
) -> dict:
|
|
2436
|
+
"""UploadUDBParamGroup - 导入UDB配置
|
|
2437
|
+
|
|
2438
|
+
**Request**
|
|
2439
|
+
|
|
2440
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
|
|
2441
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
2442
|
+
- **Content** (str) - (Required) 配置内容,导入的配置内容采用base64编码
|
|
2443
|
+
- **DBTypeId** (str) - (Required) DB类型id,DB类型id,mysql/mongodb/postgesql按版本细分 1:mysql-5.1,2:mysql-5.5,3:percona-5.5,4:mysql-5.6,5:percona-5.6,6:mysql-5.7,7:percona-5.7,8:mariadb-10.0,9:mongodb-2.4,10:mongodb-2.6,11:mongodb-3.0,12:mongodb-3.2,13:postgresql-9.4,14:postgresql-9.6
|
|
2444
|
+
- **Description** (str) - (Required) 参数组描述
|
|
2445
|
+
- **GroupName** (str) - (Required) 配置参数组名称
|
|
2446
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
|
|
2447
|
+
- **RegionFlag** (bool) - 该配置文件是否是地域级别配置文件,默认是false
|
|
2448
|
+
|
|
2449
|
+
**Response**
|
|
2450
|
+
|
|
2451
|
+
- **GroupId** (int) - 配置参数组id
|
|
2452
|
+
|
|
2453
|
+
"""
|
|
2454
|
+
# build request
|
|
2455
|
+
d = {
|
|
2456
|
+
"ProjectId": self.config.project_id,
|
|
2457
|
+
"Region": self.config.region,
|
|
2458
|
+
}
|
|
2459
|
+
req and d.update(req)
|
|
2460
|
+
d = apis.UploadUDBParamGroupRequestSchema().dumps(d)
|
|
2461
|
+
|
|
2462
|
+
resp = self.invoke("UploadUDBParamGroup", d, **kwargs)
|
|
2463
|
+
return apis.UploadUDBParamGroupResponseSchema().loads(resp)
|