分页列出指定 Vault 下的 Credential,支持元数据和归档状态筛选。
接口
GET /vaults/{vault_id}/credentials
路径相对 Base URL。每个请求携带 Authorization: Bearer $DASHSCOPE_API_KEY,认证方式见认证。
路径参数vault_idstring (必选)父 Vault ID,按不透明 ID 使用查询参数limitinteger (可选)每页数量,默认 20,范围 1–100。空字符串、0、负数、非数字或超出范围返回 400order string (可选)排序方向,asc 或 desc,默认 descafter string (可选)上一页的 last_id。从该项之后开始,不包含该项metadata[key] string (可选)元数据过滤条件,按 metadata 精确匹配,多个条件之间为 ANDstatus string (可选)Credential 状态:active 或 archived,默认两者都包含。也支持重复传入 status[],值会合并为筛选集合before 不是支持参数。Credential 只会列出路径 Vault 下的资源,after 游标必须属于同一个 Vault。 | 请求示例 |
响应字段200,返回列表信封:object string列表对象类型,固定为 listdata array当前页的 Credential 数组first_id string / null当前页首项 ID。空页为 nulllast_id string / null当前页末项 ID,下一页的 after 使用该值。空页为 nullhas_more boolean是否还有更多匹配资源Credential 字段idstringCredential IDobject stringCredential 对象类型,固定为 vault.credentialvault_id string所属 Vault IDname string显示名称created_at integer创建时间,Unix 秒updated_at integer最近更新时间,Unix 秒metadata object元数据,字符串键值对;未设置时为 {}auth object认证配置。
属性 type string认证类型,固定为 environment_variablesecret_name string环境变量名networking object目标域名配置。
属性 type string网络访问类型,limited 或 unrestrictedallowed_hosts array允许的目标域名或 IPv4,仅 limited 时返回secret_value、密钥标识或 injection_location。空页返回 data: [],first_id 和 last_id 为 null,has_more 为 false。 | 响应示例 |
错误码
错误响应结构见错误码。
| HTTP 状态码 | 错误类型 / 错误码 | 解决方案 |
|---|---|---|
400 | invalid_request_error / invalid_request_error | 按查询参数说明修正 limit、order 或 metadata 过滤条件 |
401 | authentication_error / invalid_api_key | 在请求头携带有效的 Authorization: Bearer $DASHSCOPE_API_KEY |
404 | not_found_error / not_found_error | 父 Vault 不存在,或 after 游标不存在、已删除、跨父 Vault |
500 | server_error / server_error | 稍后重试;持续失败时提交工单并提供 x-request-id |