Update a cluster machine
curl --request PATCH \
--url https://rest.compute.cudo.org/v1/projects/{projectId}/cluster-machines/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"powerState": "MACHINE_POWER_STATE_UNSPECIFIED",
"priceHr": {
"value": "<string>"
},
"state": "STATE_UNSPECIFIED",
"volumeIds": [
"<string>"
]
}
'import requests
url = "https://rest.compute.cudo.org/v1/projects/{projectId}/cluster-machines/{id}"
payload = {
"powerState": "MACHINE_POWER_STATE_UNSPECIFIED",
"priceHr": { "value": "<string>" },
"state": "STATE_UNSPECIFIED",
"volumeIds": ["<string>"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
powerState: 'MACHINE_POWER_STATE_UNSPECIFIED',
priceHr: {value: '<string>'},
state: 'STATE_UNSPECIFIED',
volumeIds: ['<string>']
})
};
fetch('https://rest.compute.cudo.org/v1/projects/{projectId}/cluster-machines/{id}', 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://rest.compute.cudo.org/v1/projects/{projectId}/cluster-machines/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'powerState' => 'MACHINE_POWER_STATE_UNSPECIFIED',
'priceHr' => [
'value' => '<string>'
],
'state' => 'STATE_UNSPECIFIED',
'volumeIds' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://rest.compute.cudo.org/v1/projects/{projectId}/cluster-machines/{id}"
payload := strings.NewReader("{\n \"powerState\": \"MACHINE_POWER_STATE_UNSPECIFIED\",\n \"priceHr\": {\n \"value\": \"<string>\"\n },\n \"state\": \"STATE_UNSPECIFIED\",\n \"volumeIds\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.patch("https://rest.compute.cudo.org/v1/projects/{projectId}/cluster-machines/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"powerState\": \"MACHINE_POWER_STATE_UNSPECIFIED\",\n \"priceHr\": {\n \"value\": \"<string>\"\n },\n \"state\": \"STATE_UNSPECIFIED\",\n \"volumeIds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://rest.compute.cudo.org/v1/projects/{projectId}/cluster-machines/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"powerState\": \"MACHINE_POWER_STATE_UNSPECIFIED\",\n \"priceHr\": {\n \"value\": \"<string>\"\n },\n \"state\": \"STATE_UNSPECIFIED\",\n \"volumeIds\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"architecture": "<string>",
"cpuCores": 123,
"cpuModel": "<string>",
"cpuSpeedMhz": 123,
"createBy": "<string>",
"createTime": "2023-11-07T05:31:56Z",
"dataCenterId": "<string>",
"diskSizeGib": 123,
"disks": 123,
"externalIpAddress": "<string>",
"gpuModelId": "<string>",
"gpus": 123,
"id": "<string>",
"internalIpAddress": "<string>",
"machineTypeId": "<string>",
"memoryGib": 123,
"powerState": "MACHINE_POWER_STATE_UNSPECIFIED",
"priceHr": {
"value": "<string>"
},
"projectId": "<string>",
"state": "STATE_UNSPECIFIED",
"volumeIds": [
"<string>"
]
}{
"code": 123,
"details": [
{
"@type": "<string>"
}
],
"message": "<string>"
}Clusters
Update a cluster machine
Updates a machine in a cluster.
PATCH
/
v1
/
projects
/
{projectId}
/
cluster-machines
/
{id}
Update a cluster machine
curl --request PATCH \
--url https://rest.compute.cudo.org/v1/projects/{projectId}/cluster-machines/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"powerState": "MACHINE_POWER_STATE_UNSPECIFIED",
"priceHr": {
"value": "<string>"
},
"state": "STATE_UNSPECIFIED",
"volumeIds": [
"<string>"
]
}
'import requests
url = "https://rest.compute.cudo.org/v1/projects/{projectId}/cluster-machines/{id}"
payload = {
"powerState": "MACHINE_POWER_STATE_UNSPECIFIED",
"priceHr": { "value": "<string>" },
"state": "STATE_UNSPECIFIED",
"volumeIds": ["<string>"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
powerState: 'MACHINE_POWER_STATE_UNSPECIFIED',
priceHr: {value: '<string>'},
state: 'STATE_UNSPECIFIED',
volumeIds: ['<string>']
})
};
fetch('https://rest.compute.cudo.org/v1/projects/{projectId}/cluster-machines/{id}', 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://rest.compute.cudo.org/v1/projects/{projectId}/cluster-machines/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'powerState' => 'MACHINE_POWER_STATE_UNSPECIFIED',
'priceHr' => [
'value' => '<string>'
],
'state' => 'STATE_UNSPECIFIED',
'volumeIds' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://rest.compute.cudo.org/v1/projects/{projectId}/cluster-machines/{id}"
payload := strings.NewReader("{\n \"powerState\": \"MACHINE_POWER_STATE_UNSPECIFIED\",\n \"priceHr\": {\n \"value\": \"<string>\"\n },\n \"state\": \"STATE_UNSPECIFIED\",\n \"volumeIds\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.patch("https://rest.compute.cudo.org/v1/projects/{projectId}/cluster-machines/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"powerState\": \"MACHINE_POWER_STATE_UNSPECIFIED\",\n \"priceHr\": {\n \"value\": \"<string>\"\n },\n \"state\": \"STATE_UNSPECIFIED\",\n \"volumeIds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://rest.compute.cudo.org/v1/projects/{projectId}/cluster-machines/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"powerState\": \"MACHINE_POWER_STATE_UNSPECIFIED\",\n \"priceHr\": {\n \"value\": \"<string>\"\n },\n \"state\": \"STATE_UNSPECIFIED\",\n \"volumeIds\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"architecture": "<string>",
"cpuCores": 123,
"cpuModel": "<string>",
"cpuSpeedMhz": 123,
"createBy": "<string>",
"createTime": "2023-11-07T05:31:56Z",
"dataCenterId": "<string>",
"diskSizeGib": 123,
"disks": 123,
"externalIpAddress": "<string>",
"gpuModelId": "<string>",
"gpus": 123,
"id": "<string>",
"internalIpAddress": "<string>",
"machineTypeId": "<string>",
"memoryGib": 123,
"powerState": "MACHINE_POWER_STATE_UNSPECIFIED",
"priceHr": {
"value": "<string>"
},
"projectId": "<string>",
"state": "STATE_UNSPECIFIED",
"volumeIds": [
"<string>"
]
}{
"code": 123,
"details": [
{
"@type": "<string>"
}
],
"message": "<string>"
}Authorizations
API key authentication. API keys should be passed using the format Bearer API_KEY.
Body
application/json
Update cluster machine params
Available options:
MACHINE_POWER_STATE_UNSPECIFIED, ON, OFF, POWERING_ON, POWERING_OFF, REBOOTING A representation of a decimal value, such as 2.5. Clients may convert values into language-native decimal formats, such as Java's BigDecimal or Python's decimal.Decimal.
Show child attributes
Show child attributes
Available options:
STATE_UNSPECIFIED, CREATING, ACTIVE, DELETING, FAILED Response
A successful response.
Available options:
MACHINE_POWER_STATE_UNSPECIFIED, ON, OFF, POWERING_ON, POWERING_OFF, REBOOTING A representation of a decimal value, such as 2.5. Clients may convert values into language-native decimal formats, such as Java's BigDecimal or Python's decimal.Decimal.
Show child attributes
Show child attributes
Available options:
STATE_UNSPECIFIED, CREATING, ACTIVE, DELETING, FAILED