Computes
Upsize Compute Instance
Upgrades the specification (size) of the specified compute instance.
PATCH
/
computes
/
{id}
/
upsize
Upsize a compute instance
curl --request PATCH \
--url https://api.strettch.cloud/api/v1/computes/{id}/upsize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"newSpecification": "S-1C-1G"
}
'import requests
url = "https://api.strettch.cloud/api/v1/computes/{id}/upsize"
payload = { "newSpecification": "S-1C-1G" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({newSpecification: 'S-1C-1G'})
};
fetch('https://api.strettch.cloud/api/v1/computes/{id}/upsize', 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://api.strettch.cloud/api/v1/computes/{id}/upsize",
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([
'newSpecification' => 'S-1C-1G'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.strettch.cloud/api/v1/computes/{id}/upsize"
payload := strings.NewReader("{\n \"newSpecification\": \"S-1C-1G\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.strettch.cloud/api/v1/computes/{id}/upsize")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"newSpecification\": \"S-1C-1G\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.strettch.cloud/api/v1/computes/{id}/upsize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"newSpecification\": \"S-1C-1G\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Operation successful",
"requestId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"success": true,
"timestamp": "2024-01-15T10:00:00Z",
"data": {
"id": "325",
"hostName": "my-server-01",
"state": "RUNNING",
"image": "UBUNTU-24.04",
"specification": "S-1C-1G",
"region": "KGL-1",
"ipv4": "195.15.0.73",
"privateIpv4": "10.0.0.5",
"tags": [
"production",
"web"
],
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-15T10:05:00Z"
}
}{
"code": "ERROR_CODE",
"message": "Error message description",
"requestId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"success": false,
"timestamp": "2024-01-15T10:00:00Z"
}{
"code": "ERROR_CODE",
"message": "Error message description",
"requestId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"success": false,
"timestamp": "2024-01-15T10:00:00Z"
}{
"code": "ERROR_CODE",
"message": "Error message description",
"requestId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"success": false,
"timestamp": "2024-01-15T10:00:00Z"
}{
"code": "ERROR_CODE",
"message": "Error message description",
"requestId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"success": false,
"timestamp": "2024-01-15T10:00:00Z"
}{
"code": "ERROR_CODE",
"message": "Error message description",
"requestId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"success": false,
"timestamp": "2024-01-15T10:00:00Z"
}Request Reference
Use these slugs for thenewSpecification field in your request body.
- Specifications
The
S prefix stands for Shared CPU. RAM in GB (512 MB for the smallest tier).| Slug | vCPUs | RAM | Storage (SSD) |
|---|---|---|---|
S-1C | 1 | 512 MB | 10 GB |
S-1C-1G | 1 | 1 GB | 20 GB |
S-1C-2G | 1 | 2 GB | 40 GB |
S-2C-4G | 2 | 4 GB | 80 GB |
S-4C-8G | 4 | 8 GB | 160 GB |
S-8C-16G | 8 | 16 GB | 320 GB |
S-16C-32G | 16 | 32 GB | 640 GB |
Response Error Codes
If the request fails, thecode field in the error response will contain one of the following.
- Standard
- Compute
- Billing & Team
| Code | Status | Description |
|---|---|---|
BAD_REQUEST | 400 | The request was invalid or malformed. |
UNAUTHORIZED | 401 | Authentication failed or was not provided. |
FORBIDDEN | 403 | You do not have permission to perform this action. |
RESOURCE_NOT_FOUND | 404 | The specified compute instance was not found. |
CONFLICT | 409 | A conflict with the current server state occurred. |
UNPROCESSABLE_ENTITY | 422 | The request was well-formed but failed semantic validation. |
TOO_MANY_REQUESTS | 429 | You have exceeded the rate limit. |
INTERNAL_SERVER_ERROR | 500 | An unexpected error occurred on our end. |
| Code | Status | Description |
|---|---|---|
COMPUTE_RUNNING | 400 | This action cannot be performed while the compute instance is running. Please stop the instance and try again. |
These errors block all resource operations. Resolve your team’s billing status before retrying.
| Code | Status | Description |
|---|---|---|
INSUFFICIENT_BALANCE | 403 | Team balance is too low to provision this instance. |
TEAM_SUSPENDED | 403 | Team is suspended due to an outstanding payment. |
TEAM_PAST_DUE | 403 | Team has an outstanding balance that must be settled first. |
TEAM_TERMINATED | 403 | Team has been terminated and can no longer access resources. |
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Compute ID
Body
application/json
e.g. S-1C-1G or S-1C
Example:
"S-1C-1G"
Was this page helpful?
⌘I
Upsize a compute instance
curl --request PATCH \
--url https://api.strettch.cloud/api/v1/computes/{id}/upsize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"newSpecification": "S-1C-1G"
}
'import requests
url = "https://api.strettch.cloud/api/v1/computes/{id}/upsize"
payload = { "newSpecification": "S-1C-1G" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({newSpecification: 'S-1C-1G'})
};
fetch('https://api.strettch.cloud/api/v1/computes/{id}/upsize', 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://api.strettch.cloud/api/v1/computes/{id}/upsize",
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([
'newSpecification' => 'S-1C-1G'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.strettch.cloud/api/v1/computes/{id}/upsize"
payload := strings.NewReader("{\n \"newSpecification\": \"S-1C-1G\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.strettch.cloud/api/v1/computes/{id}/upsize")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"newSpecification\": \"S-1C-1G\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.strettch.cloud/api/v1/computes/{id}/upsize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"newSpecification\": \"S-1C-1G\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Operation successful",
"requestId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"success": true,
"timestamp": "2024-01-15T10:00:00Z",
"data": {
"id": "325",
"hostName": "my-server-01",
"state": "RUNNING",
"image": "UBUNTU-24.04",
"specification": "S-1C-1G",
"region": "KGL-1",
"ipv4": "195.15.0.73",
"privateIpv4": "10.0.0.5",
"tags": [
"production",
"web"
],
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-15T10:05:00Z"
}
}{
"code": "ERROR_CODE",
"message": "Error message description",
"requestId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"success": false,
"timestamp": "2024-01-15T10:00:00Z"
}{
"code": "ERROR_CODE",
"message": "Error message description",
"requestId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"success": false,
"timestamp": "2024-01-15T10:00:00Z"
}{
"code": "ERROR_CODE",
"message": "Error message description",
"requestId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"success": false,
"timestamp": "2024-01-15T10:00:00Z"
}{
"code": "ERROR_CODE",
"message": "Error message description",
"requestId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"success": false,
"timestamp": "2024-01-15T10:00:00Z"
}{
"code": "ERROR_CODE",
"message": "Error message description",
"requestId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"success": false,
"timestamp": "2024-01-15T10:00:00Z"
}