Batch check on-chain deployment allowance for all CVMs under an app
curl --request POST \
--url https://cloud-api.phala.com/api/v1/apps/{app_id}/cvms/is-allowedimport requests
url = "https://cloud-api.phala.com/api/v1/apps/{app_id}/cvms/is-allowed"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://cloud-api.phala.com/api/v1/apps/{app_id}/cvms/is-allowed', 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}/cvms/is-allowed",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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/apps/{app_id}/cvms/is-allowed"
req, _ := http.NewRequest("POST", url, nil)
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}/cvms/is-allowed")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud-api.phala.com/api/v1/apps/{app_id}/cvms/is-allowed")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"is_onchain": true,
"results": [
{
"cvm_id": 123,
"app_contract_address": "<string>",
"compose_hash": "<string>",
"device_id": "<string>",
"compose_hash_allowed": true,
"allow_any_device": true,
"is_allowed": true,
"device_id_allowed": true,
"error": "<string>"
}
],
"total": 0,
"allowed_count": 0,
"denied_count": 0,
"error_count": 0,
"skipped_cvm_ids": [
123
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Apps
Batch check on-chain deployment allowance for all CVMs under an app
POST
/
api
/
v1
/
apps
/
{app_id}
/
cvms
/
is-allowed
Batch check on-chain deployment allowance for all CVMs under an app
curl --request POST \
--url https://cloud-api.phala.com/api/v1/apps/{app_id}/cvms/is-allowedimport requests
url = "https://cloud-api.phala.com/api/v1/apps/{app_id}/cvms/is-allowed"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://cloud-api.phala.com/api/v1/apps/{app_id}/cvms/is-allowed', 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}/cvms/is-allowed",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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/apps/{app_id}/cvms/is-allowed"
req, _ := http.NewRequest("POST", url, nil)
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}/cvms/is-allowed")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud-api.phala.com/api/v1/apps/{app_id}/cvms/is-allowed")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"is_onchain": true,
"results": [
{
"cvm_id": 123,
"app_contract_address": "<string>",
"compose_hash": "<string>",
"device_id": "<string>",
"compose_hash_allowed": true,
"allow_any_device": true,
"is_allowed": true,
"device_id_allowed": true,
"error": "<string>"
}
],
"total": 0,
"allowed_count": 0,
"denied_count": 0,
"error_count": 0,
"skipped_cvm_ids": [
123
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Path Parameters
Was this page helpful?
⌘I

