curl --request POST \
--url https://cloud-api.phala.com/api/v1/cvms/provision \
--header 'Content-Type: application/json' \
--data '
{
"compose_file": {
"name": "<string>",
"allowed_envs": [
"<string>"
],
"bash_script": "<string>",
"default_gateway_domain": "<string>",
"docker_compose_file": "<string>",
"init_script": "<string>",
"kms_enabled": true,
"local_key_provider_enabled": false,
"manifest_version": 2,
"no_instance_id": false,
"pre_launch_script": "<string>",
"public_logs": true,
"public_sysinfo": true,
"public_tcbinfo": true,
"runner": "docker-compose",
"gateway_enabled": true,
"features": [
"kms",
"tproxy-net"
],
"salt": "<string>",
"secure_time": false,
"storage_fs": "zfs",
"tproxy_enabled": true
},
"name": "<string>",
"instance_type": "<string>",
"vcpu": 123,
"memory": 123,
"disk_size": 123,
"image": "<string>",
"prefer_dev": true,
"teepod_id": 123,
"region": "<string>",
"listed": true,
"kms_id": "<string>",
"kms": "phala",
"nonce": 123,
"app_id": "<string>",
"env_keys": [
"<string>"
],
"ports": [
{
"protocol": "<string>",
"host_port": 123,
"vm_port": 123,
"host_address": "<string>"
}
],
"encrypted_env": "<string>",
"user_config": "<string>",
"hugepages": false,
"pin_numa": false,
"gpus": {
"gpus": [
{
"slot": "<string>",
"product_id": "<string>"
}
],
"attach_mode": "listed"
},
"kms_urls": [
"<string>"
],
"gateway_urls": [
"<string>"
],
"experimental_vpc_server_app_id": "<string>"
}
'import requests
url = "https://cloud-api.phala.com/api/v1/cvms/provision"
payload = {
"compose_file": {
"name": "<string>",
"allowed_envs": ["<string>"],
"bash_script": "<string>",
"default_gateway_domain": "<string>",
"docker_compose_file": "<string>",
"init_script": "<string>",
"kms_enabled": True,
"local_key_provider_enabled": False,
"manifest_version": 2,
"no_instance_id": False,
"pre_launch_script": "<string>",
"public_logs": True,
"public_sysinfo": True,
"public_tcbinfo": True,
"runner": "docker-compose",
"gateway_enabled": True,
"features": ["kms", "tproxy-net"],
"salt": "<string>",
"secure_time": False,
"storage_fs": "zfs",
"tproxy_enabled": True
},
"name": "<string>",
"instance_type": "<string>",
"vcpu": 123,
"memory": 123,
"disk_size": 123,
"image": "<string>",
"prefer_dev": True,
"teepod_id": 123,
"region": "<string>",
"listed": True,
"kms_id": "<string>",
"kms": "phala",
"nonce": 123,
"app_id": "<string>",
"env_keys": ["<string>"],
"ports": [
{
"protocol": "<string>",
"host_port": 123,
"vm_port": 123,
"host_address": "<string>"
}
],
"encrypted_env": "<string>",
"user_config": "<string>",
"hugepages": False,
"pin_numa": False,
"gpus": {
"gpus": [
{
"slot": "<string>",
"product_id": "<string>"
}
],
"attach_mode": "listed"
},
"kms_urls": ["<string>"],
"gateway_urls": ["<string>"],
"experimental_vpc_server_app_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
compose_file: {
name: '<string>',
allowed_envs: ['<string>'],
bash_script: '<string>',
default_gateway_domain: '<string>',
docker_compose_file: '<string>',
init_script: '<string>',
kms_enabled: true,
local_key_provider_enabled: false,
manifest_version: 2,
no_instance_id: false,
pre_launch_script: '<string>',
public_logs: true,
public_sysinfo: true,
public_tcbinfo: true,
runner: 'docker-compose',
gateway_enabled: true,
features: ['kms', 'tproxy-net'],
salt: '<string>',
secure_time: false,
storage_fs: 'zfs',
tproxy_enabled: true
},
name: '<string>',
instance_type: '<string>',
vcpu: 123,
memory: 123,
disk_size: 123,
image: '<string>',
prefer_dev: true,
teepod_id: 123,
region: '<string>',
listed: true,
kms_id: '<string>',
kms: 'phala',
nonce: 123,
app_id: '<string>',
env_keys: ['<string>'],
ports: [{protocol: '<string>', host_port: 123, vm_port: 123, host_address: '<string>'}],
encrypted_env: '<string>',
user_config: '<string>',
hugepages: false,
pin_numa: false,
gpus: {gpus: [{slot: '<string>', product_id: '<string>'}], attach_mode: 'listed'},
kms_urls: ['<string>'],
gateway_urls: ['<string>'],
experimental_vpc_server_app_id: '<string>'
})
};
fetch('https://cloud-api.phala.com/api/v1/cvms/provision', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cloud-api.phala.com/api/v1/cvms/provision",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'compose_file' => [
'name' => '<string>',
'allowed_envs' => [
'<string>'
],
'bash_script' => '<string>',
'default_gateway_domain' => '<string>',
'docker_compose_file' => '<string>',
'init_script' => '<string>',
'kms_enabled' => true,
'local_key_provider_enabled' => false,
'manifest_version' => 2,
'no_instance_id' => false,
'pre_launch_script' => '<string>',
'public_logs' => true,
'public_sysinfo' => true,
'public_tcbinfo' => true,
'runner' => 'docker-compose',
'gateway_enabled' => true,
'features' => [
'kms',
'tproxy-net'
],
'salt' => '<string>',
'secure_time' => false,
'storage_fs' => 'zfs',
'tproxy_enabled' => true
],
'name' => '<string>',
'instance_type' => '<string>',
'vcpu' => 123,
'memory' => 123,
'disk_size' => 123,
'image' => '<string>',
'prefer_dev' => true,
'teepod_id' => 123,
'region' => '<string>',
'listed' => true,
'kms_id' => '<string>',
'kms' => 'phala',
'nonce' => 123,
'app_id' => '<string>',
'env_keys' => [
'<string>'
],
'ports' => [
[
'protocol' => '<string>',
'host_port' => 123,
'vm_port' => 123,
'host_address' => '<string>'
]
],
'encrypted_env' => '<string>',
'user_config' => '<string>',
'hugepages' => false,
'pin_numa' => false,
'gpus' => [
'gpus' => [
[
'slot' => '<string>',
'product_id' => '<string>'
]
],
'attach_mode' => 'listed'
],
'kms_urls' => [
'<string>'
],
'gateway_urls' => [
'<string>'
],
'experimental_vpc_server_app_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cloud-api.phala.com/api/v1/cvms/provision"
payload := strings.NewReader("{\n \"compose_file\": {\n \"name\": \"<string>\",\n \"allowed_envs\": [\n \"<string>\"\n ],\n \"bash_script\": \"<string>\",\n \"default_gateway_domain\": \"<string>\",\n \"docker_compose_file\": \"<string>\",\n \"init_script\": \"<string>\",\n \"kms_enabled\": true,\n \"local_key_provider_enabled\": false,\n \"manifest_version\": 2,\n \"no_instance_id\": false,\n \"pre_launch_script\": \"<string>\",\n \"public_logs\": true,\n \"public_sysinfo\": true,\n \"public_tcbinfo\": true,\n \"runner\": \"docker-compose\",\n \"gateway_enabled\": true,\n \"features\": [\n \"kms\",\n \"tproxy-net\"\n ],\n \"salt\": \"<string>\",\n \"secure_time\": false,\n \"storage_fs\": \"zfs\",\n \"tproxy_enabled\": true\n },\n \"name\": \"<string>\",\n \"instance_type\": \"<string>\",\n \"vcpu\": 123,\n \"memory\": 123,\n \"disk_size\": 123,\n \"image\": \"<string>\",\n \"prefer_dev\": true,\n \"teepod_id\": 123,\n \"region\": \"<string>\",\n \"listed\": true,\n \"kms_id\": \"<string>\",\n \"kms\": \"phala\",\n \"nonce\": 123,\n \"app_id\": \"<string>\",\n \"env_keys\": [\n \"<string>\"\n ],\n \"ports\": [\n {\n \"protocol\": \"<string>\",\n \"host_port\": 123,\n \"vm_port\": 123,\n \"host_address\": \"<string>\"\n }\n ],\n \"encrypted_env\": \"<string>\",\n \"user_config\": \"<string>\",\n \"hugepages\": false,\n \"pin_numa\": false,\n \"gpus\": {\n \"gpus\": [\n {\n \"slot\": \"<string>\",\n \"product_id\": \"<string>\"\n }\n ],\n \"attach_mode\": \"listed\"\n },\n \"kms_urls\": [\n \"<string>\"\n ],\n \"gateway_urls\": [\n \"<string>\"\n ],\n \"experimental_vpc_server_app_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cloud-api.phala.com/api/v1/cvms/provision")
.header("Content-Type", "application/json")
.body("{\n \"compose_file\": {\n \"name\": \"<string>\",\n \"allowed_envs\": [\n \"<string>\"\n ],\n \"bash_script\": \"<string>\",\n \"default_gateway_domain\": \"<string>\",\n \"docker_compose_file\": \"<string>\",\n \"init_script\": \"<string>\",\n \"kms_enabled\": true,\n \"local_key_provider_enabled\": false,\n \"manifest_version\": 2,\n \"no_instance_id\": false,\n \"pre_launch_script\": \"<string>\",\n \"public_logs\": true,\n \"public_sysinfo\": true,\n \"public_tcbinfo\": true,\n \"runner\": \"docker-compose\",\n \"gateway_enabled\": true,\n \"features\": [\n \"kms\",\n \"tproxy-net\"\n ],\n \"salt\": \"<string>\",\n \"secure_time\": false,\n \"storage_fs\": \"zfs\",\n \"tproxy_enabled\": true\n },\n \"name\": \"<string>\",\n \"instance_type\": \"<string>\",\n \"vcpu\": 123,\n \"memory\": 123,\n \"disk_size\": 123,\n \"image\": \"<string>\",\n \"prefer_dev\": true,\n \"teepod_id\": 123,\n \"region\": \"<string>\",\n \"listed\": true,\n \"kms_id\": \"<string>\",\n \"kms\": \"phala\",\n \"nonce\": 123,\n \"app_id\": \"<string>\",\n \"env_keys\": [\n \"<string>\"\n ],\n \"ports\": [\n {\n \"protocol\": \"<string>\",\n \"host_port\": 123,\n \"vm_port\": 123,\n \"host_address\": \"<string>\"\n }\n ],\n \"encrypted_env\": \"<string>\",\n \"user_config\": \"<string>\",\n \"hugepages\": false,\n \"pin_numa\": false,\n \"gpus\": {\n \"gpus\": [\n {\n \"slot\": \"<string>\",\n \"product_id\": \"<string>\"\n }\n ],\n \"attach_mode\": \"listed\"\n },\n \"kms_urls\": [\n \"<string>\"\n ],\n \"gateway_urls\": [\n \"<string>\"\n ],\n \"experimental_vpc_server_app_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud-api.phala.com/api/v1/cvms/provision")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"compose_file\": {\n \"name\": \"<string>\",\n \"allowed_envs\": [\n \"<string>\"\n ],\n \"bash_script\": \"<string>\",\n \"default_gateway_domain\": \"<string>\",\n \"docker_compose_file\": \"<string>\",\n \"init_script\": \"<string>\",\n \"kms_enabled\": true,\n \"local_key_provider_enabled\": false,\n \"manifest_version\": 2,\n \"no_instance_id\": false,\n \"pre_launch_script\": \"<string>\",\n \"public_logs\": true,\n \"public_sysinfo\": true,\n \"public_tcbinfo\": true,\n \"runner\": \"docker-compose\",\n \"gateway_enabled\": true,\n \"features\": [\n \"kms\",\n \"tproxy-net\"\n ],\n \"salt\": \"<string>\",\n \"secure_time\": false,\n \"storage_fs\": \"zfs\",\n \"tproxy_enabled\": true\n },\n \"name\": \"<string>\",\n \"instance_type\": \"<string>\",\n \"vcpu\": 123,\n \"memory\": 123,\n \"disk_size\": 123,\n \"image\": \"<string>\",\n \"prefer_dev\": true,\n \"teepod_id\": 123,\n \"region\": \"<string>\",\n \"listed\": true,\n \"kms_id\": \"<string>\",\n \"kms\": \"phala\",\n \"nonce\": 123,\n \"app_id\": \"<string>\",\n \"env_keys\": [\n \"<string>\"\n ],\n \"ports\": [\n {\n \"protocol\": \"<string>\",\n \"host_port\": 123,\n \"vm_port\": 123,\n \"host_address\": \"<string>\"\n }\n ],\n \"encrypted_env\": \"<string>\",\n \"user_config\": \"<string>\",\n \"hugepages\": false,\n \"pin_numa\": false,\n \"gpus\": {\n \"gpus\": [\n {\n \"slot\": \"<string>\",\n \"product_id\": \"<string>\"\n }\n ],\n \"attach_mode\": \"listed\"\n },\n \"kms_urls\": [\n \"<string>\"\n ],\n \"gateway_urls\": [\n \"<string>\"\n ],\n \"experimental_vpc_server_app_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyProvision DStack app
Validates Docker Compose configuration and caches it for 14 days. Returns compose_hash and KMS info for on-chain registration before creation.
curl --request POST \
--url https://cloud-api.phala.com/api/v1/cvms/provision \
--header 'Content-Type: application/json' \
--data '
{
"compose_file": {
"name": "<string>",
"allowed_envs": [
"<string>"
],
"bash_script": "<string>",
"default_gateway_domain": "<string>",
"docker_compose_file": "<string>",
"init_script": "<string>",
"kms_enabled": true,
"local_key_provider_enabled": false,
"manifest_version": 2,
"no_instance_id": false,
"pre_launch_script": "<string>",
"public_logs": true,
"public_sysinfo": true,
"public_tcbinfo": true,
"runner": "docker-compose",
"gateway_enabled": true,
"features": [
"kms",
"tproxy-net"
],
"salt": "<string>",
"secure_time": false,
"storage_fs": "zfs",
"tproxy_enabled": true
},
"name": "<string>",
"instance_type": "<string>",
"vcpu": 123,
"memory": 123,
"disk_size": 123,
"image": "<string>",
"prefer_dev": true,
"teepod_id": 123,
"region": "<string>",
"listed": true,
"kms_id": "<string>",
"kms": "phala",
"nonce": 123,
"app_id": "<string>",
"env_keys": [
"<string>"
],
"ports": [
{
"protocol": "<string>",
"host_port": 123,
"vm_port": 123,
"host_address": "<string>"
}
],
"encrypted_env": "<string>",
"user_config": "<string>",
"hugepages": false,
"pin_numa": false,
"gpus": {
"gpus": [
{
"slot": "<string>",
"product_id": "<string>"
}
],
"attach_mode": "listed"
},
"kms_urls": [
"<string>"
],
"gateway_urls": [
"<string>"
],
"experimental_vpc_server_app_id": "<string>"
}
'import requests
url = "https://cloud-api.phala.com/api/v1/cvms/provision"
payload = {
"compose_file": {
"name": "<string>",
"allowed_envs": ["<string>"],
"bash_script": "<string>",
"default_gateway_domain": "<string>",
"docker_compose_file": "<string>",
"init_script": "<string>",
"kms_enabled": True,
"local_key_provider_enabled": False,
"manifest_version": 2,
"no_instance_id": False,
"pre_launch_script": "<string>",
"public_logs": True,
"public_sysinfo": True,
"public_tcbinfo": True,
"runner": "docker-compose",
"gateway_enabled": True,
"features": ["kms", "tproxy-net"],
"salt": "<string>",
"secure_time": False,
"storage_fs": "zfs",
"tproxy_enabled": True
},
"name": "<string>",
"instance_type": "<string>",
"vcpu": 123,
"memory": 123,
"disk_size": 123,
"image": "<string>",
"prefer_dev": True,
"teepod_id": 123,
"region": "<string>",
"listed": True,
"kms_id": "<string>",
"kms": "phala",
"nonce": 123,
"app_id": "<string>",
"env_keys": ["<string>"],
"ports": [
{
"protocol": "<string>",
"host_port": 123,
"vm_port": 123,
"host_address": "<string>"
}
],
"encrypted_env": "<string>",
"user_config": "<string>",
"hugepages": False,
"pin_numa": False,
"gpus": {
"gpus": [
{
"slot": "<string>",
"product_id": "<string>"
}
],
"attach_mode": "listed"
},
"kms_urls": ["<string>"],
"gateway_urls": ["<string>"],
"experimental_vpc_server_app_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
compose_file: {
name: '<string>',
allowed_envs: ['<string>'],
bash_script: '<string>',
default_gateway_domain: '<string>',
docker_compose_file: '<string>',
init_script: '<string>',
kms_enabled: true,
local_key_provider_enabled: false,
manifest_version: 2,
no_instance_id: false,
pre_launch_script: '<string>',
public_logs: true,
public_sysinfo: true,
public_tcbinfo: true,
runner: 'docker-compose',
gateway_enabled: true,
features: ['kms', 'tproxy-net'],
salt: '<string>',
secure_time: false,
storage_fs: 'zfs',
tproxy_enabled: true
},
name: '<string>',
instance_type: '<string>',
vcpu: 123,
memory: 123,
disk_size: 123,
image: '<string>',
prefer_dev: true,
teepod_id: 123,
region: '<string>',
listed: true,
kms_id: '<string>',
kms: 'phala',
nonce: 123,
app_id: '<string>',
env_keys: ['<string>'],
ports: [{protocol: '<string>', host_port: 123, vm_port: 123, host_address: '<string>'}],
encrypted_env: '<string>',
user_config: '<string>',
hugepages: false,
pin_numa: false,
gpus: {gpus: [{slot: '<string>', product_id: '<string>'}], attach_mode: 'listed'},
kms_urls: ['<string>'],
gateway_urls: ['<string>'],
experimental_vpc_server_app_id: '<string>'
})
};
fetch('https://cloud-api.phala.com/api/v1/cvms/provision', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cloud-api.phala.com/api/v1/cvms/provision",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'compose_file' => [
'name' => '<string>',
'allowed_envs' => [
'<string>'
],
'bash_script' => '<string>',
'default_gateway_domain' => '<string>',
'docker_compose_file' => '<string>',
'init_script' => '<string>',
'kms_enabled' => true,
'local_key_provider_enabled' => false,
'manifest_version' => 2,
'no_instance_id' => false,
'pre_launch_script' => '<string>',
'public_logs' => true,
'public_sysinfo' => true,
'public_tcbinfo' => true,
'runner' => 'docker-compose',
'gateway_enabled' => true,
'features' => [
'kms',
'tproxy-net'
],
'salt' => '<string>',
'secure_time' => false,
'storage_fs' => 'zfs',
'tproxy_enabled' => true
],
'name' => '<string>',
'instance_type' => '<string>',
'vcpu' => 123,
'memory' => 123,
'disk_size' => 123,
'image' => '<string>',
'prefer_dev' => true,
'teepod_id' => 123,
'region' => '<string>',
'listed' => true,
'kms_id' => '<string>',
'kms' => 'phala',
'nonce' => 123,
'app_id' => '<string>',
'env_keys' => [
'<string>'
],
'ports' => [
[
'protocol' => '<string>',
'host_port' => 123,
'vm_port' => 123,
'host_address' => '<string>'
]
],
'encrypted_env' => '<string>',
'user_config' => '<string>',
'hugepages' => false,
'pin_numa' => false,
'gpus' => [
'gpus' => [
[
'slot' => '<string>',
'product_id' => '<string>'
]
],
'attach_mode' => 'listed'
],
'kms_urls' => [
'<string>'
],
'gateway_urls' => [
'<string>'
],
'experimental_vpc_server_app_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cloud-api.phala.com/api/v1/cvms/provision"
payload := strings.NewReader("{\n \"compose_file\": {\n \"name\": \"<string>\",\n \"allowed_envs\": [\n \"<string>\"\n ],\n \"bash_script\": \"<string>\",\n \"default_gateway_domain\": \"<string>\",\n \"docker_compose_file\": \"<string>\",\n \"init_script\": \"<string>\",\n \"kms_enabled\": true,\n \"local_key_provider_enabled\": false,\n \"manifest_version\": 2,\n \"no_instance_id\": false,\n \"pre_launch_script\": \"<string>\",\n \"public_logs\": true,\n \"public_sysinfo\": true,\n \"public_tcbinfo\": true,\n \"runner\": \"docker-compose\",\n \"gateway_enabled\": true,\n \"features\": [\n \"kms\",\n \"tproxy-net\"\n ],\n \"salt\": \"<string>\",\n \"secure_time\": false,\n \"storage_fs\": \"zfs\",\n \"tproxy_enabled\": true\n },\n \"name\": \"<string>\",\n \"instance_type\": \"<string>\",\n \"vcpu\": 123,\n \"memory\": 123,\n \"disk_size\": 123,\n \"image\": \"<string>\",\n \"prefer_dev\": true,\n \"teepod_id\": 123,\n \"region\": \"<string>\",\n \"listed\": true,\n \"kms_id\": \"<string>\",\n \"kms\": \"phala\",\n \"nonce\": 123,\n \"app_id\": \"<string>\",\n \"env_keys\": [\n \"<string>\"\n ],\n \"ports\": [\n {\n \"protocol\": \"<string>\",\n \"host_port\": 123,\n \"vm_port\": 123,\n \"host_address\": \"<string>\"\n }\n ],\n \"encrypted_env\": \"<string>\",\n \"user_config\": \"<string>\",\n \"hugepages\": false,\n \"pin_numa\": false,\n \"gpus\": {\n \"gpus\": [\n {\n \"slot\": \"<string>\",\n \"product_id\": \"<string>\"\n }\n ],\n \"attach_mode\": \"listed\"\n },\n \"kms_urls\": [\n \"<string>\"\n ],\n \"gateway_urls\": [\n \"<string>\"\n ],\n \"experimental_vpc_server_app_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cloud-api.phala.com/api/v1/cvms/provision")
.header("Content-Type", "application/json")
.body("{\n \"compose_file\": {\n \"name\": \"<string>\",\n \"allowed_envs\": [\n \"<string>\"\n ],\n \"bash_script\": \"<string>\",\n \"default_gateway_domain\": \"<string>\",\n \"docker_compose_file\": \"<string>\",\n \"init_script\": \"<string>\",\n \"kms_enabled\": true,\n \"local_key_provider_enabled\": false,\n \"manifest_version\": 2,\n \"no_instance_id\": false,\n \"pre_launch_script\": \"<string>\",\n \"public_logs\": true,\n \"public_sysinfo\": true,\n \"public_tcbinfo\": true,\n \"runner\": \"docker-compose\",\n \"gateway_enabled\": true,\n \"features\": [\n \"kms\",\n \"tproxy-net\"\n ],\n \"salt\": \"<string>\",\n \"secure_time\": false,\n \"storage_fs\": \"zfs\",\n \"tproxy_enabled\": true\n },\n \"name\": \"<string>\",\n \"instance_type\": \"<string>\",\n \"vcpu\": 123,\n \"memory\": 123,\n \"disk_size\": 123,\n \"image\": \"<string>\",\n \"prefer_dev\": true,\n \"teepod_id\": 123,\n \"region\": \"<string>\",\n \"listed\": true,\n \"kms_id\": \"<string>\",\n \"kms\": \"phala\",\n \"nonce\": 123,\n \"app_id\": \"<string>\",\n \"env_keys\": [\n \"<string>\"\n ],\n \"ports\": [\n {\n \"protocol\": \"<string>\",\n \"host_port\": 123,\n \"vm_port\": 123,\n \"host_address\": \"<string>\"\n }\n ],\n \"encrypted_env\": \"<string>\",\n \"user_config\": \"<string>\",\n \"hugepages\": false,\n \"pin_numa\": false,\n \"gpus\": {\n \"gpus\": [\n {\n \"slot\": \"<string>\",\n \"product_id\": \"<string>\"\n }\n ],\n \"attach_mode\": \"listed\"\n },\n \"kms_urls\": [\n \"<string>\"\n ],\n \"gateway_urls\": [\n \"<string>\"\n ],\n \"experimental_vpc_server_app_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud-api.phala.com/api/v1/cvms/provision")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"compose_file\": {\n \"name\": \"<string>\",\n \"allowed_envs\": [\n \"<string>\"\n ],\n \"bash_script\": \"<string>\",\n \"default_gateway_domain\": \"<string>\",\n \"docker_compose_file\": \"<string>\",\n \"init_script\": \"<string>\",\n \"kms_enabled\": true,\n \"local_key_provider_enabled\": false,\n \"manifest_version\": 2,\n \"no_instance_id\": false,\n \"pre_launch_script\": \"<string>\",\n \"public_logs\": true,\n \"public_sysinfo\": true,\n \"public_tcbinfo\": true,\n \"runner\": \"docker-compose\",\n \"gateway_enabled\": true,\n \"features\": [\n \"kms\",\n \"tproxy-net\"\n ],\n \"salt\": \"<string>\",\n \"secure_time\": false,\n \"storage_fs\": \"zfs\",\n \"tproxy_enabled\": true\n },\n \"name\": \"<string>\",\n \"instance_type\": \"<string>\",\n \"vcpu\": 123,\n \"memory\": 123,\n \"disk_size\": 123,\n \"image\": \"<string>\",\n \"prefer_dev\": true,\n \"teepod_id\": 123,\n \"region\": \"<string>\",\n \"listed\": true,\n \"kms_id\": \"<string>\",\n \"kms\": \"phala\",\n \"nonce\": 123,\n \"app_id\": \"<string>\",\n \"env_keys\": [\n \"<string>\"\n ],\n \"ports\": [\n {\n \"protocol\": \"<string>\",\n \"host_port\": 123,\n \"vm_port\": 123,\n \"host_address\": \"<string>\"\n }\n ],\n \"encrypted_env\": \"<string>\",\n \"user_config\": \"<string>\",\n \"hugepages\": false,\n \"pin_numa\": false,\n \"gpus\": {\n \"gpus\": [\n {\n \"slot\": \"<string>\",\n \"product_id\": \"<string>\"\n }\n ],\n \"attach_mode\": \"listed\"\n },\n \"kms_urls\": [\n \"<string>\"\n ],\n \"gateway_urls\": [\n \"<string>\"\n ],\n \"experimental_vpc_server_app_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyBody
Request for provisioning a DStack app with automatic resource matching.
Most fields are optional and will be automatically determined by the resource matching logic in preflight_dstack_app. Only compose_file and name are required.
Show child attributes
Show child attributes
CVM name (used as hostname): 5-63 chars, must start with letter, can contain letters/numbers/hyphens
Prefer dev OS image (True) or non-dev OS image (False). When None, auto-selects based on image name or defaults to dev.
phala, ethereum, base, legacy Optional nonce for deterministic app_id generation. When provided, app_id must also be provided. System will verify: app_id == get_create_address(team_wallet, nonce)
Optional app_id for manual specification. Required when nonce is provided. Only works with PHALA KMS.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Provision data with compose_hash for creation
Was this page helpful?

