Power a server
curl --request POST \
--url https://my.server.express/api/v1/cloud/{id}/power \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://my.server.express/api/v1/cloud/{id}/power', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://my.server.express/api/v1/cloud/{id}/power"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"upid": "<string>"
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>",
"data": {
"taskId": "<string>",
"limit": 123,
"used": 123
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Cloud
Power a server
Runs a power verb on this service’s VM without needing its hypervisor vmid. shutdown is a graceful ACPI request, stop
pulls the plug, reset is a hard reboot. Needs the operate role (owner, ADMIN or OPERATOR). Blocked while the service is
PENDING or SUSPENDED (403) and while a rebuild or other long task is running (409). Invalidates the cached power reading
and writes a VM_<ACTION> audit entry. Returns the Proxmox task id; the change itself completes a few seconds later.
POST
/
v1
/
cloud
/
{id}
/
power
Power a server
curl --request POST \
--url https://my.server.express/api/v1/cloud/{id}/power \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://my.server.express/api/v1/cloud/{id}/power', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://my.server.express/api/v1/cloud/{id}/power"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"upid": "<string>"
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>",
"data": {
"taskId": "<string>",
"limit": 123,
"used": 123
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Authorizations
bearerAuthapiToken
Session access token (JWT) from POST /v1/auth/login or /v1/auth/refresh. A session satisfies every API scope.
Path Parameters
Service id of the cloud server.
Body
application/json
Available options:
start, stop, shutdown, reboot, reset