恢复部署
通过 OMA API 恢复部署。
curl --request POST \
--url http://localhost:38080/v1/deployments/{deployment_id}/unpause \
--header 'X-Api-Key: <api-key>' \
--header 'anthropic-beta: <anthropic-beta>' \
--header 'anthropic-version: <anthropic-version>'import requests
url = "http://localhost:38080/v1/deployments/{deployment_id}/unpause"
headers = {
"anthropic-version": "<anthropic-version>",
"anthropic-beta": "<anthropic-beta>",
"X-Api-Key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'anthropic-version': '<anthropic-version>',
'anthropic-beta': '<anthropic-beta>',
'X-Api-Key': '<api-key>'
}
};
fetch('http://localhost:38080/v1/deployments/{deployment_id}/unpause', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:38080/v1/deployments/{deployment_id}/unpause"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("anthropic-version", "<anthropic-version>")
req.Header.Add("anthropic-beta", "<anthropic-beta>")
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"type": "deployment",
"id": "depl_011CZkZcDH3vPqd7xnEfwTai",
"name": "每日订单报告",
"description": "每个工作日早晨将前一天的订单汇总为报告。",
"agent": {
"type": "agent",
"id": "agent_011CZkYpogX7uDKUyvBTophP",
"version": 1
},
"environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
"vault_ids": [
"vlt_011CZkZDLs7fYzm1hXNPeRjv"
],
"initial_events": [
{
"type": "user.message",
"content": [
{
"type": "text",
"text": "将昨天的订单汇总到 report.md。"
}
]
}
],
"resources": [],
"metadata": {},
"schedule": {
"type": "cron",
"expression": "0 9 * * 1-5",
"timezone": "America/Los_Angeles",
"last_run_at": "2026-03-16T16:00:09Z",
"upcoming_runs_at": [
"2026-03-17T16:00:00Z",
"2026-03-18T16:00:00Z"
]
},
"status": "active",
"paused_reason": null,
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z",
"archived_at": null
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}?beta=true、anthropic-version: 2023-06-01 与 anthropic-beta: managed-agents-2026-04-01。授权
OMA 工作区 API 密钥。
路径参数
部署标识符。
查询参数
为此接口启用 Beta API 合同,必须为 true。
true 响应
请求成功。
部署是智能体的一个已配置实例——它将智能体绑定到自主运行所需的一切:环境、凭据、初始事件,以及可选的调度计划。
deployment "deployment"
此部署的唯一标识符。
"depl_011CZkZcDH3vPqd7xnEfwTai"
人类可读的名称。
"每日订单报告"
对部署功能的描述。
"每个工作日早晨将昨天的订单汇总为报告。"
该部署所运行的智能体的引用,已解析为具体版本。
Show child attributes
Show child attributes
{
"type": "agent",
"id": "agent_011CZkYpogX7uDKUyvBTophP",
"version": 1
}
会话运行所在 environment 的 ID。
"env_011CZkZ9X2dpNyB7HsEFoRfW"
为从此部署创建的会话提供已存储凭据的密钥库 ID 列表。
["vlt_011CZkZDLs7fYzm1hXNPeRjv"]
每个会话创建后立即发送的事件。
发送到会话的用户消息。
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
[
{
"type": "user.message",
"content": [
{
"type": "text",
"text": "将昨天的订单汇总到 report.md。"
}
]
}
]
附加到此部署所创建会话的资源。回显输入内容,但不包括只写凭据。
挂载到每个会话容器中的 GitHub 仓库。授权令牌为只写,不会被返回。
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
[]
任意键值元数据。最多 16 对。
Show child attributes
Show child attributes
{}
周期性 cron 调度。存在时启用计划执行;为 null 表示仅手动执行。cron 变体包含计算得出的时间戳(下次触发时间、上次运行时间)。
Show child attributes
Show child attributes
{
"type": "cron",
"expression": "0 9 * * 1-5",
"timezone": "America/Los_Angeles",
"last_run_at": "2026-03-16T16:00:09Z",
"upcoming_runs_at": [
"2026-03-17T16:00:00Z",
"2026-03-18T16:00:00Z"
]
}
部署的计算状态:active 或 paused。已归档的部署会报告为 active,同时已设置 archived_at。
active, paused "active"
部署被暂停的原因。仅当 status 为 paused 时非空;否则为 null。
- Option 1
- Option 2
Show child attributes
Show child attributes
null
部署的创建时间。
"2026-03-15T10:00:00Z"
部署的最后更新时间。
"2026-03-15T10:00:00Z"
部署的归档时间。未归档时为 null。
null
为该部署创建的每个会话设定的消费上限。未设置预算时不存在。
Show child attributes
Show child attributes
此页面对您有帮助吗?
curl --request POST \
--url http://localhost:38080/v1/deployments/{deployment_id}/unpause \
--header 'X-Api-Key: <api-key>' \
--header 'anthropic-beta: <anthropic-beta>' \
--header 'anthropic-version: <anthropic-version>'import requests
url = "http://localhost:38080/v1/deployments/{deployment_id}/unpause"
headers = {
"anthropic-version": "<anthropic-version>",
"anthropic-beta": "<anthropic-beta>",
"X-Api-Key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'anthropic-version': '<anthropic-version>',
'anthropic-beta': '<anthropic-beta>',
'X-Api-Key': '<api-key>'
}
};
fetch('http://localhost:38080/v1/deployments/{deployment_id}/unpause', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:38080/v1/deployments/{deployment_id}/unpause"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("anthropic-version", "<anthropic-version>")
req.Header.Add("anthropic-beta", "<anthropic-beta>")
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"type": "deployment",
"id": "depl_011CZkZcDH3vPqd7xnEfwTai",
"name": "每日订单报告",
"description": "每个工作日早晨将前一天的订单汇总为报告。",
"agent": {
"type": "agent",
"id": "agent_011CZkYpogX7uDKUyvBTophP",
"version": 1
},
"environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
"vault_ids": [
"vlt_011CZkZDLs7fYzm1hXNPeRjv"
],
"initial_events": [
{
"type": "user.message",
"content": [
{
"type": "text",
"text": "将昨天的订单汇总到 report.md。"
}
]
}
],
"resources": [],
"metadata": {},
"schedule": {
"type": "cron",
"expression": "0 9 * * 1-5",
"timezone": "America/Los_Angeles",
"last_run_at": "2026-03-16T16:00:09Z",
"upcoming_runs_at": [
"2026-03-17T16:00:00Z",
"2026-03-18T16:00:00Z"
]
},
"status": "active",
"paused_reason": null,
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z",
"archived_at": null
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}