删除脚本保险库绑定
移除脚本的保险库别名,不删除库和密钥。别名不存在也成功;归档保留绑定,永久删除目标会清除绑定。
DELETE /automation/v1/scripts/{namespace}/{name}/vaults/{alias}
鉴权
Authorization: Bearer $PRAXIS_API_KEY
请求字段
| 参数 | 类型 | 说明 |
|---|---|---|
| path: namespace | string |
必填;目标所属命名空间,取自脚本或工作流列表。 |
| path: name | string |
必填;目标的资源名称,取自脚本或工作流列表,不含版本。 |
| path: alias | string |
必填;调用方选定的别名,1–40 位小写字母、数字或连字符,以字母起始。 pattern: "^[a-z][a-z0-9-]{0,39}$" |
示例
先设置以下环境变量,使用你自己的资源:
| 变量 | 来源 |
|---|---|
| SCRIPT_NAME | 创建脚本返回的 name |
: "${SCRIPT_NAME:?Set SCRIPT_NAME}"
curl --fail-with-body -X DELETE "https://api.deepraxis.com/automation/v1/scripts/{namespace}/${SCRIPT_NAME}/vaults/sample" \
-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.scripts.vaults.delete({
"path": {
"ns": "docs-samples",
"name": env("SCRIPT_NAME"),
"alias": "sample"
}
});
console.log(result);
响应
HTTP 204
Binding removed or already absent; no response body.
实测响应
HTTP 204
错误码
| HTTP | 错误码与说明 |
|---|---|
| 400 | INVALID_PARAMS:请求参数、路径、游标或请求体格式无效。 |
| 404 | TARGET_NOT_FOUND:编排目标不存在或类型不匹配。 |
| default | Automation problem; inspect the refusal code and diagnostics before retrying. |
鉴权错误与通用错误 · 排查时保留响应头 X-Request-Id。