UpdateFunctionInput

更新时间:
复制 MD 格式

Parameter

Type

Description

Example

object

The request parameters for updating a function.

code InputCodeLocation

The ZIP package that contains the function's code. You must specify either code or customContainerConfig.

cpu

number

The CPU specification for the function, in vCPUs. The value must be a multiple of 0.05.

1

customContainerConfig CustomContainerConfig

The configuration for the custom container runtime. If you configure this parameter, the function uses a custom container image for execution. You must specify either code or customContainerConfig.

customDNS CustomDNS

The custom DNS configuration.

customRuntimeConfig CustomRuntimeConfig

The configuration for the custom runtime.

description

string

A description of the function.

my function

diskSize

integer

The disk size for the function, in megabytes (MB). Valid values are 512 and 10,240.

512

environmentVariables

object

The environment variables that are available to the function at runtime.

string

value1

gpuConfig GPUConfig

The GPU configuration for the function.

handler

string

The function handler, which is the entry point for execution. The format varies by runtime.

index.handler

instanceConcurrency

integer

The maximum number of concurrent requests that a single function instance can process.

1

instanceLifecycleConfig InstanceLifecycleConfig

The configuration for instance lifecycle hooks.

internetAccess

boolean

Specifies whether the function can access the internet.

true

layers

array

A list of layer ARNs to apply to the function. Files in a layer with a lower array index overwrite files with the same name from a layer with a higher array index.

string

The layer ARN.

acs:fc:cn-beijing:186824xxxxxx:layers/fc_layer/versions/1

logConfig LogConfig

The logging configuration. Function-generated logs are written to the specified Logstore.

memorySize

integer

The memory size for the function, in megabytes (MB). The value must be a multiple of 64. The available memory options depend on the function's instance type.

512

nasConfig NASConfig

The NAS configuration. This allows the function to access specified NAS resources.

ossMountConfig OSSMountConfig

The OSS mount configuration.

role

string

The ARN of the RAM role that Function Compute assumes to get permissions to access other cloud services. For example, Function Compute requires permissions to write function logs to your Logstore or to obtain an STS token for the function to access other services.

acs:ram::188077086902****:role/fc-test

runtime

string

The function's runtime.

nodejs14

timeout

integer

The execution timeout for the function, in seconds. The value must be at least 1. The default is 3. If the timeout is reached, Function Compute terminates the execution.

60

tracingConfig TracingConfig

The tracing configuration. This allows you to record request latency, view function cold start time, and trace time spent on code execution.

vpcConfig VPCConfig

The VPC configuration. This allows the function to access resources in the specified VPC.

disableOndemand

boolean

Specifies whether to disable on-demand instances for the function. If set to true, Function Compute will only use provisioned instances to run the function.

sessionAffinity

string

The session affinity policy for function invocation requests. Use MCP_SSE for MCP SSE protocol affinity, GENERATED_COOKIE for cookie-based affinity, or HEADER_FIELD for header-based affinity. If unspecified or set to NONE, Function Compute uses the default scheduling policy.

MCP_SSE

enableLongLiving

boolean

Specifies whether to enable long-living provisioned instances for GPU-accelerated functions. If this feature is enabled, Function Compute does not inject an STS token into the function instances.

instanceIsolationMode

string

The instance isolation mode.

sessionAffinityConfig

string

The configuration for the specified sessionAffinity policy, provided as a JSON string. The object structure within the string depends on the policy. For example, use an MCPSSESessionAffinityConfig object for MCP_SSE affinity, a CookieSessionAffinityConfig object for cookie-based affinity, or a HeaderFieldSessionAffinityConfig object for header-based affinity.

{\"sseEndpointPath\":\"/sse\", \"sessionConcurrencyPerInstance\":20}

idleTimeout

integer

The idle timeout for the function instance, in seconds. An instance is terminated after being idle for this duration.

100

disableInjectCredentials

string

Specifies whether to disable STS token injection. Valid values:
None: The token is injected into all locations.
Env: The token is not injected into environment variables.
Request: The token is not injected into the request context or header.
All: The token is not injected into any location.



polarFsConfig PolarFsConfig

The PolarFS configuration. This allows the function to access specified PolarFS resources.

juiceFsConfig JuiceFsConfig

The JuiceFS configuration. This allows the function to access specified JuiceFS resources.