curl --request POST \
--url https://cloud-api.phala.com/api/v1/apps/{app_id}/revisions/{revision_id}/redeploy \
--header 'Content-Type: application/json' \
--data '
{
"vm_uuids": [
"<string>"
],
"encrypted_env": "<string>",
"allow_env_mismatch": false
}
'import requests
url = "https://cloud-api.phala.com/api/v1/apps/{app_id}/revisions/{revision_id}/redeploy"
payload = {
"vm_uuids": ["<string>"],
"encrypted_env": "<string>",
"allow_env_mismatch": False
}
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({vm_uuids: ['<string>'], encrypted_env: '<string>', allow_env_mismatch: false})
};
fetch('https://cloud-api.phala.com/api/v1/apps/{app_id}/revisions/{revision_id}/redeploy', 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/apps/{app_id}/revisions/{revision_id}/redeploy",
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([
'vm_uuids' => [
'<string>'
],
'encrypted_env' => '<string>',
'allow_env_mismatch' => false
]),
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/apps/{app_id}/revisions/{revision_id}/redeploy"
payload := strings.NewReader("{\n \"vm_uuids\": [\n \"<string>\"\n ],\n \"encrypted_env\": \"<string>\",\n \"allow_env_mismatch\": false\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/apps/{app_id}/revisions/{revision_id}/redeploy")
.header("Content-Type", "application/json")
.body("{\n \"vm_uuids\": [\n \"<string>\"\n ],\n \"encrypted_env\": \"<string>\",\n \"allow_env_mismatch\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud-api.phala.com/api/v1/apps/{app_id}/revisions/{revision_id}/redeploy")
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 \"vm_uuids\": [\n \"<string>\"\n ],\n \"encrypted_env\": \"<string>\",\n \"allow_env_mismatch\": false\n}"
response = http.request(request)
puts response.read_body{
"error_code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"value": null,
"message": "<string>"
}
],
"suggestions": [
"<string>"
],
"links": [
{
"url": "<string>",
"label": "<string>"
}
],
"request_id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Redeploy app from a specific revision
Redeploy a CVM to a specific revision. If the app has exactly one CVM, it will be redeployed by default. If the app has multiple CVMs, you must specify target vm_uuids in request body. Does not change encrypted env unless encrypted_env is supplied. A mismatch between allowed_envs and the last env write is rejected unless encrypted_env is supplied or allow_env_mismatch is true. This schedules async CVM update task(s).
curl --request POST \
--url https://cloud-api.phala.com/api/v1/apps/{app_id}/revisions/{revision_id}/redeploy \
--header 'Content-Type: application/json' \
--data '
{
"vm_uuids": [
"<string>"
],
"encrypted_env": "<string>",
"allow_env_mismatch": false
}
'import requests
url = "https://cloud-api.phala.com/api/v1/apps/{app_id}/revisions/{revision_id}/redeploy"
payload = {
"vm_uuids": ["<string>"],
"encrypted_env": "<string>",
"allow_env_mismatch": False
}
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({vm_uuids: ['<string>'], encrypted_env: '<string>', allow_env_mismatch: false})
};
fetch('https://cloud-api.phala.com/api/v1/apps/{app_id}/revisions/{revision_id}/redeploy', 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/apps/{app_id}/revisions/{revision_id}/redeploy",
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([
'vm_uuids' => [
'<string>'
],
'encrypted_env' => '<string>',
'allow_env_mismatch' => false
]),
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/apps/{app_id}/revisions/{revision_id}/redeploy"
payload := strings.NewReader("{\n \"vm_uuids\": [\n \"<string>\"\n ],\n \"encrypted_env\": \"<string>\",\n \"allow_env_mismatch\": false\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/apps/{app_id}/revisions/{revision_id}/redeploy")
.header("Content-Type", "application/json")
.body("{\n \"vm_uuids\": [\n \"<string>\"\n ],\n \"encrypted_env\": \"<string>\",\n \"allow_env_mismatch\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud-api.phala.com/api/v1/apps/{app_id}/revisions/{revision_id}/redeploy")
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 \"vm_uuids\": [\n \"<string>\"\n ],\n \"encrypted_env\": \"<string>\",\n \"allow_env_mismatch\": false\n}"
response = http.request(request)
puts response.read_body{
"error_code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"value": null,
"message": "<string>"
}
],
"suggestions": [
"<string>"
],
"links": [
{
"url": "<string>",
"label": "<string>"
}
],
"request_id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Path Parameters
Hex app identifier
External AppRevisionId (prefix 'rev_'). Fully prefixed string required; bare payloads and raw integers are rejected.
"rev_0123abcd"
Query Parameters
Optional transaction hash proving on-chain compose hash registration
Body
Optional target CVM selection. If the app has multiple CVMs, you must specify vm_uuids.
Optional encrypted env blob. When omitted, rollback keeps each CVM's current encrypted env. Supply a blob only to deliberately roll env back.
Continue even when this revision's allowed_envs differ from the last env write. Ignored when encrypted_env is supplied.
Response
Activation initiated
Was this page helpful?

