All Products
Search
Document Center

Function Compute:UpdateSession

最終更新日:Dec 19, 2025

Updates session configurations while the session is in the Active state, such as lifecycle parameters (e.g., SessionTTLInSeconds and SessionIdleTimeoutInSeconds). After the update takes effect, LastModifiedTime is automatically refreshed. These updates can be used to extend or shorten the validity period of a session and enable dynamic management without changing the execution environment bound to the session.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request syntax

PUT /2023-03-30/functions/{functionName}/sessions/{sessionId} HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
functionNamestringNo

The name of the function to which the session belongs.

my-func
sessionIdstringNo

The ID of the session to be updated.

test-sessionid-1
qualifierstringNo

The function alias or version associated with the session to be updated.

aliasName1
bodyUpdateSessionInputNo

The session update configuration.

Response parameters

ParameterTypeDescriptionExample
Session

The updated session information.

Examples

Sample success responses

JSONformat

{
  "sessionId": "81f70ae156904eb9b7d43e12f511fe58",
  "functionName": "functionName1",
  "sessionAffinityType": "HEADER_FIELD",
  "sessionTTLInSeconds": 21600,
  "sessionIdleTimeoutInSeconds": 1800,
  "createdTime": "2025-04-01T08:15:27Z",
  "lastModifiedTime": "2025-04-01T18:15:27Z",
  "sessionStatus": "Active",
  "containerId": "c-68999e02-16a1955c-d2a03d1ccs",
  "qualifier": "AliasName1",
  "nasConfig": {
    "groupId": 100,
    "mountPoints": [
      {
        "enableTLS": true,
        "mountDir": "/home/test",
        "serverAddr": "***-uni85.cn-hangzhou.nas.com:/"
      }
    ],
    "userId": 100
  }
}

Error codes

For a list of error codes, visit the Service error codes.