Creates a user snapshot from a normal and unexpired micro-sandbox session.
Operation description
Request description
This operation creates a user snapshot from the specified micro-sandbox session.
The optional
qualifierparameter identifies the valid alias or specific function version used when the source session was created. If omitted, the default value isLATEST.The
sessionIdparameter is required to specify the client session ID from which the snapshot is created.The
descriptionparameter is optional. If provided, it must not contain control characters and is limited to 256 UTF-8 bytes in length.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
fc:CreateSnapshot |
create |
*All Resource
|
None | None |
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 for which the snapshot is created. |
testHelloWorld |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| qualifier |
string |
No |
The alias of the function. |
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.