Creates a user snapshot from a normal and unexpired micro-sandbox session.
Operation description
Operation description
This API operation creates a user snapshot from a specified micro-sandbox session.
The optional parameter
qualifieridentifies the valid alias or specific function version used when creating the source session. If omitted, it defaults toLATEST.The
sessionIdparameter is required to specify the client session ID from which to create the snapshot.The
descriptionparameter is optional. If provided, it cannot contain control characters and is limited to 256 UTF-8 bytes.
Try it now
Test
RAM authorization
Request syntax
POST /2023-03-30/functions/{functionName}/snapshots HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| functionName |
string |
Yes |
The name of the function from which to create the snapshot. |
testHelloWorld |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| qualifier |
string |
No |
The function alias. |
alias |
| body | CreateSnapshotInput |
No |
The request body for creating a snapshot. |
Response elements
|
Element |
Type |
Description |
Example |
| Snapshot |
The snapshot resource information. |
Examples
Success response
JSON format
{
"snapshotId": "550e8400-e29b-41d4-a716-446655440000",
"status": "Available",
"createdTime": "2026-07-30T10:00:00Z",
"expiredTime": "2026-08-29T10:00:00Z",
"description": "Snapshot for production environment",
"sourceSessionId": "custom-test-session-id",
"functionName": "my-function",
"qualifier": "production",
"resolvedVersion": "1",
"imageRepository": "registry-vpc.cn-hangzhou.aliyuncs.com/example/function",
"imageDigest": "sha256:0123456789abcdef",
"osType": "linux",
"memoryMB": 3072,
"cpu": 2,
"diskSizeMB": 10240,
"artifactMemUsedSizeInB": 1073741824,
"artifactDiskUsedSizeInB": 2147483648,
"startCommand": "/code/start.sh",
"readyCommand": "/code/ready.sh",
"envs": {
"key": ""
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.