v32

latestOpenAPI 3.1.0raw.githubusercontent.com2026-05-151,1412,2144.5 MB
Function as a Service

Update function

Update the configuration of an existing function. Only specified fields will be modified.

patch/cloud/v1/faas/namespaces/{project_id}/{region_id}/{namespace_name}/functions/{function_name}

Path parameters

project_idinteger required

Project ID

Example:1

Project ID

region_idinteger required

Region ID

Example:1

Region ID

namespace_namestring required

Namespace name

Example:namespace-name

Namespace name

function_namestring required

Function name

Example:function-name

Function name

Request body

code_textstring nullable

Function code text.

dependenciesstring nullable

Dependencies for the function to install.

descriptionstring nullable

Description of the function.

disabledboolean nullable

Set to true if the function is disabled.

enable_api_keyboolean nullable

Enable or disable API key authentication. Enable api key is temporarily disabled. As a result, using Functions with authorization is currently not supported.

envsobject nullable

Environment variables for the function. Keys must match a specific regex pattern and be 1-255 characters long, and values must be 0-255 characters long.

flavorstring nullable

The name of the flavor associated with the function.

keysstring[] nullable

List of used authentication API keys, matching a specific regex pattern.

main_methodstring nullable

The main startup method name.

timeoutinteger nullable

Function timeout in seconds.

Example request

{
  "autoscaling": {
    "max_instances": 5,
    "min_instances": 1
  },
  "code_text": "def main():\n    return 'Hello World'",
  "dependencies": "numpy==1.21.0\npandas==1.3.0",
  "description": "This is a sample function.",
  "enable_api_key": true,
  "envs": {
    "ENV_VAR": "value"
  },
  "flavor": "128m-128MB",
  "keys": [
    "key1",
    "key2"
  ],
  "main_method": "run",
  "timeout": 60
}

Response

OK

tasksstring[] required

List of task IDs representing asynchronous operations. Use these IDs to monitor operation progress:

  • GET /v1/tasks/{task_id} - Check individual task status and details Poll task status until completion (FINISHED/ERROR) before proceeding with dependent operations.
idstring required

Example response

{
  "tasks": [
    "d478ae29-dedc-4869-82f0-96104425f565"
  ]
}