列出工作流保险库绑定
读取工作流绑定的整库与密钥名称,不返回值;归档后保留绑定,元数据读取失败时 secrets 为空并标记 secrets_unavailable。
GET /automation/v1/workflows/{namespace}/{name}/vaults
鉴权
Authorization: Bearer $PRAXIS_API_KEY
请求字段
| 参数 | 类型 | 说明 |
|---|---|---|
| path: namespace | string |
必填;目标所属命名空间,取自脚本或工作流列表。 |
| path: name | string |
必填;目标的资源名称,取自脚本或工作流列表,不含版本。 |
示例
先设置以下环境变量,使用你自己的资源:
| 变量 | 来源 |
|---|---|
| WORKFLOW_NAME | 创建工作流返回的 name |
: "${WORKFLOW_NAME:?Set WORKFLOW_NAME}"
curl --fail-with-body -X GET "https://api.deepraxis.com/automation/v1/workflows/{namespace}/${WORKFLOW_NAME}/vaults" \
-H "Authorization: Bearer $PRAXIS_API_KEY"
import { createAutomationClient } from '@deepraxis/sdk/automation';
function env(name: string): string {
const value = process.env[name];
if (!value) throw new Error(`Set ${name}`);
return value;
}
const automation = createAutomationClient({
apiKey: env('PRAXIS_API_KEY'),
baseUrl: 'https://api.deepraxis.com',
maxRetries: 0,
timeoutMs: 90_000,
});
const result = await automation.workflows.vaults.list({
"path": {
"ns": "docs-samples",
"name": env("WORKFLOW_NAME")
}
});
console.log(result);
响应
HTTP 200
Bindings and available secret names; no secret values.
application/json
| 字段 | 类型 | 说明 |
|---|---|---|
| data | object[] |
必填 / 必有;Whole-vault bindings for this definition, sorted by alias, with secret names only. |
| data[].alias | string |
必填 / 必有;Alias used to identify this whole-vault binding on the script or workflow. pattern: "^[a-z][a-z0-9-]{0,39}$" |
| data[].vault | object |
必填 / 必有;Bound vault identity and current display name; unavailable vaults use their ID as the fallback name. |
| data[].vault.id | string |
必填 / 必有;Opaque vault identifier from vault creation or listing; persisted even if the vault becomes unavailable. |
| data[].vault.name | string |
必填 / 必有;Current vault display name, or the vault ID when its metadata cannot be read. |
| data[].secrets | object[] |
必填 / 必有;Accessible secret names without values. Empty when metadata cannot be read; check secrets_unavailable. |
| data[].secrets[].name | string |
必填 / 必有;Lookup name of a non-archived secret in this vault; secret values are never returned. |
| data[].secrets_unavailable | true |
可选;Present and true when vault or secret metadata could not be read; secrets is then empty. Omitted on success. |
实测响应
HTTP 200
{
"data": [
{
"alias": "sample",
"vault": {
"id": "vlt_0ab396e275bb47109aacf786b9a49057",
"name": "sample-vault-1793176670321-396dbf"
},
"secrets": [
{
"name": "SAMPLE_TOKEN"
}
]
}
]
}
错误码
| HTTP | 错误码与说明 |
|---|---|
| 400 | INVALID_PARAMS:请求参数、路径、游标或请求体格式无效。 |
| 404 | TARGET_NOT_FOUND:编排目标不存在或类型不匹配。 |
| default | Automation problem; inspect the refusal code and diagnostics before retrying. |
鉴权错误与通用错误 · 排查时保留响应头 X-Request-Id。