查询云数据库MySQL支持类型与规格
# 1.接口描述
Action:DescribeAvailableDBConfig
描述: 获取某个站点可购买的MySQL产品类型以及规格
请求地址: cdsapi.capitalonline.net/mysql
请求方法: GET
# 2.请求参数
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
RegionId | 是 | string | 站点编号 |
# 3.请求示例
def get_mysql_spec_info():
"""
获取某个站点支持的MySQL产品类型以及规格
"""
action = "DescribeAvailableDBConfig"
method = "GET"
param = {
"RegionId": "********"
}
url = get_signature(action, AK, AccessKeySecret, method, MYSQL_URL, param)
res = requests.get(url)
result = json.loads(res.content)
result = json.dumps(result) # json格式化
print(result)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
# 4.返回参数
参数名 | 类型 | 说明 |
---|---|---|
Code | string | 状态码 |
Data | DataObj | 可购买的MySQL产品类型以及规格数据对象 |
Message | string | 返回调用接口状态信息和code相对应,比如:Success, Error |
TaskId | string | 任务Id, 暂时不支持根据任务查询任务状态 |
# DataObj
参数名 | 类型 | 说明 |
---|---|---|
ProductName | string | 产品名称,比如mysql |
Products | list of ProductObj | 该类产品支持的产品列表 |
RegionId | string | 站点编号 |
# ProductObj
参数名 | 类型 | 说明 |
---|---|---|
Architectures | list of ArchitectureObj | 产品支持的架构列表 |
Version | string | 产品支持的版本 |
# ArchitectureObj
参数名 | 类型 | 说明 |
---|---|---|
ArchitectureName | string | 架构名称 |
ArchitectureType | int | 架构类型: 0-基础版 1高可用版 |
ComputeRoles | list of ComputeRoleObj | 支持的计算类型,不同的计算类型支持不同规格,并支持添加不同类型的硬盘 |
EnginesType | string | 引擎类型 |
NetworkLinks | list of NetworkLinkObj | 此架构支持的链路类型 |
SubProductName | string | 子产品名称,比如:MySQL 高可用版、MySQL 基础版 |
# ComputeRoleObj
参数名 | 类型 | 说明 |
---|---|---|
ComputeName | string | 计算类型名称, 比如:通用型 |
ComputeType | int | 支持的计算类型(目前仅支持通用型计算类型): 0-通用型 |
Standards | StandardObj | 该类型支持的规格 |
# StandardObj
参数名 | 类型 | 说明 |
---|---|---|
AttachDisk | list of AttachDiskObj | 该类型规格能够添加的磁盘类型列表 |
CpuRam | list of CpuRamObj | 支持的规格列表 |
# AttachDiskObj
参数名 | 类型 | 说明 |
---|---|---|
BasicIops | string | 基础的磁盘的iops |
DiskMax | int | 单次支持扩容到最大磁盘容量为2000 |
DiskMaxExpand | string | 磁盘最大可扩容大小 |
DiskMin | string | 磁盘容量支持的最小值,起步为100 |
DiskName | string | 磁盘类型名称,包含SSD和性能型 SSD:SSD磁盘,磁盘IOPS默认为5000,可购买IOPS性能包 性能型:普通SSD盘,磁盘IOPS限定在3000 |
DiskStep | string | 磁盘扩容步长,步长大小=100 |
DiskUnit | string | 磁盘容量单位:GB |
DiskValue | string | 磁盘类型,用于创建服务实例指定磁盘类型 (创建服务时候使用) |
# CpuRamObj
参数名 | 类型 | 说明 |
---|---|---|
CPU | int | 核心数量,单位:个 |
Name | string | 规格名称 |
PaasGoodsId | int | 具体的产品编号,根据产品编号确定购买哪一种规格 |
RAM | int | 内存大小,单位:GB |
# NetworkLinkObj
参数名 | 类型 | 说明 |
---|---|---|
DescDetail | string | 链路类型描述 |
LinkType | string | 链路类型“英文” |
Name | string | 链路类型“中文” |
# 5.返回示例
{
"Code": "Success",
"Data": {
"ProductName": "mysql",
"Products": [
{
"Architectures": [
{
"ArchitectureName": "主从",
"ArchitectureType": 1,
"ComputeRoles": [
{
"ComputeName": "通用型",
"ComputeType": 0,
"Standards": {
"AttachDisk": [
{
"BasicIops": "",
"DiskMax": 2000,
"DiskMaxExpand": 2000,
"DiskMin": 100,
"DiskName": "SSD",
"DiskStep": 100,
"DiskUnit": "G",
"DiskValue": "ssd_disk"
}
],
"CpuRam": [
{
"CPU": 1,
"Name": "1C2G",
"PaasGoodsId": 17060,
"RAM": 2
}
]
}
}
],
"EnginesType": [],
"NetworkLinks": [
{
"DescDetail": "默认链路:服务实例占用VDC私有网络IP地址,适用于对延迟敏感类型的应用。",
"LinkType": "default_link",
"Name": "默认链路"
}
],
"SubProductName": "MySQL高可用版"
}
],
"Version": "8.0"
}
],
"RegionId": "*******"
},
"Message": "success",
"TaskId": ""
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57