curl --request PUT \
--url https://app.miget.com/api/v1/apps/{uuid}/addons/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"ram_size": 123,
"disk_size": 123,
"cpu_size": 123,
"size": "<string>",
"public_access": true,
"backup_enabled": true,
"scheduled_backup": "<string>",
"auto_sleep": true
}
'import requests
url = "https://app.miget.com/api/v1/apps/{uuid}/addons/{id}"
payload = {
"label": "<string>",
"ram_size": 123,
"disk_size": 123,
"cpu_size": 123,
"size": "<string>",
"public_access": True,
"backup_enabled": True,
"scheduled_backup": "<string>",
"auto_sleep": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: '<string>',
ram_size: 123,
disk_size: 123,
cpu_size: 123,
size: '<string>',
public_access: true,
backup_enabled: true,
scheduled_backup: '<string>',
auto_sleep: true
})
};
fetch('https://app.miget.com/api/v1/apps/{uuid}/addons/{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://app.miget.com/api/v1/apps/{uuid}/addons/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'label' => '<string>',
'ram_size' => 123,
'disk_size' => 123,
'cpu_size' => 123,
'size' => '<string>',
'public_access' => true,
'backup_enabled' => true,
'scheduled_backup' => '<string>',
'auto_sleep' => true
]),
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://app.miget.com/api/v1/apps/{uuid}/addons/{id}"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"ram_size\": 123,\n \"disk_size\": 123,\n \"cpu_size\": 123,\n \"size\": \"<string>\",\n \"public_access\": true,\n \"backup_enabled\": true,\n \"scheduled_backup\": \"<string>\",\n \"auto_sleep\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.miget.com/api/v1/apps/{uuid}/addons/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"ram_size\": 123,\n \"disk_size\": 123,\n \"cpu_size\": 123,\n \"size\": \"<string>\",\n \"public_access\": true,\n \"backup_enabled\": true,\n \"scheduled_backup\": \"<string>\",\n \"auto_sleep\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.miget.com/api/v1/apps/{uuid}/addons/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"ram_size\": 123,\n \"disk_size\": 123,\n \"cpu_size\": 123,\n \"size\": \"<string>\",\n \"public_access\": true,\n \"backup_enabled\": true,\n \"scheduled_backup\": \"<string>\",\n \"auto_sleep\": true\n}"
response = http.request(request)
puts response.read_body{
"uuid": "<string>",
"name": "<string>",
"type": "<string>",
"label": "<string>",
"state": "<string>",
"quota": {},
"ram_size": 123,
"disk_size": 123,
"cpu_size": 123,
"service_id": 123,
"auto_sleep": true,
"sleeps_when_idle": true,
"backup_enabled": true,
"scheduled_backup": "<string>",
"role": "<string>",
"primary_addon_uuid": "<string>",
"replicas": [
{}
],
"settings": {},
"var": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"connection_details": {
"internal": {
"hostname": "my-addon-xxx.internal",
"database": "db_name",
"port": 5432,
"username": "db_user",
"password": "db_password",
"connection_url": "postgres://db_user:db_password@my-addon-xxx.internal:5432/db_name"
},
"external": {
"external_connection_url": "postgres://db_user:db_password@my-addon-xxx.external:5432/db_name",
"psql_command": "PGPASSWORD=db_password psql -h my-addon-xxx.external -U db_user db_name"
}
}
}Update an add-on
Modifies the configuration of an existing add-on. You can adjust resource allocation and settings without data loss. A storage add-on changes only its label and disk_size: size, cpu_size and ram_size are refused with 422. Storage mounted from a shared storage service changes only its label: disk_size is refused with 422 as well.
curl --request PUT \
--url https://app.miget.com/api/v1/apps/{uuid}/addons/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"ram_size": 123,
"disk_size": 123,
"cpu_size": 123,
"size": "<string>",
"public_access": true,
"backup_enabled": true,
"scheduled_backup": "<string>",
"auto_sleep": true
}
'import requests
url = "https://app.miget.com/api/v1/apps/{uuid}/addons/{id}"
payload = {
"label": "<string>",
"ram_size": 123,
"disk_size": 123,
"cpu_size": 123,
"size": "<string>",
"public_access": True,
"backup_enabled": True,
"scheduled_backup": "<string>",
"auto_sleep": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: '<string>',
ram_size: 123,
disk_size: 123,
cpu_size: 123,
size: '<string>',
public_access: true,
backup_enabled: true,
scheduled_backup: '<string>',
auto_sleep: true
})
};
fetch('https://app.miget.com/api/v1/apps/{uuid}/addons/{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://app.miget.com/api/v1/apps/{uuid}/addons/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'label' => '<string>',
'ram_size' => 123,
'disk_size' => 123,
'cpu_size' => 123,
'size' => '<string>',
'public_access' => true,
'backup_enabled' => true,
'scheduled_backup' => '<string>',
'auto_sleep' => true
]),
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://app.miget.com/api/v1/apps/{uuid}/addons/{id}"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"ram_size\": 123,\n \"disk_size\": 123,\n \"cpu_size\": 123,\n \"size\": \"<string>\",\n \"public_access\": true,\n \"backup_enabled\": true,\n \"scheduled_backup\": \"<string>\",\n \"auto_sleep\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.miget.com/api/v1/apps/{uuid}/addons/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"ram_size\": 123,\n \"disk_size\": 123,\n \"cpu_size\": 123,\n \"size\": \"<string>\",\n \"public_access\": true,\n \"backup_enabled\": true,\n \"scheduled_backup\": \"<string>\",\n \"auto_sleep\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.miget.com/api/v1/apps/{uuid}/addons/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"ram_size\": 123,\n \"disk_size\": 123,\n \"cpu_size\": 123,\n \"size\": \"<string>\",\n \"public_access\": true,\n \"backup_enabled\": true,\n \"scheduled_backup\": \"<string>\",\n \"auto_sleep\": true\n}"
response = http.request(request)
puts response.read_body{
"uuid": "<string>",
"name": "<string>",
"type": "<string>",
"label": "<string>",
"state": "<string>",
"quota": {},
"ram_size": 123,
"disk_size": 123,
"cpu_size": 123,
"service_id": 123,
"auto_sleep": true,
"sleeps_when_idle": true,
"backup_enabled": true,
"scheduled_backup": "<string>",
"role": "<string>",
"primary_addon_uuid": "<string>",
"replicas": [
{}
],
"settings": {},
"var": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"connection_details": {
"internal": {
"hostname": "my-addon-xxx.internal",
"database": "db_name",
"port": 5432,
"username": "db_user",
"password": "db_password",
"connection_url": "postgres://db_user:db_password@my-addon-xxx.internal:5432/db_name"
},
"external": {
"external_connection_url": "postgres://db_user:db_password@my-addon-xxx.external:5432/db_name",
"psql_command": "PGPASSWORD=db_password psql -h my-addon-xxx.external -U db_user db_name"
}
}
}Authorizations
Body
Update an add-on
Response
Update an add-on
Api_V1_Entities_Addon model
Current state. While provisioning: pending, processing, creating, stopped. Once running, the live Kubernetes status: healthy (postgres/mysql/valkey), bound (storage), or running when the status is unavailable. Unhealthy: degraded, degradated, failing, lost, crashloopbackoff, failed
Whether the database hibernates when idle: a PostgreSQL database that is not a replica, on free compute or with auto_sleep true, or, on an application, with auto_sleep true and an application that sleeps when idle. A database on an application sleeps only with its application
Connection details for the addon
{
"internal": {
"hostname": "my-addon-xxx.internal",
"database": "db_name",
"port": 5432,
"username": "db_user",
"password": "db_password",
"connection_url": "postgres://db_user:db_password@my-addon-xxx.internal:5432/db_name"
},
"external": {
"external_connection_url": "postgres://db_user:db_password@my-addon-xxx.external:5432/db_name",
"psql_command": "PGPASSWORD=db_password psql -h my-addon-xxx.external -U db_user db_name"
}
}

