部署 deploy
更新时间 2025-09-15 12:04:47
最近更新时间: 2025-09-15 12:04:47
deploy命令将YAML文件描述的函数资源部署到函数计算。
参数解析
无。
操作案例
进入到资源描述文件(s.yaml)所在的路径,然后执行如下命令部署资源:
s deploy
s.yaml文件示例:
edition: 3.0.0
name: hello-devsapp
access: default
vars:
region: "bb9fdb42056f11eda1610242ac110002"
resources:
my-func:
component: faas-cf # 组件,提供具体的业务能力。faas-cf 组件提供了对天翼云Serverless函数的管理能力
props:
region: ${vars.region} # 部署的资源池,天翼云华东1资源池为 bb9fdb42056f11eda1610242ac110002
functionName: hello-world # 函数名称
code: ./code # 函数代码目录
createType: 1 # 函数类型:标准函数(1)、自定义函数(2)、容器函数(3)
runtime: # 函数运行配置
handleType: event # 处理事件请求(event)、处理HTTP请求(http)
handler: index.handler # 请求处理程序
runtime: python3.10 # 运行环境
executeTimeout: 64 # 执行超时时间
instanceConcurrency: 1 # 实例并发度
container: # 运行容器配置
memorySize: 512 # 内存规格,单位:MB
cpu: 0.5 # vCPU规格,单位vCPU
diskSize: 512 # 临时硬盘大小,单位:MB
timeZone: UTC # 时区,例如:UTC, Asia/Shanghai
执行完成输出示例:
functionId: 39061695070521915
code:
ossBucketName:
ossObjectName: function/******
snapshotOssObjectName:
zipFile:
container:
image: faas-******/python3.10-runtime:v1.3.1
timeZone: UTC
memorySize: 512
cpu: 0.5
diskSize: 512
runCommand: Li9ib290c3RyYXAuc2g=
listenPort: 8080
codeDirPath: /code
logLevel:
sysLogLevel: INFO
maxScale: null
minScale: null
fastStart: 0
functionName: hello-world
...