列出函数列表
list 命令是列出函数线上资源列表的命令。
命令解析
当执行命令list -h/list --help命令时,可以获取帮助文档。
参数解析
| 参数全称 | 参数缩写 | Yaml 模式下必填 | Cli 模式下必填 | 参数含义 |
|---|---|---|---|---|
| region | - | 选填 | 必填 | 地域名称,取值范围参见函数计算开服地域 |
当前命令还支持部分全局参数(例如
-a/--access,--debug等),详情可参考 Serverless Devs 全局参数文档
操作案例
- 有资源描述文件(Yaml)时,可以直接执行
s list获取函数列表; - 纯命令行形式(在没有资源描述 Yaml 文件时),需要根据需求,指定地域等信息,例如
s cli fc3 list --region cn-hangzhou -a default;
上述命令的执行结果示例:
region: cn-hangzhou
functions:
-
functionName: start-python-9fqu
functionId: 1039e868-dd7b-40ce-9ac1-4f04b730d16e
description: hello world by serverless devs
runtime: python3.9
handler: index.handler
memorySize: 128
timeout: 3
createdTime: 2023-09-25T03:24:28Z
lastModifiedTime: 2023-09-25T03:40:27Z
-
functionName: start-nodejs-v3
functionId: 2059e868-dd7b-40ce-9ac1-4f04b730d16e
description: hello world by serverless devs
runtime: nodejs14
handler: index.handler
memorySize: 128
timeout: 3
createdTime: 2023-09-25T04:24:28Z
lastModifiedTime: 2023-09-25T04:40:27Z
权限与策略说明
使用该命令时,推荐配置系统策略:AliyunFCReadOnlyAccess