You need to enable JavaScript to run this app.
Volcano Engine Function as a Service

Volcano Engine Function as a Service

Copy page
Download PDF
Sandbox instances
CreateSandbox
Copy page
Download PDF
CreateSandbox
Create sandbox instances.​
Request description​
  • Request method: POST​
  • Request URL: http://open.volcengineapi.com/?Action=CreateSandbox&Version=2024-06-06​
Debugging​
API Explorer
You can initiate calls online through API Explorer without paying attention to the signature generation process and quickly obtain the call results.
​
Request parameters​
​
Parameter​
Type​
Required​
Sample value​
Description​
Action​
String​
Yes​
CreateSandbox​
Interface name. The name of the current API is CreateSandbox.​
Version​
String​
Yes​
2024-06-06​
Interface version. The version of the current API is 2024-06-06.​
FunctionId​
String​
Yes​
wrws****​
The ID of the sandbox application to which sandbox instances belong.​
To obtain sandbox application IDs, you can go to Volcano Engine Function as a Service (veFaaS) console > Cloud sandbox > Sandbox application page.​
Timeout​
Integer​
No​
60​
The lifetime of sandbox instances:​
  • Unit: minutes​
  • Value range: 3–1440​
  • Default value: 60​
Metadata​
JSON Map​
No​
{"app":"test"}​
The metadata of the sandbox instance label, which is used to mark and filter instances. The format is <"key":"value">.​
InstanceTosMountConfig​
No​
-​
Torch Object Storage (TOS) mount configuration of the sandbox instance.​
warning​
  • If you need to include this parameter in requests, ensure TOS storage has been mounted to the sandbox application to which the instance belongs.​
  • Sandbox instances can mount the subdirectories of TOS buckets based on TOS mount configuration of the sandbox application.​
Envs​
Array of EnvVar​
No​
-​
Environment variables for sandbox instances.​
InstanceImageInfo​
Object of InstanceImageInfo​
No​
-​
Image information of sandbox instances, including image address, start command, and listening port.​
CpuMilli​
Integer​
No​
1,000​
CPU specification of the sandbox instance :​
  • Unit: milliCPU​
  • Value range: 250–16000​
  • Default value: 1000​
MemoryMB​
Integer​
No​
2048​
The memory specification of a sandbox instance:​
  • Unit: MiB​
  • Value range: 512–131072​
  • Default value: 2048​
MaxConcurrency​
Integer​
No​
100​
Maximum concurrent requests per instance:​
  • Value range: 10–1000​
  • Default value: 100​
RequestTimeout​
Integer​
No​
30​
Request timeout period:​
  • Unit: seconds​
  • Value range: positive integers from 1 to 900​
  • Default value: 30​
​
InstanceTosMountConfig​
​
Parameter​
Type​
Required​
sample value​
Description​
Enable​
Boolean​
Yes​
true​
Whether to enable TOS mount for sandbox instances​
  • true: Yes​
  • false: No​
TosMountPoints​
Array of TosMountPoint​
Yes​
-​
The detailed information of TOS mount directory used by sandbox instances.​
​
EnvVar​
​
parameter​
Type​
Required​
Sample value​
Description​
Key​
String​
Yes​
business_type​
Keys for sandbox instance environment variables.​
Value​
String​
Yes​
free​
The value of the environment variable for the sandbox instance.​
​
InstanceImageInfo​
​
Parameter​
Type​
Required​
Sample value​
Description​
Id​
String​
No​
xGWv9****​
ID of the preheated image used by the sandbox instance.​
Port​
Integer​
Yes​
8,080​
Listening port of the sandbox instance.​
​
warning​
Note that these ports are already occupied by veFaaS: 9000,9001,9990.​
Image​
String​
No​
cr-vefaas-cn-beijing.cr.volces.com/wdf/test/****:latest​
The address of the preheated image used by sandbox instances.​
Command​
String​
Yes​
bash /root/sandbox/scripts/run.sh​
The start command for the sandbox instance. If you need to execute a script file instead, ensure entering an absolute path and the script file has execute permission.​
​
TosMountPoint​
​
Parameter​
Type​
Required​
Sample value​
Description​
BucketPath​
String​
Yes​
/sandbox​
The remote TOS directory mounted to the sandbox instance.​
LocalMountPath​
String​
Yes​
/mnt/tos​
The local directory of the TOS storage bucket mounted to the sandbox instance.​
If this directory is the local mount directory for TOS storage configured in the sandbox application, the system will modify TOS BucketPath accordingly.​
​
Sample requests​
​
POST http://open.volcengineapi.com/?Action=CreateSandbox&Version=2024-06-06 HTTP/1.1​
Content-Type: application/json​
{​
"FunctionId": "wrws****",​
"Timeout": 60,​
"Metadata": {​
"app": "test"​
},​
"InstanceTosMountConfig": {​
"Enable": true,​
"TosMountPoints": [​
{​
"BucketPath": "/sandbox",​
"LocalMountPath": "/mnt/tos"​
}​
]​
},​
"Envs": [​
{​
"Key": "business_type",​
"Value": "free"​
}​
],​
"InstanceImageInfo": {​
"Id": "xGWv****",​
"Port": 8080,​
"Image": "cr-vefaas-cn-beijing.cr.volces.com/wdf/test/****:latest",​
"Command": "bash /root/sandbox/scripts/run.sh"​
},​
"CpuMilli": 500,​
"MemoryMB": 1024,​
"MaxConcurrency": 20,​
"RequestTimeout": 30​
}
​
Response parameters​
​
Parameter​
Type​
Sample value​
Description​
SandboxId​
String​
vefaas-e8m6xarn-p2zamuv2fr-******​
The ID, which is also the name of the sandbox instance.​
​
Sample response​
​
HTTP/1.1 200 OK​
Content-Type: application/json​
{​
"ResponseMetadata": {​
"RequestId": "20230604110420****100232280022D31",​
"Action": "CreateSandbox",​
"Version": "2024-06-06",​
"Service": "vefaas",​
"Region": "cn-beijing"​
},​
"Result": {​
"SandboxId": "vefaas-e8m6xarn-p2zamuv2fr-******"​
}​
}
​
Error codes​
There is no error code dedicated to this interface currently. If you encounter an exception when calling the interface, you can refer to Public error codes for troubleshooting.​
Last updated: 2025.09.22 15:28:02