更新时间:2023-11-29 GMT+08:00

查询字典列表

功能介绍

查询字典列表。

URI

GET /v2/{project_id}/instances/{instance_id}/dictionaries

表1 路径参数

参数

是否必选

参数类型

描述

instance_id

String

实例ID。

project_id

String

项目ID,获取方式请参见API参考的“附录 > 获取项目ID”章节。

表2 Query参数

参数

是否必选

参数类型

描述

offset

String

偏移量,大于等于0。

limit

String

每页显示的条目数量。

parent_code

String

指定父字典编码,返回子字典列表信息,未指定时查询顶级字典列表信息。

code

String

通过code进行模糊匹配查询。

name

String

通过name进行模糊匹配查询。

请求参数

表3 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

用户Token。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

响应参数

状态码: 200

表4 响应Body参数

参数

参数类型

描述

total

Integer

总数,与分页无关。

size

Integer

当前页的数量,小于等于请求里指定的limit。

dictionaries

Array of Dictionary objects

字典列表。

表5 Dictionary

参数

参数类型

描述

id

String

字典ID。

name

String

字典名称。

  • 字符集:中文、英文字母、数字、下划线和空格。

  • 约束:实例下唯一。

remark

String

字典描述。

code

String

字典编码。

  • 字符集:英文字母、数字、下划线和空格。

  • 约束:实例下唯一。

extend_one

String

字典扩展字段1。 字符集:中文、英文字母、数字、下划线和空格。

extend_two

String

字典扩展字段2。 字符集:中文、英文字母、数字、下划线和空格。

parent_code

String

父字典编码,为空时代表自身就是最顶级字典。

type

String

字典类型。

  • system: 代表系统内置字典,用户可编辑但不可删除。

  • user: 代表用户创建字典。

create_time

String

创建时间。

update_time

String

更新时间。

状态码: 403

表6 响应Body参数

参数

参数类型

描述

error_code

String

错误码。

error_msg

String

错误消息。

error_details

String

具体错误消息。

request_id

String

请求处理ID。

请求示例

响应示例

状态码: 200

OK

{
  "total" : 0,
  "size" : 0,
  "dictionaries" : [ {
    "id" : "string",
    "name" : "string",
    "remark" : "string",
    "code" : "string",
    "extend_one" : "string",
    "extend_two" : "string",
    "parent_code" : "string",
    "type" : "system",
    "create_time" : "2019-12-06T06:49:04Z",
    "update_time" : "2019-12-06T06:49:04Z"
  } ]
}

状态码: 403

Forbidden

{
  "error_code" : "ROMA.00000101",
  "error_msg" : "error summary",
  "error_details" : "some error details here",
  "request_id" : "13760c1fe8655e61209b75665e9bef43"
}

状态码

状态码

描述

200

OK

403

Forbidden

错误码

请参见错误码