Category: service
Function Compute AgentRun (OpenAPI)
Use AgentRun OpenAPI (ROA) to manage runtimes, sandboxes, model services, memory, and credentials.
Prerequisites
- - AccessKey via RAM user (least privilege).
- Select the correct regional endpoint (see
references/endpoints.md). If unsure, choose the most reasonable region for the task or ask the user. - Use OpenAPI Explorer or official SDK to avoid manual signing (ROA requires SignatureV1).
Workflow
1) Choose region endpoint (agentrun.cn-<region>.aliyuncs.com).
2) Create runtime → publish version → create runtime endpoint.
3) Create sandbox/template if needed.
4) Configure credentials and model services as required.
5) Query resources for troubleshooting.
API Groups
See references/api_overview.md for the full API list and grouping.
Script quickstart
CODEBLOCK0
Environment variables:
- - INLINECODE3
- INLINECODE4
- INLINECODE5
- INLINECODE6 (optional)
Runtime flow script
CODEBLOCK1
Environment variables:
- - INLINECODE7
- INLINECODE8
- INLINECODE9
- INLINECODE10
- INLINECODE11
- INLINECODE12 (optional)
- INLINECODE13 (optional)
Cleanup script
CODEBLOCK2
Environment variables:
- - INLINECODE14
- INLINECODE15
- INLINECODE16
- INLINECODE17
- INLINECODE18
- INLINECODE19 (optional)
SDK Notes
See references/sdk.md for SDK acquisition guidance.
Output Policy
If you store any generated files or responses, write them under:
output/compute-fc-agentrun/.
Validation
CODEBLOCK3
Pass criteria: command exits 0 and output/aliyun-fc-agentrun/validate.txt is generated.
Output And Evidence
- - Save artifacts, command outputs, and API response summaries under
output/aliyun-fc-agentrun/. - Include key parameters (region/resource id/time range) in evidence files for reproducibility.
References
- - API overview and operation list: INLINECODE24
- Regional endpoints: INLINECODE25
- SDK guidance: INLINECODE26
- - Source list: INLINECODE27
类别:服务
函数计算 AgentRun(OpenAPI)
使用 AgentRun OpenAPI(ROA)管理运行时、沙箱、模型服务、内存和凭证。
前提条件
- - 通过 RAM 用户获取 AccessKey(最小权限原则)。
- 选择正确的区域端点(参见 references/endpoints.md)。如不确定,请选择最合理的区域或询问用户。
- 使用 OpenAPI Explorer 或官方 SDK 以避免手动签名(ROA 需要 SignatureV1)。
工作流程
1) 选择区域端点(agentrun.cn-.aliyuncs.com)。
2) 创建运行时 → 发布版本 → 创建运行时端点。
3) 按需创建沙箱/模板。
4) 按需配置凭证和模型服务。
5) 查询资源以进行故障排查。
API 分组
完整 API 列表及分组请参见 references/api_overview.md。
脚本快速入门
bash
python skills/compute/fc/aliyun-fc-agentrun/scripts/quickstart.py
环境变量:
- - AGENTRUNENDPOINT
- ALICLOUDACCESSKEYID
- ALICLOUDACCESSKEYSECRET
- OUTPUTDIR(可选)
运行时流程脚本
bash
AGENTRUNRUNTIMENAME=my-runtime \
AGENTRUNRUNTIMEENDPOINT_NAME=my-runtime-endpoint \
python skills/compute/fc/aliyun-fc-agentrun/scripts/runtime_flow.py
环境变量:
- - AGENTRUNENDPOINT
- ALICLOUDACCESSKEYID
- ALICLOUDACCESSKEYSECRET
- AGENTRUNRUNTIMENAME
- AGENTRUNRUNTIMEENDPOINTNAME
- AGENTRUNRUNTIMEDESC(可选)
- OUTPUT_DIR(可选)
清理脚本
bash
AGENTRUNRUNTIMEID=runtime-id \
AGENTRUNRUNTIMEENDPOINT_ID=endpoint-id \
python skills/compute/fc/aliyun-fc-agentrun/scripts/cleanup_runtime.py
环境变量:
- - AGENTRUNENDPOINT
- ALICLOUDACCESSKEYID
- ALICLOUDACCESSKEYSECRET
- AGENTRUNRUNTIMEID
- AGENTRUNRUNTIMEENDPOINTID
- OUTPUT_DIR(可选)
SDK 说明
SDK 获取指南请参见 references/sdk.md。
输出策略
如需存储生成的任何文件或响应,请写入以下目录:
output/compute-fc-agentrun/。
验证
bash
mkdir -p output/aliyun-fc-agentrun
for f in skills/compute/fc/aliyun-fc-agentrun/scripts/*.py; do
python3 -m py_compile $f
done
echo pycompileok > output/aliyun-fc-agentrun/validate.txt
通过标准:命令退出码为 0 且已生成 output/aliyun-fc-agentrun/validate.txt 文件。
输出与证据
- - 将产物、命令输出和 API 响应摘要保存至 output/aliyun-fc-agentrun/ 目录。
- 在证据文件中包含关键参数(区域/资源 ID/时间范围)以确保可重现性。
参考资料
- - API 概览与操作列表:references/api_overview.md
- 区域端点:references/endpoints.md
- SDK 指南:references/sdk.md
- - 来源列表:references/sources.md