Get staged CVM changes
curl --request GET \
--url https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/draftimport requests
url = "https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/draft"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/draft', 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/{cvm_id}/draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/draft"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/draft")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"base_compose_hash": "<string>",
"current_compose_hash": "<string>",
"preview_compose_hash": "<string>",
"patch": {},
"entries": [
{
"user_id": "usr_0123abcd",
"username": "<string>",
"staged_at": "2023-11-07T05:31:56Z",
"patch": {}
}
]
}{
"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>"
}
]
}CVMs
Get staged CVM changes
Returns the CVM’s staged changes, who staged each one, and the compose hash applying them produces.
GET
/
api
/
v1
/
cvms
/
{cvm_id}
/
draft
Get staged CVM changes
curl --request GET \
--url https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/draftimport requests
url = "https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/draft"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/draft', 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/{cvm_id}/draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/draft"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/draft")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"base_compose_hash": "<string>",
"current_compose_hash": "<string>",
"preview_compose_hash": "<string>",
"patch": {},
"entries": [
{
"user_id": "usr_0123abcd",
"username": "<string>",
"staged_at": "2023-11-07T05:31:56Z",
"patch": {}
}
]
}{
"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
Response
Successful Response
The CVM's staged changes and the compose hash applying them produces.
The CVM's compose hash when the first change was staged
The CVM's compose hash now; apply is rejected while it differs from the base
The compose hash the CVM runs after apply. For contract-owned KMS, register it on-chain before applying.
The one PATCH /cvms/{cvm_id} body the apply sends: the entries applied in order to the CVM's current compose
The staged patches, oldest first
Show child attributes
Show child attributes
Was this page helpful?

