获取 Credential 的认证配置和元数据,不返回 secret_value。
接口
GET /vaults/{vault_id}/credentials/{credential_id}
路径相对 Base URL。每个请求携带 Authorization: Bearer $DASHSCOPE_API_KEY,认证方式见认证。
路径参数vault_idstring (必选)父 Vault ID,按不透明 ID 使用credential_id string (必选)Credential ID,按不透明 ID 使用 | 请求示例 |
响应字段200,返回 Credential: 响应不返回 secret_value、密钥标识或 injection_location。已归档的 Credential 仍可获取。id stringCredential 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 时返回 | 响应示例 |
错误码
错误响应结构见错误码。
| HTTP 状态码 | 错误类型 / 错误码 | 解决方案 |
|---|---|---|
401 | authentication_error / invalid_api_key | 在请求头携带有效的 Authorization: Bearer $DASHSCOPE_API_KEY |
404 | not_found_error / not_found_error | Credential 不存在、已删除、父归属不符或不属于当前工作空间 |
500 | server_error / server_error | 稍后重试;持续失败时提交工单并提供 x-request-id |