You can use this operation to retrieve detailed information about a specific session, including its session ID, associated function, affinity type, lifecycle configuration, status, and instance details. This operation retrieves the current metadata for a session. You can identify the metadata precisely using either the function name or qualifier. This capability enables you to monitor and debug external systems with ease. Only sessions that are in the Active state can be queried.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| fc:GetSession | get | *All Resources * |
| none |
Request syntax
GET /2023-03-30/functions/{functionName}/sessions/{sessionId} HTTP/1.1
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| functionName | string | No | The name of the function to which the session belongs. | myFunction |
| sessionId | string | No | The session ID. | test-sessionid-index1 |
| qualifier | string | No | The function alias or version associated with the queried session ID. | aliasName1 |
Response parameters
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.
