跳到主要内容

agentrun template

管理 AgentRun 沙箱模板及其 MCP 服务。

运行 ecctl agentrun template <action> -h 查看用法,或 ecctl schema agentrun.template.<action> --full 获取该命令完整的结构化规格——每个参数与行为,便于 Agent 读取和填参。

create

ecctl agentrun template create [flags]

创建 AgentRun 沙箱模板

  • 类型:mutation · 风险:medium
  • 同步:等待 READY(waiter ready_after_change,超时 600s);用 --no-wait 跳过等待。
API调用时机用途
CreateTemplate每次执行命令时执行资源操作。
GetTemplate未指定 --no-wait轮询等待资源达到目标状态。(重复调用)
参数类型必填说明
--cpunumberCPU 核数
--memoryinteger内存大小,单位 MB
--namestring模板名称
--network-configurationobject网络配置,使用 JSON 对象或 @file
--regionstringAlibaba Cloud region
--template-typestring模板类型
--allow-anonymous-manageboolean允许数据链路调用沙箱创建、停止和删除接口
--arms-configurationobjectARMS 配置,使用 JSON 对象或 @file
--container-configurationobject容器配置,使用 JSON 对象或 @file
--credential-configurationobject凭证配置,使用 JSON 对象或 @file
--descriptionstring模板描述
--disk-sizeinteger磁盘大小,单位 MB
--enable-agentboolean启用 Sandbox Agent
--enable-pre-stopboolean启用停止前处理
--environment-variablesobject环境变量,使用 JSON 对象或 @file
--execution-role-arnstring执行角色 ARN
--idle-timeoutinteger沙箱空闲超时时间,单位秒
--log-configurationobject日志配置,使用 JSON 对象或 @file
--nas-configobjectNAS 挂载配置,使用 JSON 对象或 @file
--oss-configurationobjectOSS 挂载配置项;每个挂载使用一个 JSON 对象或 @file,并重复指定该参数
--pre-stop-timeoutinteger停止前处理超时时间,单位秒
--scaling-configobject弹性配置,使用 JSON 对象或 @file
--template-configurationobject模板类型相关配置,使用 JSON 对象或 @file
--workspacestring工作空间 ID

update

ecctl agentrun template update <name> [flags]

更新 AgentRun 沙箱模板

  • 类型:mutation · 风险:medium
  • 同步:等待 READY(waiter ready_after_change,超时 600s);用 --no-wait 跳过等待。
  • 通过 clientToken 幂等。
API调用时机用途
UpdateTemplate每次执行命令时执行资源操作。
GetTemplate未指定 --no-wait轮询等待资源达到目标状态。(重复调用)
参数类型必填说明
--regionstringAlibaba Cloud region
--allow-anonymous-manageboolean允许数据链路调用沙箱创建、停止和删除接口
--arms-configurationobjectARMS 配置,使用 JSON 对象或 @file
--container-configurationobject容器配置,使用 JSON 对象或 @file
--cpunumberCPU 核数
--credential-configurationobject凭证配置,使用 JSON 对象或 @file
--descriptionstring模板描述
--enable-agentboolean启用 Sandbox Agent
--enable-pre-stopboolean启用停止前处理
--environment-variablesobject环境变量,使用 JSON 对象或 @file
--execution-role-arnstring执行角色 ARN
--idle-timeoutinteger沙箱空闲超时时间,单位秒
--log-configurationobject日志配置,使用 JSON 对象或 @file
--memoryinteger内存大小,单位 MB
--nas-configobjectNAS 挂载配置,使用 JSON 对象或 @file
--network-configurationobject网络配置,使用 JSON 对象或 @file
--oss-configurationobjectOSS 挂载配置项;每个挂载使用一个 JSON 对象或 @file,并重复指定该参数
--pre-stop-timeoutinteger停止前处理超时时间,单位秒
--scaling-configobject弹性配置,使用 JSON 对象或 @file
--template-configurationobject模板类型相关配置,使用 JSON 对象或 @file
--workspacestring工作空间 ID

delete

ecctl agentrun template delete <name> [flags]

删除 AgentRun 沙箱模板

  • 类型:mutation · 风险:high
  • 同步:等待 absent(waiter absent_after_delete,超时 300s);用 --no-wait 跳过等待。
API调用时机用途
DeleteTemplate每次执行命令时执行资源操作。
ListTemplates未指定 --no-wait轮询等待资源达到目标状态。(重复调用)
参数类型必填说明
--regionstringAlibaba Cloud region

get

ecctl agentrun template get <name> [flags]

获取 AgentRun 沙箱模板

  • 类型:read · 风险:low
API调用时机用途
GetTemplate每次执行命令时读取资源视图。
参数类型必填说明
--regionstringAlibaba Cloud region
--fieldsstring要包含的资源字段,使用逗号分隔

list

ecctl agentrun template list [flags]

列出 AgentRun 沙箱模板

  • 类型:read · 风险:low
API调用时机用途
ListTemplates每次执行命令时读取资源视图。
参数类型必填说明
--regionstringAlibaba Cloud region
--fieldsstring要包含的资源字段,使用逗号分隔
--filterkey_value过滤表达式 key=value
--limitinteger最多返回的模板数量(默认:100
--pageinteger返回结果页码(默认:1
--workspace-idsstringAgentRun 接受的工作空间 ID 列表过滤值

disable

ecctl agentrun template disable <name> [flags]

停用沙箱模板的 MCP 服务

  • 类型:mutation · 风险:medium
API调用时机用途
StopTemplateMCP每次执行命令时执行资源操作。
GetTemplate每次执行命令时读取资源视图。
参数类型必填说明
--regionstringAlibaba Cloud region

enable

ecctl agentrun template enable <name> [flags]

启用沙箱模板的 MCP 服务

  • 类型:mutation · 风险:medium
API调用时机用途
ActivateTemplateMCP每次执行命令时执行资源操作。
GetTemplate每次执行命令时读取资源视图。
参数类型必填说明
--regionstringAlibaba Cloud region
--enabled-toolsarray要启用的 MCP 工具
--transportstringMCP 传输协议