UpdateFunction
更新函数信息
服务地址:
华东1 金融云
输入参数
只看必填
If-Match用于确保实际更改的资源和期望更改的资源...
serviceName服务名称
functionName函数名称
functionUpdateFields更新函数结构体
code函数代码
ossBucketName存放函数代码ZIP包的OSS Buck...
ossObjectName存放函数代码ZIP包的OSS Obje...
zipFile函数代码ZIP包的Base 64编码
customContainerConfig自定义容器相关函数配置
args容器启动参数
command容器启动命令
image容器镜像地址
accelerationType是否开启镜像加速
instanceIDACR企业版镜像仓库ID
webServerMode镜像运行是否为Web Server模式
请选择布尔值
layers层的列表
0层资源的名称
description函数描述
environmentVariables为函数设置的环境变量
:
handler函数执行的入口
memorySize函数的内存规格
runtime函数运行的语言环境
timeout函数运行的超时时间
initializationTimeout初始化函数运行的超时时间
initializer初始化函数执行的入口
caPort自定义、自定义容器运行时HTTP Se...
InstanceConcurrency实例最大并发度
instanceSoftConcurrency实例软并发度
instanceType函数的实例类型
instanceLifecycleConfig实例生命周期函数配置
preFreeze生命周期函数配置
handler函数执行的入口
timeout运行的超时时间
preStop生命周期函数配置
handler函数执行的入口
timeout运行的超时时间
customDNS函数自定义DNS配置
nameServersDNS服务器的IP地址列表
0DNS服务器的IP地址
searchesDNS搜索域列表
0DNS搜索域值
dnsOptionsresolv.conf文件中的配置项列表
0DNS解析器配置
name配置项名称
value配置项值
customRuntimeConfigCustom Runtime函数详细配置
commandCustom Runtime启动的自定...
0容器启动命令
argsCustom Runtime启动命令接...
0容器启动参数
customHealthCheckConfigCustom Runtime和Cust...
httpGetUrl容器自定义健康检查URL地址
initialDelaySeconds容器启动到发起健康检查的延迟
periodSeconds健康检查周期
timeoutSeconds健康检查超时时间
failureThreshold健康检查失败次数阈值
successThreshold健康检查成功次数阈值
cpu函数的CPU规格
diskSize函数的磁盘规格
gpuMemorySizefunction的GPU显存规格
X-Fc-Account-Id您的阿里云账号(主账号)ID
X-Fc-Code-Checksum函数代码包的CRC-64值
X-Fc-Date函数的调用开始日期
X-Fc-Trace-Id调用函数的ID
插件下载了解更多
VS Code 插件
安装插件之前,确保已安装 VS Code安装插件之前,确保已安装 VS Code
Alibaba Cloud Developer Toolkit is a collection of extensions that can help access Alibaba Cloud services in Visual Studio Code.
JetBrains 插件
安装插件之前,确保已安装 JetBrains IDE安装插件之前,确保已安装 JetBrains IDE
The Alibaba Cloud Developer Toolkit for JetBrains makes it easier to access Alibaba Cloud services.

请求语法

PUT /2021-04-06/services/{serviceName}/functions/{functionName} HTTP/1.1

路径参数

字段名称字段详情
serviceNamestring

服务名称。

示例值:demoService参考取值来源:
    UpdateService
    CreateService
    ListServices
functionNamestring

函数名称。

示例值:demoFunction参考取值来源:
    CreateFunction
    ListFunctions
    PutFunctionAsyncInvokeConfig

请求参数

字段名称字段详情
If-Matchstring

用于确保实际更改的资源和期望更改的资源是一致的,该值来自 CreateFunctionGetFunctionUpdateFunction 的响应。

示例值:e19d5cd5af0378da05f63f891c7467af
functionUpdateFieldsobject

更新函数结构体。

X-Fc-Account-Idstring

您的阿里云账号(主账号)ID。

示例值:188077086902****
X-Fc-Code-Checksumstring

函数代码包的 CRC-64 值。

示例值:1506052139770049xxxx
X-Fc-Datestring

