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,1007 @@
|
|
|
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.upgsql.schemas import apis
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class UPgSQLClient(Client):
|
|
11
|
+
def __init__(
|
|
12
|
+
self, config: dict, transport=None, middleware=None, logger=None
|
|
13
|
+
):
|
|
14
|
+
super(UPgSQLClient, self).__init__(
|
|
15
|
+
config, transport, middleware, logger
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
def backup_u_pg_sql_log(
|
|
19
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
20
|
+
) -> dict:
|
|
21
|
+
"""BackupUPgSQLLog - 备份日志包
|
|
22
|
+
|
|
23
|
+
**Request**
|
|
24
|
+
|
|
25
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
26
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
27
|
+
- **BackupFile** (str) - (Required) 备份查询结果文件名称
|
|
28
|
+
- **BackupName** (str) - (Required) 备份导出文件名称
|
|
29
|
+
- **InstanceID** (str) - (Required) 资源ID
|
|
30
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
31
|
+
- **BeginTime** (int) - 日志开始时间
|
|
32
|
+
- **EndTime** (int) - 日志结束时间
|
|
33
|
+
- **LogType** (str) - 日志类型:slow(慢日志),error(错误日志)
|
|
34
|
+
|
|
35
|
+
**Response**
|
|
36
|
+
|
|
37
|
+
- **Message** (str) - 错误信息
|
|
38
|
+
|
|
39
|
+
"""
|
|
40
|
+
# build request
|
|
41
|
+
d = {
|
|
42
|
+
"ProjectId": self.config.project_id,
|
|
43
|
+
"Region": self.config.region,
|
|
44
|
+
}
|
|
45
|
+
req and d.update(req)
|
|
46
|
+
d = apis.BackupUPgSQLLogRequestSchema().dumps(d)
|
|
47
|
+
|
|
48
|
+
resp = self.invoke("BackupUPgSQLLog", d, **kwargs)
|
|
49
|
+
return apis.BackupUPgSQLLogResponseSchema().loads(resp)
|
|
50
|
+
|
|
51
|
+
def create_u_pg_sql_instance(
|
|
52
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
53
|
+
) -> dict:
|
|
54
|
+
"""CreateUPgSQLInstance - 创建PG云数据库
|
|
55
|
+
|
|
56
|
+
**Request**
|
|
57
|
+
|
|
58
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
59
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
60
|
+
- **AdminPassword** (str) - (Required) 管理员密码
|
|
61
|
+
- **DBVersion** (str) - (Required) PostgreSQL的版本,pg10.4:postgresql-10.4,pg13.4:postgresql-13.4
|
|
62
|
+
- **DiskSpace** (str) - (Required) 磁盘空间(GB)
|
|
63
|
+
- **MachineType** (str) - (Required) 机器配置类型,2核4G的机器:o.pgsql2m.medium
|
|
64
|
+
- **Name** (str) - (Required) 实例名称,至少6位
|
|
65
|
+
- **ParamGroupID** (int) - (Required) DB实例使用的配置参数组id
|
|
66
|
+
- **Port** (int) - (Required) 端口默认为5432
|
|
67
|
+
- **SubnetID** (str) - (Required) 子网ID
|
|
68
|
+
- **VPCID** (str) - (Required) VPC的ID
|
|
69
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
70
|
+
- **InstanceMode** (str) - UDB实例模式类型, 可选值如下: "Normal": 普通版UDB实例 "HA": 高可用版UDB实例 默认是"Normal"
|
|
71
|
+
|
|
72
|
+
**Response**
|
|
73
|
+
|
|
74
|
+
- **InstanceID** (str) - 资源ID
|
|
75
|
+
- **Message** (str) - 返回信息
|
|
76
|
+
|
|
77
|
+
"""
|
|
78
|
+
# build request
|
|
79
|
+
d = {
|
|
80
|
+
"ProjectId": self.config.project_id,
|
|
81
|
+
"Region": self.config.region,
|
|
82
|
+
}
|
|
83
|
+
req and d.update(req)
|
|
84
|
+
d = apis.CreateUPgSQLInstanceRequestSchema().dumps(d)
|
|
85
|
+
|
|
86
|
+
# build options
|
|
87
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
88
|
+
|
|
89
|
+
resp = self.invoke("CreateUPgSQLInstance", d, **kwargs)
|
|
90
|
+
return apis.CreateUPgSQLInstanceResponseSchema().loads(resp)
|
|
91
|
+
|
|
92
|
+
def create_u_pg_sql_param_template(
|
|
93
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
94
|
+
) -> dict:
|
|
95
|
+
"""CreateUPgSQLParamTemplate - 创建PG参数模板
|
|
96
|
+
|
|
97
|
+
**Request**
|
|
98
|
+
|
|
99
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
100
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
101
|
+
- **DBVersion** (str) - (Required) 什么版本,以及类型的DB
|
|
102
|
+
- **GroupName** (str) - (Required) 模板名称
|
|
103
|
+
- **SrcGroupID** (int) - (Required) 基准模板
|
|
104
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
105
|
+
- **Description** (str) - 描述信息
|
|
106
|
+
|
|
107
|
+
**Response**
|
|
108
|
+
|
|
109
|
+
- **GroupID** (int) - 创建的模板ID
|
|
110
|
+
- **Message** (str) - 描述信息
|
|
111
|
+
|
|
112
|
+
"""
|
|
113
|
+
# build request
|
|
114
|
+
d = {
|
|
115
|
+
"ProjectId": self.config.project_id,
|
|
116
|
+
"Region": self.config.region,
|
|
117
|
+
}
|
|
118
|
+
req and d.update(req)
|
|
119
|
+
d = apis.CreateUPgSQLParamTemplateRequestSchema().dumps(d)
|
|
120
|
+
|
|
121
|
+
# build options
|
|
122
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
123
|
+
|
|
124
|
+
resp = self.invoke("CreateUPgSQLParamTemplate", d, **kwargs)
|
|
125
|
+
return apis.CreateUPgSQLParamTemplateResponseSchema().loads(resp)
|
|
126
|
+
|
|
127
|
+
def create_u_pg_sql_readonly(
|
|
128
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
129
|
+
) -> dict:
|
|
130
|
+
"""CreateUPgSQLReadonly - 创建PG从库
|
|
131
|
+
|
|
132
|
+
**Request**
|
|
133
|
+
|
|
134
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
135
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
136
|
+
- **DiskSpace** (int) - (Required) 磁盘空间
|
|
137
|
+
- **MachineType** (str) - (Required) 机器配置类型,2核4G的机器:o.pgsql2m.medium
|
|
138
|
+
- **Name** (str) - (Required) Db名称
|
|
139
|
+
- **Port** (int) - (Required) DB端口
|
|
140
|
+
- **SrcInstanceID** (str) - (Required) 同步的源库
|
|
141
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
142
|
+
- **SubnetID** (str) - 子网ID
|
|
143
|
+
- **VPCID** (str) - VPCID
|
|
144
|
+
|
|
145
|
+
**Response**
|
|
146
|
+
|
|
147
|
+
- **InstanceID** (str) - 资源ID
|
|
148
|
+
|
|
149
|
+
"""
|
|
150
|
+
# build request
|
|
151
|
+
d = {
|
|
152
|
+
"ProjectId": self.config.project_id,
|
|
153
|
+
"Region": self.config.region,
|
|
154
|
+
}
|
|
155
|
+
req and d.update(req)
|
|
156
|
+
d = apis.CreateUPgSQLReadonlyRequestSchema().dumps(d)
|
|
157
|
+
|
|
158
|
+
# build options
|
|
159
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
160
|
+
|
|
161
|
+
resp = self.invoke("CreateUPgSQLReadonly", d, **kwargs)
|
|
162
|
+
return apis.CreateUPgSQLReadonlyResponseSchema().loads(resp)
|
|
163
|
+
|
|
164
|
+
def delete_u_pg_sql_instance(
|
|
165
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
166
|
+
) -> dict:
|
|
167
|
+
"""DeleteUPgSQLInstance - 删除PG实例
|
|
168
|
+
|
|
169
|
+
**Request**
|
|
170
|
+
|
|
171
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
172
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
173
|
+
- **InstanceID** (str) - (Required) 实例ID
|
|
174
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
175
|
+
|
|
176
|
+
**Response**
|
|
177
|
+
|
|
178
|
+
- **Message** (str) - 描述信息
|
|
179
|
+
|
|
180
|
+
"""
|
|
181
|
+
# build request
|
|
182
|
+
d = {
|
|
183
|
+
"ProjectId": self.config.project_id,
|
|
184
|
+
"Region": self.config.region,
|
|
185
|
+
}
|
|
186
|
+
req and d.update(req)
|
|
187
|
+
d = apis.DeleteUPgSQLInstanceRequestSchema().dumps(d)
|
|
188
|
+
|
|
189
|
+
resp = self.invoke("DeleteUPgSQLInstance", d, **kwargs)
|
|
190
|
+
return apis.DeleteUPgSQLInstanceResponseSchema().loads(resp)
|
|
191
|
+
|
|
192
|
+
def delete_u_pg_sql_param_template(
|
|
193
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
194
|
+
) -> dict:
|
|
195
|
+
"""DeleteUPgSQLParamTemplate - 删除参数模板
|
|
196
|
+
|
|
197
|
+
**Request**
|
|
198
|
+
|
|
199
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
200
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
201
|
+
- **GroupID** (int) - (Required) 模板ID
|
|
202
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
203
|
+
|
|
204
|
+
**Response**
|
|
205
|
+
|
|
206
|
+
- **Message** (str) - 描述信息
|
|
207
|
+
|
|
208
|
+
"""
|
|
209
|
+
# build request
|
|
210
|
+
d = {
|
|
211
|
+
"ProjectId": self.config.project_id,
|
|
212
|
+
"Region": self.config.region,
|
|
213
|
+
}
|
|
214
|
+
req and d.update(req)
|
|
215
|
+
d = apis.DeleteUPgSQLParamTemplateRequestSchema().dumps(d)
|
|
216
|
+
|
|
217
|
+
resp = self.invoke("DeleteUPgSQLParamTemplate", d, **kwargs)
|
|
218
|
+
return apis.DeleteUPgSQLParamTemplateResponseSchema().loads(resp)
|
|
219
|
+
|
|
220
|
+
def download_u_pg_sql_param_template(
|
|
221
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
222
|
+
) -> dict:
|
|
223
|
+
"""DownloadUPgSQLParamTemplate - 下载参数模板信息
|
|
224
|
+
|
|
225
|
+
**Request**
|
|
226
|
+
|
|
227
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
228
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
229
|
+
- **GroupID** (int) - (Required) 参数模板id
|
|
230
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
231
|
+
|
|
232
|
+
**Response**
|
|
233
|
+
|
|
234
|
+
- **Content** (str) - base64编码过的
|
|
235
|
+
- **Message** (str) - 描述信息
|
|
236
|
+
|
|
237
|
+
"""
|
|
238
|
+
# build request
|
|
239
|
+
d = {
|
|
240
|
+
"ProjectId": self.config.project_id,
|
|
241
|
+
"Region": self.config.region,
|
|
242
|
+
}
|
|
243
|
+
req and d.update(req)
|
|
244
|
+
d = apis.DownloadUPgSQLParamTemplateRequestSchema().dumps(d)
|
|
245
|
+
|
|
246
|
+
resp = self.invoke("DownloadUPgSQLParamTemplate", d, **kwargs)
|
|
247
|
+
return apis.DownloadUPgSQLParamTemplateResponseSchema().loads(resp)
|
|
248
|
+
|
|
249
|
+
def get_u_pg_sql_backup_strategy(
|
|
250
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
251
|
+
) -> dict:
|
|
252
|
+
"""GetUPgSQLBackupStrategy - 获取备份策略
|
|
253
|
+
|
|
254
|
+
**Request**
|
|
255
|
+
|
|
256
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
257
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
258
|
+
- **InstanceID** (str) - (Required) DB实例Id
|
|
259
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
260
|
+
|
|
261
|
+
**Response**
|
|
262
|
+
|
|
263
|
+
- **BackupMethod** (str) - 默认的备份方式
|
|
264
|
+
- **BackupTimeRange** (str) - 自动备份预计开始时间范围
|
|
265
|
+
- **BackupWeek** (str) - 自动备份预期星期几(1~7)开始
|
|
266
|
+
- **Message** (str) - 返回的详细信息
|
|
267
|
+
|
|
268
|
+
"""
|
|
269
|
+
# build request
|
|
270
|
+
d = {
|
|
271
|
+
"ProjectId": self.config.project_id,
|
|
272
|
+
"Region": self.config.region,
|
|
273
|
+
}
|
|
274
|
+
req and d.update(req)
|
|
275
|
+
d = apis.GetUPgSQLBackupStrategyRequestSchema().dumps(d)
|
|
276
|
+
|
|
277
|
+
resp = self.invoke("GetUPgSQLBackupStrategy", d, **kwargs)
|
|
278
|
+
return apis.GetUPgSQLBackupStrategyResponseSchema().loads(resp)
|
|
279
|
+
|
|
280
|
+
def get_u_pg_sql_backup_url(
|
|
281
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
282
|
+
) -> dict:
|
|
283
|
+
"""GetUPgSQLBackupURL - 获取备份下载地址
|
|
284
|
+
|
|
285
|
+
**Request**
|
|
286
|
+
|
|
287
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
288
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
289
|
+
- **BackupID** (str) - (Required) 备份Id
|
|
290
|
+
- **InstanceID** (str) - (Required) DB实例Id
|
|
291
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
292
|
+
|
|
293
|
+
**Response**
|
|
294
|
+
|
|
295
|
+
- **BackupPath** (str) - DB实例备份文件公网的地址
|
|
296
|
+
- **InnerBackupPath** (str) - DB实例备份文件内网的地址
|
|
297
|
+
- **Message** (str) - 返回的详细信息
|
|
298
|
+
|
|
299
|
+
"""
|
|
300
|
+
# build request
|
|
301
|
+
d = {
|
|
302
|
+
"ProjectId": self.config.project_id,
|
|
303
|
+
"Region": self.config.region,
|
|
304
|
+
}
|
|
305
|
+
req and d.update(req)
|
|
306
|
+
d = apis.GetUPgSQLBackupURLRequestSchema().dumps(d)
|
|
307
|
+
|
|
308
|
+
resp = self.invoke("GetUPgSQLBackupURL", d, **kwargs)
|
|
309
|
+
return apis.GetUPgSQLBackupURLResponseSchema().loads(resp)
|
|
310
|
+
|
|
311
|
+
def get_u_pg_sql_instance(
|
|
312
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
313
|
+
) -> dict:
|
|
314
|
+
"""GetUPgSQLInstance - 获取PG云数据库实例描述
|
|
315
|
+
|
|
316
|
+
**Request**
|
|
317
|
+
|
|
318
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
319
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
320
|
+
- **InstanceID** (str) - (Required) 资源ID
|
|
321
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
322
|
+
|
|
323
|
+
**Response**
|
|
324
|
+
|
|
325
|
+
- **DataSet** (dict) - 见 **UDBInstance** 模型定义
|
|
326
|
+
- **Message** (str) - 返回信息
|
|
327
|
+
|
|
328
|
+
**Response Model**
|
|
329
|
+
|
|
330
|
+
**UDBInstance**
|
|
331
|
+
- **AdminUser** (str) - 管理员帐户名,默认root
|
|
332
|
+
- **BackupBeginTime** (int) - 备份开始时间,单位小时计,默认3点
|
|
333
|
+
- **BackupCount** (int) - 备份文件保留的数量,默认7次
|
|
334
|
+
- **BackupDate** (str) - 用于设置备份策略的备份日期标记位。共7位,每一位为一周中一天的备份情况 0表示关闭当天备份,1表示打开当天备份。最右边的一位 为星期天的备份开关,其余从右到左依次为星期一到星期 六的备份配置开关,每周必须至少设置两天备份。 例如:1100000 表示打开星期六和星期五的自动备份功能
|
|
335
|
+
- **BackupTimeRange** (int) - 备份的时间段,范围[0,23]
|
|
336
|
+
- **BackupZone** (str) - 跨可用区高可用备库所在可用区
|
|
337
|
+
- **CreateTime** (int) - DB实例创建时间,采用UTC计时时间戳
|
|
338
|
+
- **DBVersion** (str) - DB 版本
|
|
339
|
+
- **DataFileSize** (float) - DB实例数据文件大小,单位GB
|
|
340
|
+
- **DiskSpace** (int) - 磁盘空间(GB), 默认根据配置机型
|
|
341
|
+
- **DiskUsedSize** (float) - DB实例磁盘已使用空间,单位GB
|
|
342
|
+
- **ExpiredTime** (int) - DB实例过期时间,采用UTC计时时间戳
|
|
343
|
+
- **IP** (str) - DBip
|
|
344
|
+
- **InstanceID** (str) - DB实例id
|
|
345
|
+
- **InstanceMode** (str) - Normal/HA,普通/高可用
|
|
346
|
+
- **LogFileSize** (float) - DB实例日志文件大小,单位GB
|
|
347
|
+
- **MemoryLimit** (int) - 内存限制(MB),默认根据配置机型
|
|
348
|
+
- **ModifyTime** (int) - DB实例修改时间,采用UTC计时时间戳
|
|
349
|
+
- **Name** (str) - 实例名称
|
|
350
|
+
- **ParamGroupID** (int) - DB实例使用的配置参数组id
|
|
351
|
+
- **Port** (int) - DB port
|
|
352
|
+
- **Remark** (str) - 备注
|
|
353
|
+
- **State** (str) - DB状态标记 Init:初始化中,Fail:安装失败,Starting:启动中,Running:运行,Shutdown:关闭中,Shutoff:已关闭,Delete:已删除,Upgrading:升级中,Promoting:提升为独库进行中,Recovering:恢复中,Recover fail:恢复失败
|
|
354
|
+
- **SubnetID** (str) - 子网ID
|
|
355
|
+
- **SystemFileSize** (float) - DB实例系统文件大小,单位GB
|
|
356
|
+
- **VPCID** (str) - VPC的ID
|
|
357
|
+
- **Zone** (str) - DB实例所在可用区
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
"""
|
|
361
|
+
# build request
|
|
362
|
+
d = {
|
|
363
|
+
"ProjectId": self.config.project_id,
|
|
364
|
+
"Region": self.config.region,
|
|
365
|
+
}
|
|
366
|
+
req and d.update(req)
|
|
367
|
+
d = apis.GetUPgSQLInstanceRequestSchema().dumps(d)
|
|
368
|
+
|
|
369
|
+
resp = self.invoke("GetUPgSQLInstance", d, **kwargs)
|
|
370
|
+
return apis.GetUPgSQLInstanceResponseSchema().loads(resp)
|
|
371
|
+
|
|
372
|
+
def get_u_pg_sql_instance_log(
|
|
373
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
374
|
+
) -> dict:
|
|
375
|
+
"""GetUPgSQLInstanceLog - 可以查询DB的错误日志和满查询日志
|
|
376
|
+
|
|
377
|
+
**Request**
|
|
378
|
+
|
|
379
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
380
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
381
|
+
- **AccountID** (int) - (Required)
|
|
382
|
+
- **BeginTime** (int) - (Required) 起始时间,需使用时间戳
|
|
383
|
+
- **CompanyID** (int) - (Required)
|
|
384
|
+
- **DBId** (str) - (Required) 实例ClusterID
|
|
385
|
+
- **EndTime** (int) - (Required) 结束时间,需使用时间戳,结束时间需大于起始时间
|
|
386
|
+
- **LogType** (str) - (Required) 日志类型
|
|
387
|
+
- **ZoneID** (int) - (Required) 可用区
|
|
388
|
+
|
|
389
|
+
**Response**
|
|
390
|
+
|
|
391
|
+
- **Log** (str) - 返回的日志信息
|
|
392
|
+
|
|
393
|
+
"""
|
|
394
|
+
# build request
|
|
395
|
+
d = {
|
|
396
|
+
"ProjectId": self.config.project_id,
|
|
397
|
+
"Region": self.config.region,
|
|
398
|
+
}
|
|
399
|
+
req and d.update(req)
|
|
400
|
+
d = apis.GetUPgSQLInstanceLogRequestSchema().dumps(d)
|
|
401
|
+
|
|
402
|
+
resp = self.invoke("GetUPgSQLInstanceLog", d, **kwargs)
|
|
403
|
+
return apis.GetUPgSQLInstanceLogResponseSchema().loads(resp)
|
|
404
|
+
|
|
405
|
+
def get_u_pg_sql_instance_price(
|
|
406
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
407
|
+
) -> dict:
|
|
408
|
+
"""GetUPgSQLInstancePrice - 获取创建PG云数据库价格
|
|
409
|
+
|
|
410
|
+
**Request**
|
|
411
|
+
|
|
412
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
413
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
414
|
+
- **DiskSpace** (int) - (Required) 磁盘空间(GB)
|
|
415
|
+
- **InstanceMode** (str) - (Required) UDB实例模式类型, 可选值如下: "Normal": 普通版UDB实例 "HA": 高可用版UDB实例
|
|
416
|
+
- **MachineType** (str) - (Required) 机器配置类型 参考2C4G机器:o.pgsql2m.medium
|
|
417
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
418
|
+
- **ChargeType** (str) - 计费模式。枚举值为: Year,按年付费; Month,按月付费; Dynamic,按小时付费(需开启权限)。默认为月付
|
|
419
|
+
- **Quantity** (int) - 购买时长。默认: 1。按小时购买(Dynamic)时无需此参数。 月付时,此参数传0,代表了购买至月末。
|
|
420
|
+
|
|
421
|
+
**Response**
|
|
422
|
+
|
|
423
|
+
- **PriceSet** (list) - 见 **UPgSQLInstancePriceSet** 模型定义
|
|
424
|
+
|
|
425
|
+
**Response Model**
|
|
426
|
+
|
|
427
|
+
**UPgSQLInstancePriceSet**
|
|
428
|
+
- **ChargeType** (str) - 计费类型,Year,Month,Dynamic。
|
|
429
|
+
- **OriginalPrice** (float) - 购买原价,单位:元。
|
|
430
|
+
- **Price** (float) - 实际价格,单位:元,保留小数点后两位有效数字。
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
"""
|
|
434
|
+
# build request
|
|
435
|
+
d = {
|
|
436
|
+
"ProjectId": self.config.project_id,
|
|
437
|
+
"Region": self.config.region,
|
|
438
|
+
}
|
|
439
|
+
req and d.update(req)
|
|
440
|
+
d = apis.GetUPgSQLInstancePriceRequestSchema().dumps(d)
|
|
441
|
+
|
|
442
|
+
resp = self.invoke("GetUPgSQLInstancePrice", d, **kwargs)
|
|
443
|
+
return apis.GetUPgSQLInstancePriceResponseSchema().loads(resp)
|
|
444
|
+
|
|
445
|
+
def get_u_pg_sql_param_template(
|
|
446
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
447
|
+
) -> dict:
|
|
448
|
+
"""GetUPgSQLParamTemplate - 获取模板信息
|
|
449
|
+
|
|
450
|
+
**Request**
|
|
451
|
+
|
|
452
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
453
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
454
|
+
- **GroupID** (int) - (Required) 模板ID
|
|
455
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
456
|
+
|
|
457
|
+
**Response**
|
|
458
|
+
|
|
459
|
+
- **Data** (list) - 见 **Param** 模型定义
|
|
460
|
+
- **Message** (str) - 描述信息
|
|
461
|
+
|
|
462
|
+
**Response Model**
|
|
463
|
+
|
|
464
|
+
**Param**
|
|
465
|
+
- **AllowedVal** (str) - 允许的值
|
|
466
|
+
- **ApplyType** (int) - 允许类型
|
|
467
|
+
- **FormatType** (int) - 参数格式类型
|
|
468
|
+
- **Key** (str) - 参数Key
|
|
469
|
+
- **Modifiable** (bool) - 是否可以修改
|
|
470
|
+
- **Value** (str) - 参数值
|
|
471
|
+
- **ValueType** (int) - 值类型
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
"""
|
|
475
|
+
# build request
|
|
476
|
+
d = {
|
|
477
|
+
"ProjectId": self.config.project_id,
|
|
478
|
+
"Region": self.config.region,
|
|
479
|
+
}
|
|
480
|
+
req and d.update(req)
|
|
481
|
+
d = apis.GetUPgSQLParamTemplateRequestSchema().dumps(d)
|
|
482
|
+
|
|
483
|
+
resp = self.invoke("GetUPgSQLParamTemplate", d, **kwargs)
|
|
484
|
+
return apis.GetUPgSQLParamTemplateResponseSchema().loads(resp)
|
|
485
|
+
|
|
486
|
+
def get_u_pg_sql_upgrade_price(
|
|
487
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
488
|
+
) -> dict:
|
|
489
|
+
"""GetUPgSQLUpgradePrice - 获取 PG 云数据库升降级价格
|
|
490
|
+
|
|
491
|
+
**Request**
|
|
492
|
+
|
|
493
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
494
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
495
|
+
- **DiskSpace** (int) - (Required) 磁盘空间(GB)
|
|
496
|
+
- **InstanceID** (str) - (Required) 资源ID
|
|
497
|
+
- **MachineType** (str) - (Required) 机器配置类型
|
|
498
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
499
|
+
- **InstanceMode** (str) - UDB实例模式类型, 可选值如下: "normal": 普通版UDB实例 "ha": 高可用版UDB实例 默认是"normal"
|
|
500
|
+
|
|
501
|
+
**Response**
|
|
502
|
+
|
|
503
|
+
- **OriginalPrice** (float) - 限时优惠的折前原价
|
|
504
|
+
- **Price** (float) - 规格调整差价。精确到小数点后2位。
|
|
505
|
+
|
|
506
|
+
"""
|
|
507
|
+
# build request
|
|
508
|
+
d = {
|
|
509
|
+
"ProjectId": self.config.project_id,
|
|
510
|
+
"Region": self.config.region,
|
|
511
|
+
}
|
|
512
|
+
req and d.update(req)
|
|
513
|
+
d = apis.GetUPgSQLUpgradePriceRequestSchema().dumps(d)
|
|
514
|
+
|
|
515
|
+
resp = self.invoke("GetUPgSQLUpgradePrice", d, **kwargs)
|
|
516
|
+
return apis.GetUPgSQLUpgradePriceResponseSchema().loads(resp)
|
|
517
|
+
|
|
518
|
+
def list_u_pg_sql_backup(
|
|
519
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
520
|
+
) -> dict:
|
|
521
|
+
"""ListUPgSQLBackup - 获取备份列表
|
|
522
|
+
|
|
523
|
+
**Request**
|
|
524
|
+
|
|
525
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
526
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
527
|
+
- **InstanceID** (str) - (Required) DB实例Id
|
|
528
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
529
|
+
- **BackupType** (int) - 备份类型,默认值是0(0:表示全部,1:自动备份,2:手动备份
|
|
530
|
+
- **Limit** (int) - 返回数据长度,默认为20,最大100
|
|
531
|
+
- **Offset** (int) - 列表起始位置偏移量,默认为0
|
|
532
|
+
|
|
533
|
+
**Response**
|
|
534
|
+
|
|
535
|
+
- **DataSet** (list) - 见 **UPgSQLBackup** 模型定义
|
|
536
|
+
- **Message** (str) - 返回的详细信息
|
|
537
|
+
- **TotalCount** (int) - 总个数
|
|
538
|
+
|
|
539
|
+
**Response Model**
|
|
540
|
+
|
|
541
|
+
**UPgSQLBackup**
|
|
542
|
+
- **BackupEndTime** (int) - 备份完成时间(Unix时间戳)
|
|
543
|
+
- **BackupID** (str) - 备份id
|
|
544
|
+
- **BackupName** (str) - 备份名称
|
|
545
|
+
- **BackupSize** (int) - 备份文件大小(字节)
|
|
546
|
+
- **BackupStartTime** (int) - 备份时间(Unix时间戳)
|
|
547
|
+
- **BackupType** (int) - 备份类型,手动或者自动
|
|
548
|
+
- **InstanceID** (str) - DB实例Id
|
|
549
|
+
- **Region** (str) - 备份所在地域
|
|
550
|
+
- **State** (str) - 备份状态 (Backuping:备份中,Success:备份成功, Failed:备份失败, Expired:备份过期)
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
"""
|
|
554
|
+
# build request
|
|
555
|
+
d = {
|
|
556
|
+
"ProjectId": self.config.project_id,
|
|
557
|
+
"Region": self.config.region,
|
|
558
|
+
}
|
|
559
|
+
req and d.update(req)
|
|
560
|
+
d = apis.ListUPgSQLBackupRequestSchema().dumps(d)
|
|
561
|
+
|
|
562
|
+
resp = self.invoke("ListUPgSQLBackup", d, **kwargs)
|
|
563
|
+
return apis.ListUPgSQLBackupResponseSchema().loads(resp)
|
|
564
|
+
|
|
565
|
+
def list_u_pg_sql_instance(
|
|
566
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
567
|
+
) -> dict:
|
|
568
|
+
"""ListUPgSQLInstance - 获取PG云数据库列表
|
|
569
|
+
|
|
570
|
+
**Request**
|
|
571
|
+
|
|
572
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
573
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
574
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
575
|
+
|
|
576
|
+
**Response**
|
|
577
|
+
|
|
578
|
+
- **DataSet** (list) - 见 **UDBInstanceSet** 模型定义
|
|
579
|
+
- **Message** (str) - 错误信息
|
|
580
|
+
|
|
581
|
+
**Response Model**
|
|
582
|
+
|
|
583
|
+
**UDBInstanceSet**
|
|
584
|
+
- **CreateTime** (int) - DB实例创建时间,采用UTC计时时间戳
|
|
585
|
+
- **DBVersion** (str) - 实例的版本,包括postgresql-10.4,postgresql-13.4
|
|
586
|
+
- **DataSet** (list) - 见 **UDBReadonlyInstance** 模型定义
|
|
587
|
+
- **ExpiredTime** (int) - DB实例过期时间,采用UTC计时时间戳
|
|
588
|
+
- **IP** (str) - DB实例ip
|
|
589
|
+
- **InstanceID** (str) - 资源ID
|
|
590
|
+
- **InstanceMode** (str) - normal/ha/readonly,普通/高可用/只读从库
|
|
591
|
+
- **MachineType** (str) - 机器规格,格式为nCmG,n代表cpu核数,m代表内存大小(GB)
|
|
592
|
+
- **Name** (str) - 实例名称
|
|
593
|
+
- **Remark** (str) - 备注
|
|
594
|
+
- **State** (str) - 实例状态标记 Initing:初始化中,InitFailed:安装失败,Starting:启动中, Running:运行,Stopping:关闭中,Stopped:已关闭,Deleted: 已删除,Upgrading: 升级中 ,Promoting:提升为主库进行中,Recovering:恢复中,RecoverFailed:恢复失败,StartFailed:启动失败,ShutdownFailed:关闭失败,Deleting:删除中,DeleteFailed:删除失败
|
|
595
|
+
- **SubnetID** (str) - 子网ID
|
|
596
|
+
- **VPCID** (str) - VPC的ID
|
|
597
|
+
- **Zone** (str) - 可用区
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
**UDBReadonlyInstance**
|
|
601
|
+
- **CreateTime** (int) - DB实例创建时间,采用UTC计时时间戳
|
|
602
|
+
- **DBVersion** (str) - 实例的版本,包括postgresql-10.4,postgresql-13.4
|
|
603
|
+
- **ExpiredTime** (int) - DB实例过期时间,采用UTC计时时间戳
|
|
604
|
+
- **IP** (str) - DB实例ip
|
|
605
|
+
- **InstanceID** (str) - 资源ID
|
|
606
|
+
- **InstanceMode** (str) - normal/ha/readonly,普通/高可用/只读从库
|
|
607
|
+
- **MachineType** (str) - 机器规格,格式为nCmG,n代表cpu核数,m代表内存大小(GB)
|
|
608
|
+
- **Name** (str) - 实例名称
|
|
609
|
+
- **Remark** (str) - 备注
|
|
610
|
+
- **State** (str) - 实例状态标记 Initing:初始化中,InitFailed:安装失败,Starting:启动中, Running:运行,Stopping:关闭中,Stopped:已关闭,Deleted: 已删除,Upgrading: 升级中 ,Promoting:提升为主库进行中,Recovering:恢复中,RecoverFailed:恢复失败,StartFailed:启动失败,ShutdownFailed:关闭失败,Deleting:删除中,DeleteFailed:删除失败
|
|
611
|
+
- **SubnetID** (str) - 子网ID
|
|
612
|
+
- **VPCID** (str) - VPC的ID
|
|
613
|
+
- **Zone** (str) - 可用区
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
"""
|
|
617
|
+
# build request
|
|
618
|
+
d = {
|
|
619
|
+
"ProjectId": self.config.project_id,
|
|
620
|
+
"Region": self.config.region,
|
|
621
|
+
}
|
|
622
|
+
req and d.update(req)
|
|
623
|
+
d = apis.ListUPgSQLInstanceRequestSchema().dumps(d)
|
|
624
|
+
|
|
625
|
+
resp = self.invoke("ListUPgSQLInstance", d, **kwargs)
|
|
626
|
+
return apis.ListUPgSQLInstanceResponseSchema().loads(resp)
|
|
627
|
+
|
|
628
|
+
def list_u_pg_sql_log(
|
|
629
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
630
|
+
) -> dict:
|
|
631
|
+
"""ListUPgSQLLog - 获取数据库日志
|
|
632
|
+
|
|
633
|
+
**Request**
|
|
634
|
+
|
|
635
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
636
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
637
|
+
- **BeginTime** (int) - (Required) 查询的日志开始的时间戳
|
|
638
|
+
- **EndTime** (int) - (Required) 查询日志的结束时间戳
|
|
639
|
+
- **InstanceID** (str) - (Required) 资源ID
|
|
640
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
641
|
+
|
|
642
|
+
**Response**
|
|
643
|
+
|
|
644
|
+
- **DataSet** (list) - 见 **LogSet** 模型定义
|
|
645
|
+
- **Message** (str) - 错误信息
|
|
646
|
+
|
|
647
|
+
**Response Model**
|
|
648
|
+
|
|
649
|
+
**LogSet**
|
|
650
|
+
- **BeginTime** (int) -
|
|
651
|
+
- **EndTime** (int) -
|
|
652
|
+
- **Name** (str) -
|
|
653
|
+
- **Size** (int) -
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
"""
|
|
657
|
+
# build request
|
|
658
|
+
d = {
|
|
659
|
+
"ProjectId": self.config.project_id,
|
|
660
|
+
"Region": self.config.region,
|
|
661
|
+
}
|
|
662
|
+
req and d.update(req)
|
|
663
|
+
d = apis.ListUPgSQLLogRequestSchema().dumps(d)
|
|
664
|
+
|
|
665
|
+
resp = self.invoke("ListUPgSQLLog", d, **kwargs)
|
|
666
|
+
return apis.ListUPgSQLLogResponseSchema().loads(resp)
|
|
667
|
+
|
|
668
|
+
def list_u_pg_sql_machine_type(
|
|
669
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
670
|
+
) -> dict:
|
|
671
|
+
"""ListUPgSQLMachineType - 获取UPgSQL支持机器类型列表
|
|
672
|
+
|
|
673
|
+
**Request**
|
|
674
|
+
|
|
675
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
676
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
677
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
678
|
+
|
|
679
|
+
**Response**
|
|
680
|
+
|
|
681
|
+
- **DataSet** (list) - 见 **PgSQLMachineType** 模型定义
|
|
682
|
+
- **Message** (str) - 返回信息
|
|
683
|
+
|
|
684
|
+
**Response Model**
|
|
685
|
+
|
|
686
|
+
**PgSQLMachineType**
|
|
687
|
+
- **Cpu** (int) - cpu核数
|
|
688
|
+
- **Description** (str) - 格式为nCmG,n代表cpu核数,m代表内存大小(GB)
|
|
689
|
+
- **ID** (str) - 机器类型ID
|
|
690
|
+
- **Memory** (int) - 内存用量(GB)
|
|
691
|
+
- **Os** (str) - 机器类型,N/O
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
"""
|
|
695
|
+
# build request
|
|
696
|
+
d = {
|
|
697
|
+
"ProjectId": self.config.project_id,
|
|
698
|
+
"Region": self.config.region,
|
|
699
|
+
}
|
|
700
|
+
req and d.update(req)
|
|
701
|
+
d = apis.ListUPgSQLMachineTypeRequestSchema().dumps(d)
|
|
702
|
+
|
|
703
|
+
resp = self.invoke("ListUPgSQLMachineType", d, **kwargs)
|
|
704
|
+
return apis.ListUPgSQLMachineTypeResponseSchema().loads(resp)
|
|
705
|
+
|
|
706
|
+
def list_u_pg_sql_version(
|
|
707
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
708
|
+
) -> dict:
|
|
709
|
+
"""ListUPgSQLVersion - 获取UPgSQL支持版本列表
|
|
710
|
+
|
|
711
|
+
**Request**
|
|
712
|
+
|
|
713
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
714
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
715
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
716
|
+
|
|
717
|
+
**Response**
|
|
718
|
+
|
|
719
|
+
- **DataSet** (list) - 见 **PgSQLVersion** 模型定义
|
|
720
|
+
- **Message** (str) - 返回信息
|
|
721
|
+
|
|
722
|
+
**Response Model**
|
|
723
|
+
|
|
724
|
+
**PgSQLVersion**
|
|
725
|
+
- **Available** (str) - 2位二进制控制是否开放单点和高可用,前一位控制单点是否开放,后一位控制高可用,例如"01"代表只开放高可用,"10"代表只开放单点,"11"代表全开放
|
|
726
|
+
- **DBVersion** (str) - PgSQL版本
|
|
727
|
+
|
|
728
|
+
|
|
729
|
+
"""
|
|
730
|
+
# build request
|
|
731
|
+
d = {
|
|
732
|
+
"ProjectId": self.config.project_id,
|
|
733
|
+
"Region": self.config.region,
|
|
734
|
+
}
|
|
735
|
+
req and d.update(req)
|
|
736
|
+
d = apis.ListUPgSQLVersionRequestSchema().dumps(d)
|
|
737
|
+
|
|
738
|
+
resp = self.invoke("ListUPgSQLVersion", d, **kwargs)
|
|
739
|
+
return apis.ListUPgSQLVersionResponseSchema().loads(resp)
|
|
740
|
+
|
|
741
|
+
def restart_u_pg_sql_instance(
|
|
742
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
743
|
+
) -> dict:
|
|
744
|
+
"""RestartUPgSQLInstance - 重启PG实例
|
|
745
|
+
|
|
746
|
+
**Request**
|
|
747
|
+
|
|
748
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
749
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
750
|
+
- **InstanceID** (str) - (Required) 实例ID
|
|
751
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
752
|
+
- **ForceToRestart** (bool) - 是否强制重启
|
|
753
|
+
- **RestartHost** (bool) - 是否一并重启主机
|
|
754
|
+
|
|
755
|
+
**Response**
|
|
756
|
+
|
|
757
|
+
- **Message** (str) - 描述信息
|
|
758
|
+
|
|
759
|
+
"""
|
|
760
|
+
# build request
|
|
761
|
+
d = {
|
|
762
|
+
"ProjectId": self.config.project_id,
|
|
763
|
+
"Region": self.config.region,
|
|
764
|
+
}
|
|
765
|
+
req and d.update(req)
|
|
766
|
+
d = apis.RestartUPgSQLInstanceRequestSchema().dumps(d)
|
|
767
|
+
|
|
768
|
+
resp = self.invoke("RestartUPgSQLInstance", d, **kwargs)
|
|
769
|
+
return apis.RestartUPgSQLInstanceResponseSchema().loads(resp)
|
|
770
|
+
|
|
771
|
+
def start_u_pg_sql_instance(
|
|
772
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
773
|
+
) -> dict:
|
|
774
|
+
"""StartUPgSQLInstance - 启动 PG实例
|
|
775
|
+
|
|
776
|
+
**Request**
|
|
777
|
+
|
|
778
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
779
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
780
|
+
- **InstanceID** (str) - (Required) 实例ID
|
|
781
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
782
|
+
|
|
783
|
+
**Response**
|
|
784
|
+
|
|
785
|
+
- **Message** (str) - 返回信息
|
|
786
|
+
|
|
787
|
+
"""
|
|
788
|
+
# build request
|
|
789
|
+
d = {
|
|
790
|
+
"ProjectId": self.config.project_id,
|
|
791
|
+
"Region": self.config.region,
|
|
792
|
+
}
|
|
793
|
+
req and d.update(req)
|
|
794
|
+
d = apis.StartUPgSQLInstanceRequestSchema().dumps(d)
|
|
795
|
+
|
|
796
|
+
resp = self.invoke("StartUPgSQLInstance", d, **kwargs)
|
|
797
|
+
return apis.StartUPgSQLInstanceResponseSchema().loads(resp)
|
|
798
|
+
|
|
799
|
+
def stop_u_pg_sql_creating_readonly(
|
|
800
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
801
|
+
) -> dict:
|
|
802
|
+
"""StopUPgSQLCreatingReadonly - 停止创建从库
|
|
803
|
+
|
|
804
|
+
**Request**
|
|
805
|
+
|
|
806
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
807
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
808
|
+
- **InstanceID** (str) - (Required) 停止创建从库
|
|
809
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
810
|
+
|
|
811
|
+
**Response**
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
"""
|
|
815
|
+
# build request
|
|
816
|
+
d = {
|
|
817
|
+
"ProjectId": self.config.project_id,
|
|
818
|
+
"Region": self.config.region,
|
|
819
|
+
}
|
|
820
|
+
req and d.update(req)
|
|
821
|
+
d = apis.StopUPgSQLCreatingReadonlyRequestSchema().dumps(d)
|
|
822
|
+
|
|
823
|
+
resp = self.invoke("StopUPgSQLCreatingReadonly", d, **kwargs)
|
|
824
|
+
return apis.StopUPgSQLCreatingReadonlyResponseSchema().loads(resp)
|
|
825
|
+
|
|
826
|
+
def stop_u_pg_sql_instance(
|
|
827
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
828
|
+
) -> dict:
|
|
829
|
+
"""StopUPgSQLInstance - 关闭PG实例
|
|
830
|
+
|
|
831
|
+
**Request**
|
|
832
|
+
|
|
833
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
834
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
835
|
+
- **InstanceID** (str) - (Required) 实例ID
|
|
836
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
837
|
+
- **ForceToStop** (bool) - 是否强制关闭
|
|
838
|
+
- **StopHost** (bool) - 是否将主机一并关闭
|
|
839
|
+
|
|
840
|
+
**Response**
|
|
841
|
+
|
|
842
|
+
- **Message** (str) - 描述信息
|
|
843
|
+
|
|
844
|
+
"""
|
|
845
|
+
# build request
|
|
846
|
+
d = {
|
|
847
|
+
"ProjectId": self.config.project_id,
|
|
848
|
+
"Region": self.config.region,
|
|
849
|
+
}
|
|
850
|
+
req and d.update(req)
|
|
851
|
+
d = apis.StopUPgSQLInstanceRequestSchema().dumps(d)
|
|
852
|
+
|
|
853
|
+
resp = self.invoke("StopUPgSQLInstance", d, **kwargs)
|
|
854
|
+
return apis.StopUPgSQLInstanceResponseSchema().loads(resp)
|
|
855
|
+
|
|
856
|
+
def update_u_pg_sql_attribute(
|
|
857
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
858
|
+
) -> dict:
|
|
859
|
+
"""UpdateUPgSQLAttribute - 更新数据库属性
|
|
860
|
+
|
|
861
|
+
**Request**
|
|
862
|
+
|
|
863
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
864
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
865
|
+
- **InstanceID** (str) - (Required) DB实例Id
|
|
866
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
867
|
+
- **Name** (str) - 新的db名字(不能为空字符串)
|
|
868
|
+
- **Remark** (str) - 新的备注信息
|
|
869
|
+
|
|
870
|
+
**Response**
|
|
871
|
+
|
|
872
|
+
- **Message** (str) - 返回的详细信息
|
|
873
|
+
|
|
874
|
+
"""
|
|
875
|
+
# build request
|
|
876
|
+
d = {
|
|
877
|
+
"ProjectId": self.config.project_id,
|
|
878
|
+
"Region": self.config.region,
|
|
879
|
+
}
|
|
880
|
+
req and d.update(req)
|
|
881
|
+
d = apis.UpdateUPgSQLAttributeRequestSchema().dumps(d)
|
|
882
|
+
|
|
883
|
+
resp = self.invoke("UpdateUPgSQLAttribute", d, **kwargs)
|
|
884
|
+
return apis.UpdateUPgSQLAttributeResponseSchema().loads(resp)
|
|
885
|
+
|
|
886
|
+
def update_u_pg_sql_backup_strategy(
|
|
887
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
888
|
+
) -> dict:
|
|
889
|
+
"""UpdateUPgSQLBackupStrategy - 修改备份策略
|
|
890
|
+
|
|
891
|
+
**Request**
|
|
892
|
+
|
|
893
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
894
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
895
|
+
- **InstanceID** (str) - (Required) DB实例Id
|
|
896
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
897
|
+
- **BackupMethod** (str) - 选择默认的备份方式
|
|
898
|
+
- **BackupTimeRange** (str) - 自动备份预计开始时间范围(00:00~23:59),例如:(3:00~4:00)
|
|
899
|
+
- **BackupWeek** (str) - 自动备份预期星期几(1~7)开始。默认1,2,3,4,5,6,7(星期一到星期日)
|
|
900
|
+
|
|
901
|
+
**Response**
|
|
902
|
+
|
|
903
|
+
- **Message** (str) - 返回的详细信息
|
|
904
|
+
|
|
905
|
+
"""
|
|
906
|
+
# build request
|
|
907
|
+
d = {
|
|
908
|
+
"ProjectId": self.config.project_id,
|
|
909
|
+
"Region": self.config.region,
|
|
910
|
+
}
|
|
911
|
+
req and d.update(req)
|
|
912
|
+
d = apis.UpdateUPgSQLBackupStrategyRequestSchema().dumps(d)
|
|
913
|
+
|
|
914
|
+
resp = self.invoke("UpdateUPgSQLBackupStrategy", d, **kwargs)
|
|
915
|
+
return apis.UpdateUPgSQLBackupStrategyResponseSchema().loads(resp)
|
|
916
|
+
|
|
917
|
+
def update_u_pg_sql_password(
|
|
918
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
919
|
+
) -> dict:
|
|
920
|
+
"""UpdateUPgSQLPassword - 更新数据库密码
|
|
921
|
+
|
|
922
|
+
**Request**
|
|
923
|
+
|
|
924
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
925
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
926
|
+
- **InstanceID** (str) - (Required) DB实例Id
|
|
927
|
+
- **Password** (str) - (Required) 新的db密码
|
|
928
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
929
|
+
|
|
930
|
+
**Response**
|
|
931
|
+
|
|
932
|
+
- **Message** (str) - 返回的详细信息
|
|
933
|
+
|
|
934
|
+
"""
|
|
935
|
+
# build request
|
|
936
|
+
d = {
|
|
937
|
+
"ProjectId": self.config.project_id,
|
|
938
|
+
"Region": self.config.region,
|
|
939
|
+
}
|
|
940
|
+
req and d.update(req)
|
|
941
|
+
d = apis.UpdateUPgSQLPasswordRequestSchema().dumps(d)
|
|
942
|
+
|
|
943
|
+
resp = self.invoke("UpdateUPgSQLPassword", d, **kwargs)
|
|
944
|
+
return apis.UpdateUPgSQLPasswordResponseSchema().loads(resp)
|
|
945
|
+
|
|
946
|
+
def upgrade_u_pg_sql_instance(
|
|
947
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
948
|
+
) -> dict:
|
|
949
|
+
"""UpgradeUPgSQLInstance - 硬件规格升降级
|
|
950
|
+
|
|
951
|
+
**Request**
|
|
952
|
+
|
|
953
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
954
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
955
|
+
- **DiskSpace** (int) - (Required) 磁盘空间(GB)
|
|
956
|
+
- **InstanceID** (str) - (Required) 资源ID
|
|
957
|
+
- **MachineType** (str) - (Required) 机器配置类型
|
|
958
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
959
|
+
|
|
960
|
+
**Response**
|
|
961
|
+
|
|
962
|
+
- **Message** (str) - 错误信息
|
|
963
|
+
|
|
964
|
+
"""
|
|
965
|
+
# build request
|
|
966
|
+
d = {
|
|
967
|
+
"ProjectId": self.config.project_id,
|
|
968
|
+
"Region": self.config.region,
|
|
969
|
+
}
|
|
970
|
+
req and d.update(req)
|
|
971
|
+
d = apis.UpgradeUPgSQLInstanceRequestSchema().dumps(d)
|
|
972
|
+
|
|
973
|
+
resp = self.invoke("UpgradeUPgSQLInstance", d, **kwargs)
|
|
974
|
+
return apis.UpgradeUPgSQLInstanceResponseSchema().loads(resp)
|
|
975
|
+
|
|
976
|
+
def upload_u_pg_sql_param_template(
|
|
977
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
978
|
+
) -> dict:
|
|
979
|
+
"""UploadUPgSQLParamTemplate - 上传参数模板
|
|
980
|
+
|
|
981
|
+
**Request**
|
|
982
|
+
|
|
983
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
984
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
985
|
+
- **Content** (str) - (Required) base64编码过的
|
|
986
|
+
- **DBVersion** (str) - (Required) 应用的DB版本
|
|
987
|
+
- **GroupName** (str) - (Required) 模板名称
|
|
988
|
+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
989
|
+
- **Description** (str) - 模板描述
|
|
990
|
+
- **ParamGroupType** (str) - 版本
|
|
991
|
+
|
|
992
|
+
**Response**
|
|
993
|
+
|
|
994
|
+
- **GroupID** (int) - 生成的模板ID
|
|
995
|
+
- **Message** (str) - 描述信息
|
|
996
|
+
|
|
997
|
+
"""
|
|
998
|
+
# build request
|
|
999
|
+
d = {
|
|
1000
|
+
"ProjectId": self.config.project_id,
|
|
1001
|
+
"Region": self.config.region,
|
|
1002
|
+
}
|
|
1003
|
+
req and d.update(req)
|
|
1004
|
+
d = apis.UploadUPgSQLParamTemplateRequestSchema().dumps(d)
|
|
1005
|
+
|
|
1006
|
+
resp = self.invoke("UploadUPgSQLParamTemplate", d, **kwargs)
|
|
1007
|
+
return apis.UploadUPgSQLParamTemplateResponseSchema().loads(resp)
|