Skip to content

端点管理

endpoint 命令是进行智能体运行时端点操作的命令;主要包括端点的查看、发布、删除等功能。

命令解析

当执行命令 endpoint -h / endpoint --help 时,可以获取帮助文档。

endpoint list 命令

endpoint list 命令,是查看智能体运行时已创建的端点列表的命令。

当执行命令 endpoint list -h / endpoint list --help 时,可以获取帮助文档。

参数解析

当前命令支持部分全局参数(例如 -a/--access, --debug 等),详情可参考 Serverless Devs 全局参数文档

操作案例

  • 有资源描述文件(Yaml)时,可以直接执行 s endpoint list 查看当前智能体运行时所创建的端点列表;

上述命令的执行结果示例:

agentrun-endpoint-test:
  -
    name:        Default
    url:         https://xxxx.agentrun-data.cn-hangzhou.aliyuncs.com/agent-runtimes/test6/endpoints/Default/invocations
    traffic:     100% → LATEST
    status:      READY
    description: 默认
  -
    name:        Default
    url:         https://xxxx.agentrun-data.cn-hangzhou.aliyuncs.com/agent-runtimes/test6/endpoints/Default/invocations
    traffic:     100% → LATEST
    status:      READY
    description: 默认

endpoint get 命令

endpoint get 命令,是用于获取端点详情的命令。

当执行命令 endpoint get -h / endpoint get --help 时,可以获取帮助文档。

参数解析

参数全称 参数缩写 Yaml 模式下必填 参数含义
endpoint-name - 必填 端点名称

操作案例

  • 有资源描述文件(Yaml)时,可以直接执行 s endpoint get --endpoint-name production 获取端点详情;

endpoint publish 命令

endpoint publish 命令,是用于创建或更新端点的命令。

当执行命令 endpoint publish -h / endpoint publish --help 时,可以获取帮助文档。

参数解析

参数全称 参数缩写 Yaml 模式下必填 Cli 模式下必填 参数含义
endpoint-name - 选填 必填 端点名称
target-version - 选填 选填 目标版本(默认:LATEST)
canary-version - 选填 选填 灰度版本
weight - 选填 选填 灰度流量权重(0.0-1.0)
description - 选填 选填 端点描述

操作案例

  • 创建生产端点

    s endpoint publish --endpoint-name production --description "Production endpoint"
    

  • 创建灰度端点

    s endpoint publish --endpoint-name canary --canary-version 1 --weight 0.2 --description "Canary deployment"
    

endpoint remove 命令

endpoint remove 命令,是用于删除端点的命令。

当执行命令 endpoint remove -h / endpoint remove --help 时,可以获取帮助文档。

参数解析

参数全称 参数缩写 Yaml 模式下必填 Cli 模式下必填 参数含义
endpoint-name - 选填 必填 端点名称
assume-yes -y 选填 选填 自动确认删除

操作案例

  • 交互式删除

    s endpoint remove --endpoint-name staging
    

  • 自动确认删除

    s endpoint remove --endpoint-name staging -y
    

权限与策略说明

使用该命令时,推荐配置系统策略:AliyunAgentRunFullAccess