Get CVM system stats
curl --request GET \
--url https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/statsimport requests
url = "https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/stats"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/stats', 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}/stats",
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}/stats"
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}/stats")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/stats")
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{
"is_online": true,
"is_public": true,
"error": "<string>",
"sysinfo": {
"os_name": "<string>",
"os_version": "<string>",
"kernel_version": "<string>",
"cpu_model": "<string>",
"num_cpus": 123,
"total_memory": 123,
"available_memory": 123,
"used_memory": 123,
"free_memory": 123,
"total_swap": 123,
"used_swap": 123,
"free_swap": 123,
"uptime": 123,
"loadavg_one": 123,
"loadavg_five": 123,
"loadavg_fifteen": 123,
"disks": [
{
"name": "<string>",
"mount_point": "<string>",
"total_size": 123,
"free_size": 123
}
]
},
"status": "<string>",
"in_progress": false,
"boot_progress": "<string>",
"boot_error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}CVMs
Get CVM system stats
Returns live system metrics (CPU, memory, disk) from the running CVM.
GET
/
api
/
v1
/
cvms
/
{cvm_id}
/
stats
Get CVM system stats
curl --request GET \
--url https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/statsimport requests
url = "https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/stats"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/stats', 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}/stats",
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}/stats"
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}/stats")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/stats")
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{
"is_online": true,
"is_public": true,
"error": "<string>",
"sysinfo": {
"os_name": "<string>",
"os_version": "<string>",
"kernel_version": "<string>",
"cpu_model": "<string>",
"num_cpus": 123,
"total_memory": 123,
"available_memory": 123,
"used_memory": 123,
"free_memory": 123,
"total_swap": 123,
"used_swap": 123,
"free_swap": 123,
"uptime": 123,
"loadavg_one": 123,
"loadavg_five": 123,
"loadavg_fifteen": 123,
"disks": [
{
"name": "<string>",
"mount_point": "<string>",
"total_size": 123,
"free_size": 123
}
]
},
"status": "<string>",
"in_progress": false,
"boot_progress": "<string>",
"boot_error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Path Parameters
Was this page helpful?
⌘I

