aliyun-fc-agentrun

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Category: service
分类:服务

Function Compute AgentRun (OpenAPI)

Function Compute AgentRun (OpenAPI)

Use AgentRun OpenAPI (ROA) to manage runtimes, sandboxes, model services, memory, and credentials.
使用AgentRun OpenAPI(ROA)管理运行时、沙箱、模型服务、内存和凭证。

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).
  • 通过RAM用户获取AccessKey(遵循最小权限原则)。
  • 选择正确的区域端点(参见
    references/endpoints.md
    )。如果不确定,请选择最适合当前任务的区域,或询问用户。
  • 使用OpenAPI Explorer或官方SDK避免手动签名(ROA要求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.
  1. 选择区域端点(
    agentrun.cn-<region>.aliyuncs.com
    )。
  2. 创建运行时 → 发布版本 → 创建运行时端点。
  3. 按需创建沙箱/模板。
  4. 根据要求配置凭证和模型服务。
  5. 查询资源以排查故障。

API Groups

API分组

See
references/api_overview.md
for the full API list and grouping.
完整API列表和分组参见
references/api_overview.md

Script quickstart

脚本快速入门

bash
python skills/compute/fc/aliyun-fc-agentrun/scripts/quickstart.py
Environment variables:
  • AGENTRUN_ENDPOINT
  • ALICLOUD_ACCESS_KEY_ID
  • ALICLOUD_ACCESS_KEY_SECRET
  • OUTPUT_DIR
    (optional)
bash
python skills/compute/fc/aliyun-fc-agentrun/scripts/quickstart.py
环境变量:
  • AGENTRUN_ENDPOINT
  • ALICLOUD_ACCESS_KEY_ID
  • ALICLOUD_ACCESS_KEY_SECRET
  • OUTPUT_DIR
    (可选)

Runtime flow script

运行时流程脚本

bash
AGENTRUN_RUNTIME_NAME="my-runtime" \\
AGENTRUN_RUNTIME_ENDPOINT_NAME="my-runtime-endpoint" \\
python skills/compute/fc/aliyun-fc-agentrun/scripts/runtime_flow.py
Environment variables:
  • AGENTRUN_ENDPOINT
  • ALICLOUD_ACCESS_KEY_ID
  • ALICLOUD_ACCESS_KEY_SECRET
  • AGENTRUN_RUNTIME_NAME
  • AGENTRUN_RUNTIME_ENDPOINT_NAME
  • AGENTRUN_RUNTIME_DESC
    (optional)
  • OUTPUT_DIR
    (optional)
bash
AGENTRUN_RUNTIME_NAME="my-runtime" \\
AGENTRUN_RUNTIME_ENDPOINT_NAME="my-runtime-endpoint" \\
python skills/compute/fc/aliyun-fc-agentrun/scripts/runtime_flow.py
环境变量:
  • AGENTRUN_ENDPOINT
  • ALICLOUD_ACCESS_KEY_ID
  • ALICLOUD_ACCESS_KEY_SECRET
  • AGENTRUN_RUNTIME_NAME
  • AGENTRUN_RUNTIME_ENDPOINT_NAME
  • AGENTRUN_RUNTIME_DESC
    (可选)
  • OUTPUT_DIR
    (可选)

Cleanup script

清理脚本

bash
AGENTRUN_RUNTIME_ID="runtime-id" \\
AGENTRUN_RUNTIME_ENDPOINT_ID="endpoint-id" \\
python skills/compute/fc/aliyun-fc-agentrun/scripts/cleanup_runtime.py
Environment variables:
  • AGENTRUN_ENDPOINT
  • ALICLOUD_ACCESS_KEY_ID
  • ALICLOUD_ACCESS_KEY_SECRET
  • AGENTRUN_RUNTIME_ID
  • AGENTRUN_RUNTIME_ENDPOINT_ID
  • OUTPUT_DIR
    (optional)
bash
AGENTRUN_RUNTIME_ID="runtime-id" \\
AGENTRUN_RUNTIME_ENDPOINT_ID="endpoint-id" \\
python skills/compute/fc/aliyun-fc-agentrun/scripts/cleanup_runtime.py
环境变量:
  • AGENTRUN_ENDPOINT
  • ALICLOUD_ACCESS_KEY_ID
  • ALICLOUD_ACCESS_KEY_SECRET
  • AGENTRUN_RUNTIME_ID
  • AGENTRUN_RUNTIME_ENDPOINT_ID
  • OUTPUT_DIR
    (可选)

SDK Notes

SDK注意事项

See
references/sdk.md
for SDK acquisition guidance.
SDK获取指南参见
references/sdk.md

Output Policy

输出规则

If you store any generated files or responses, write them under:
output/compute-fc-agentrun/
.
如果需要存储任何生成的文件或响应,请写入以下路径:
output/compute-fc-agentrun/

Validation

验证

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 "py_compile_ok" > output/aliyun-fc-agentrun/validate.txt
Pass criteria: command exits 0 and
output/aliyun-fc-agentrun/validate.txt
is generated.
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 "py_compile_ok" > output/aliyun-fc-agentrun/validate.txt
通过标准:命令退出码为0,且生成
output/aliyun-fc-agentrun/validate.txt
文件。

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.
  • 将制品、命令输出和API响应摘要存储在
    output/aliyun-fc-agentrun/
    路径下。
  • 在证据文件中包含关键参数(区域/资源ID/时间范围)以保证可复现。

References

参考

  • API overview and operation list:
    references/api_overview.md
  • Regional endpoints:
    references/endpoints.md
  • SDK guidance:
    references/sdk.md
  • Source list:
    references/sources.md
  • API概览和操作列表:
    references/api_overview.md
  • 区域端点:
    references/endpoints.md
  • SDK指南:
    references/sdk.md
  • 源列表:
    references/sources.md