函数的调用开始日期,格式为EEE,d MMM yyyy HH:mm:ss GMT

示例值:Wed, 11 May 2022 09:00:00 GMT
X-Fc-Trace-Idstring

调用函数的 ID,与返回参数 requestId 对应。

示例值:test-trace-id

返回参数

字段名称字段详情
codeChecksumstring

函数代码包的 CRC64 值。

示例值:5434025278388143772
codeSizeinteger<int64>

系统返回的函数代码包的大小,单位为 Byte。

注意 请注意,该值为 Long 类型,在某些语言中可能存在精度丢失的风险,请小心使用。
示例值:1024
createdTimestring

函数创建时间。

示例值:2016-08-15T15:00:00.000+0000
customContainerConfigCustomContainerConfig

自定义容器相关函数配置。

layersarray<string>

层的列表。展开详情

descriptionstring

函数描述。

示例值:This is a demo hello world function
environmentVariablesmap<string>

为函数设置的环境变量,可以在函数中获取环境变量的值。更多信息,请参见环境变量

functionIdstring

系统为每个函数生成的唯一 ID。

示例值:2d28e0e9-9ba5-4eed-8b1a-d3d9cd24****
functionNamestring

函数名称。

示例值:demo-function
handlerstring

函数的执行入口。

示例值:index.handler
lastModifiedTimestring

函数上次修改时间。

示例值:2016-08-15T17:00:00.000+0000
memorySizeinteger<int32>

函数设置的内存大小,单位为 MB。

示例值:512
runtimestring

函数运行的语言环境。目前支持 nodejs20nodejs18nodejs16nodejs14nodejs12nodejs10nodejs8nodejs6nodejs4.4python3.10python3.9python3python2.7java11java8go1php7.2dotnetcore3.1dotnetcore2.1custom.debian10customcustom-container。更多信息,请参见支持的函数运行环境列表

示例值:python3.9
timeoutinteger<int32>

运行的超时时间,单位为秒。

示例值:10
initializationTimeoutinteger<int32>

初始化函数运行的超时时间,单位为秒,最小 1 秒,默认 3 秒。初始化函数超过这个时间后会被终止执行。

示例值:60
initializerstring

初始化函数执行的入口,具体格式和语言相关。

示例值:index.handler
caPortinteger<int32>

Custom Runtime 或 Custom Container 运行时 HTTP Server 的监听端口。

示例值:9000
instanceTypestring

函数的实例类型,取值如下:展开详情

示例值:e1
instanceSoftConcurrencyinteger<int32>

实例软并发度,用于优雅扩容。当实例上的并发数超过软并发度时,会触发实例扩容。例如,您的实例启动较慢,可以通过设置合适的软实例并发度,提前启动实例。展开详情

示例值:5
instanceLifecycleConfigInstanceLifecycleConfig

实例生命周期函数配置。

customDNSCustomDNS

函数自定义 DNS 配置。

customRuntimeConfigCustomRuntimeConfig

Custom Runtime 函数详细配置。

customHealthCheckConfigCustomHealthCheckConfig

Custom Runtime 和 Custom Container 自定义健康检查配置。

cpunumber<float>

函数的 CPU 规格,单位为 vCPU,为 0.05 vCPU 的倍数。

示例值:1.5
diskSizeinteger<int32>

函数的磁盘规格,单位为 MB,可选值为 512 MB 或 10240 MB。

示例值:512
instanceConcurrencyinteger<int32>

单个实例的并发度。

示例值:10
gpuMemorySizeinteger<int32>

function 的 GPU 显存规格,单位为 MB,为 1024MB 的倍数

示例值:2048
layersArnV2array<string>

层的 arn 列表

变更历史
变更时间变更内容概要操作
2023-07-27
变更返回参数
2023-07-27
变更返回参数
2023-06-29
变更返回参数
2022-12-22
变更请求参数functionUpdateFields
变更返回参数
2022-09-16
变更请求参数serviceName
变更请求参数functionName
  • 1
  • 2
  • 10 条/页