接口功能介绍
分页查询表(table)列表。
接口约束
请先订购DRDS实例。请先订购和DRDS实例在一个资源池同一个VPC下的RDS-MySQL实例,并关联到DRDS实例。请先创建一个schema。
URI
GET /v2/table/list
路径参数
无
Query参数
参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
prodInstId | 是 | String | DRDS产品实例id | cb236d462b924ef7bfba5ecf1d61de2b | |
schemaName | 是 | String | schema名称 | bss_crm_test | |
pageNow | 否 | Integer | 当前页,若为空或小于1,默认是1 | 1 | |
pageSize | 否 | Integer | 页大小,若为空或小于1,默认是10 | 10 | |
tableName | 否 | String | 表名,模糊搜索。不传或者传空,表示搜索全部表。 | ||
tableType | 否 | Integer | 表类型。0全部 1全局表 2分片表(包含 5、7) 3单片表(包含 6) 5分片表+库内分表 7分片表+库内分桶 4 未设置 6单片表+库内分表。不填则默认为0,即查询全部表。 | 0 |
请求参数
请求头header参数
无
请求体body参数
无
响应参数
参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
code | 是 | String | 返回码 取值范围:0表示成功,1表示失败 | 0 | |
message | 是 | String | 结果描述 | success | |
result | 否 | Array of Objects | 返回对象,列表,若无该字段或该字段为null或者空列表,都代表返回对象为空。 | table |
表 table
参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
name | 是 | String | 表名 | ||
tableType | 是 | Integer | 表类型。1全局表 2分片表 3单片表 5库内分表 7库内分桶 4 未设置 6单片库内分表。 | 7 | |
tableTypeDesc | 否 | String | 表类型描述 | 分片表 + 库内分桶 | |
id | 否 | String | 表id | ||
dbTableId | 否 | Long | 表在schema内部的序号 | 2 | |
primaryKey | 否 | String | 主键 | id | |
type | 否 | String | 表类型 | ||
dataNode | 否 | Array of String | 数据节点列表 | ||
readonly | 否 | String | 是否只读,true是,false否 | false | |
buckets | 否 | Integer | 分桶的数量 | 0 | |
dbnodeList | 否 | Array of Object | 分片信息列表 | datanode | |
innerRule | 否 | String | 库内分表规则id | ||
innerTableRule | 否 | Array of Object | 库内分表表规则列表 | tablerule | |
innerTotal | 否 | Integer | 库内分片数量 | ||
innerShardingRule | 否 | Array of Object | 库内分片规则列表 | tablerule | |
rule | 否 | Object | 分片表规则id | ||
tableRule | 否 | Array of Objects | 分片表规则列表 | tablerule | |
tableShardingRule | 否 | Array of Objects | 分片规则列表 | tablerule |
表datanode
参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
name | 是 | String | 分片名 | sc1_1 | |
datahost | 是 | String | data_host节点id | data_host_0000000105 | |
database | 是 | String | 库名 | sc1_1 | |
id | 是 | String | 分片id | ||
isStandard | 是 | String | 是否为标准库,true是,false否 | false | |
singleNode | 是 | String | 是否为单节点,true是,false否 | false | |
readonly | 是 | String | 是否只读,true是,false否 | false | |
schema | 是 | String | schema id | schema_0000000106 |
表tablerule
参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
name | 是 | String | 分片函数 | mod-4 | |
columns | 是 | String | 分片字段 | ||
algorithm | 是 | String | 算法 | ||
id | 是 | String | 规则id |
请求示例
请求头header
无
请求体body
无
响应示例
{
"code": 0,
"message": "success",
"result": [
{
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/schemas/schema_0000000106/table/table_0000000150",
"dbTableId": 2,
"name": "t1",
"primaryKey": "id",
"type": "global",
"tableType": 1,
"dataNode": [
"data_node_0000000109",
"data_node_0000000111",
"data_node_0000000113"
],
"readonly": "false",
"buckets": "0",
"tableTypeDesc": "全局表",
"dbnodeList": [
{
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/shardings/data_node/data_node_0000000109",
"name": "sc1_1",
"datahost": "data_host_0000000105",
"database": "sc1_1",
"schema": "schema_0000000106",
"isStandard": "false",
"singleNode": "false",
"readonly": "false"
},
{
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/shardings/data_node/data_node_0000000111",
"name": "sc1_2",
"datahost": "data_host_0000000105",
"database": "sc1_2",
"schema": "schema_0000000106",
"isStandard": "false",
"singleNode": "false",
"readonly": "false"
},
{
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/shardings/data_node/data_node_0000000113",
"name": "sc1_3",
"datahost": "data_host_0000000105",
"database": "sc1_3",
"schema": "schema_0000000106",
"isStandard": "false",
"singleNode": "false",
"readonly": "false"
}
]
},
{
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/schemas/schema_0000000106/table/table_0000000152",
"dbTableId": 3,
"name": "t2",
"primaryKey": "id",
"tableType": 3,
"dataNode": [
"data_node_0000000109"
],
"readonly": "false",
"buckets": "0",
"tableTypeDesc": "单片表",
"dbnodeList": [
{
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/shardings/data_node/data_node_0000000109",
"name": "sc1_1",
"datahost": "data_host_0000000105",
"database": "sc1_1",
"schema": "schema_0000000106",
"isStandard": "false",
"singleNode": "false",
"readonly": "false"
}
]
},
{
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/schemas/schema_0000000106/table/table_0000000156",
"dbTableId": 4,
"name": "t3",
"primaryKey": "id",
"tableType": 6,
"dataNode": [
"data_node_0000000111"
],
"innerRule": "tablerule_0000000157",
"innerTableRule": {
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/tablerule/tablerule_0000000157",
"name": "mod-4",
"columns": "id",
"algorithm": "/functions/function_0000000154"
},
"innerTotal": "4",
"readonly": "false",
"buckets": "0",
"tableTypeDesc": "单片表 + 库内分表",
"dbnodeList": [
{
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/shardings/data_node/data_node_0000000111",
"name": "sc1_2",
"datahost": "data_host_0000000105",
"database": "sc1_2",
"schema": "schema_0000000106",
"isStandard": "false",
"singleNode": "false",
"readonly": "false"
}
],
"innerShardingRule": {
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/tablerule/tablerule_0000000157",
"name": "mod-4",
"columns": "id",
"algorithm": "/functions/function_0000000154"
}
},
{
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/schemas/schema_0000000106/table/table_0000000161",
"dbTableId": 5,
"name": "t4",
"primaryKey": "id",
"tableType": 2,
"dataNode": [
"data_node_0000000109",
"data_node_0000000111",
"data_node_0000000113"
],
"rule": "tablerule_0000000162",
"tableRule": {
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/tablerule/tablerule_0000000162",
"name": "mod-3",
"columns": "id",
"algorithm": "/functions/function_0000000159"
},
"readonly": "false",
"buckets": "0",
"tableTypeDesc": "分片表",
"dbnodeList": [
{
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/shardings/data_node/data_node_0000000109",
"name": "sc1_1",
"datahost": "data_host_0000000105",
"database": "sc1_1",
"schema": "schema_0000000106",
"isStandard": "false",
"singleNode": "false",
"readonly": "false"
},
{
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/shardings/data_node/data_node_0000000111",
"name": "sc1_2",
"datahost": "data_host_0000000105",
"database": "sc1_2",
"schema": "schema_0000000106",
"isStandard": "false",
"singleNode": "false",
"readonly": "false"
},
{
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/shardings/data_node/data_node_0000000113",
"name": "sc1_3",
"datahost": "data_host_0000000105",
"database": "sc1_3",
"schema": "schema_0000000106",
"isStandard": "false",
"singleNode": "false",
"readonly": "false"
}
],
"tableShardingRule": {
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/tablerule/tablerule_0000000162",
"name": "mod-3",
"columns": "id",
"algorithm": "/functions/function_0000000159"
}
},
{
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/schemas/schema_0000000106/table/table_0000000166",
"dbTableId": 6,
"name": "t5",
"primaryKey": "id",
"tableType": 5,
"dataNode": [
"data_node_0000000109",
"data_node_0000000111",
"data_node_0000000113"
],
"rule": "tablerule_0000000167",
"tableRule": {
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/tablerule/tablerule_0000000167",
"name": "mod-3",
"columns": "id",
"algorithm": "/functions/function_0000000159"
},
"innerRule": "tablerule_0000000168",
"innerTableRule": {
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/tablerule/tablerule_0000000168",
"name": "string-mod-3",
"columns": "name",
"algorithm": "/functions/function_0000000164"
},
"innerTotal": "3",
"readonly": "false",
"buckets": "0",
"tableTypeDesc": "分片表 + 库内分表",
"dbnodeList": [
{
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/shardings/data_node/data_node_0000000109",
"name": "sc1_1",
"datahost": "data_host_0000000105",
"database": "sc1_1",
"schema": "schema_0000000106",
"isStandard": "false",
"singleNode": "false",
"readonly": "false"
},
{
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/shardings/data_node/data_node_0000000111",
"name": "sc1_2",
"datahost": "data_host_0000000105",
"database": "sc1_2",
"schema": "schema_0000000106",
"isStandard": "false",
"singleNode": "false",
"readonly": "false"
},
{
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/shardings/data_node/data_node_0000000113",
"name": "sc1_3",
"datahost": "data_host_0000000105",
"database": "sc1_3",
"schema": "schema_0000000106",
"isStandard": "false",
"singleNode": "false",
"readonly": "false"
}
],
"tableShardingRule": {
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/tablerule/tablerule_0000000167",
"name": "mod-3",
"columns": "id",
"algorithm": "/functions/function_0000000159"
},
"innerShardingRule": {
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/tablerule/tablerule_0000000168",
"name": "string-mod-3",
"columns": "name",
"algorithm": "/functions/function_0000000164"
}
},
{
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/schemas/schema_0000000106/table/table_0000000170",
"dbTableId": 7,
"name": "t6",
"primaryKey": "id",
"tableType": 7,
"dataNode": [
"data_node_0000000109",
"data_node_0000000111",
"data_node_0000000113"
],
"rule": "tablerule_0000000171",
"tableRule": {
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/tablerule/tablerule_0000000171",
"name": "mod-3",
"columns": "id",
"algorithm": "/functions/function_0000000159"
},
"readonly": "false",
"buckets": "4",
"tableTypeDesc": "分片表 + 库内分桶",
"dbnodeList": [
{
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/shardings/data_node/data_node_0000000109",
"name": "sc1_1",
"datahost": "data_host_0000000105",
"database": "sc1_1",
"schema": "schema_0000000106",
"isStandard": "false",
"singleNode": "false",
"readonly": "false"
},
{
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/shardings/data_node/data_node_0000000111",
"name": "sc1_2",
"datahost": "data_host_0000000105",
"database": "sc1_2",
"schema": "schema_0000000106",
"isStandard": "false",
"singleNode": "false",
"readonly": "false"
},
{
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/shardings/data_node/data_node_0000000113",
"name": "sc1_3",
"datahost": "data_host_0000000105",
"database": "sc1_3",
"schema": "schema_0000000106",
"isStandard": "false",
"singleNode": "false",
"readonly": "false"
}
],
"tableShardingRule": {
"id": "/dbproxy_cluster/dbproxy_cluster_0000000001/tablerule/tablerule_0000000171",
"name": "mod-3",
"columns": "id",
"algorithm": "/functions/function_0000000159"
}
},
{
"name": "t7",
"tableType": 4,
"tableTypeDesc": "未设置"
}
]
}
状态码
请参考 状态码说明。