curl --request POST \
--url https://app.miget.com/api/v1/apps \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"name": "<string>",
"project_id": "<string>",
"resource_id": "<string>",
"region_code": "<string>",
"ram_size": 123,
"cpu_size": 123,
"size": "<string>",
"private_access": true,
"auto_sleep": true,
"vpc_uuid": "<string>",
"vpc_subnet_uuid": "<string>",
"vpc_static_ip": true,
"deployment_config": {
"credential_id": "<string>",
"image_url": "<string>",
"tag": "<string>",
"repository": "<string>",
"repository_url": "<string>",
"branch": "<string>",
"dockerfile_path": "<string>",
"build_context": "<string>",
"project_path": "<string>",
"run_command": "<string>",
"language": "<string>",
"build_command": "<string>",
"pre_deploy_command": "<string>",
"post_deploy_command": "<string>",
"use_dhi": true,
"auto_deploy_enabled": true,
"auto_deploy_branch": "<string>",
"parent_app_id": "<string>",
"parent_image_auto_sync": true,
"ssh_keys": [
"<string>"
],
"command": [
"<string>"
],
"args": [
"<string>"
]
},
"app_vars_attributes": [
{
"key": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://app.miget.com/api/v1/apps"
payload = {
"label": "<string>",
"name": "<string>",
"project_id": "<string>",
"resource_id": "<string>",
"region_code": "<string>",
"ram_size": 123,
"cpu_size": 123,
"size": "<string>",
"private_access": True,
"auto_sleep": True,
"vpc_uuid": "<string>",
"vpc_subnet_uuid": "<string>",
"vpc_static_ip": True,
"deployment_config": {
"credential_id": "<string>",
"image_url": "<string>",
"tag": "<string>",
"repository": "<string>",
"repository_url": "<string>",
"branch": "<string>",
"dockerfile_path": "<string>",
"build_context": "<string>",
"project_path": "<string>",
"run_command": "<string>",
"language": "<string>",
"build_command": "<string>",
"pre_deploy_command": "<string>",
"post_deploy_command": "<string>",
"use_dhi": True,
"auto_deploy_enabled": True,
"auto_deploy_branch": "<string>",
"parent_app_id": "<string>",
"parent_image_auto_sync": True,
"ssh_keys": ["<string>"],
"command": ["<string>"],
"args": ["<string>"]
},
"app_vars_attributes": [
{
"key": "<string>",
"value": "<string>"
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: '<string>',
name: '<string>',
project_id: '<string>',
resource_id: '<string>',
region_code: '<string>',
ram_size: 123,
cpu_size: 123,
size: '<string>',
private_access: true,
auto_sleep: true,
vpc_uuid: '<string>',
vpc_subnet_uuid: '<string>',
vpc_static_ip: true,
deployment_config: {
credential_id: '<string>',
image_url: '<string>',
tag: '<string>',
repository: '<string>',
repository_url: '<string>',
branch: '<string>',
dockerfile_path: '<string>',
build_context: '<string>',
project_path: '<string>',
run_command: '<string>',
language: '<string>',
build_command: '<string>',
pre_deploy_command: '<string>',
post_deploy_command: '<string>',
use_dhi: true,
auto_deploy_enabled: true,
auto_deploy_branch: '<string>',
parent_app_id: '<string>',
parent_image_auto_sync: true,
ssh_keys: ['<string>'],
command: ['<string>'],
args: ['<string>']
},
app_vars_attributes: [{key: '<string>', value: '<string>'}]
})
};
fetch('https://app.miget.com/api/v1/apps', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'label' => '<string>',
'name' => '<string>',
'project_id' => '<string>',
'resource_id' => '<string>',
'region_code' => '<string>',
'ram_size' => 123,
'cpu_size' => 123,
'size' => '<string>',
'private_access' => true,
'auto_sleep' => true,
'vpc_uuid' => '<string>',
'vpc_subnet_uuid' => '<string>',
'vpc_static_ip' => true,
'deployment_config' => [
'credential_id' => '<string>',
'image_url' => '<string>',
'tag' => '<string>',
'repository' => '<string>',
'repository_url' => '<string>',
'branch' => '<string>',
'dockerfile_path' => '<string>',
'build_context' => '<string>',
'project_path' => '<string>',
'run_command' => '<string>',
'language' => '<string>',
'build_command' => '<string>',
'pre_deploy_command' => '<string>',
'post_deploy_command' => '<string>',
'use_dhi' => true,
'auto_deploy_enabled' => true,
'auto_deploy_branch' => '<string>',
'parent_app_id' => '<string>',
'parent_image_auto_sync' => true,
'ssh_keys' => [
'<string>'
],
'command' => [
'<string>'
],
'args' => [
'<string>'
]
],
'app_vars_attributes' => [
[
'key' => '<string>',
'value' => '<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://app.miget.com/api/v1/apps"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"region_code\": \"<string>\",\n \"ram_size\": 123,\n \"cpu_size\": 123,\n \"size\": \"<string>\",\n \"private_access\": true,\n \"auto_sleep\": true,\n \"vpc_uuid\": \"<string>\",\n \"vpc_subnet_uuid\": \"<string>\",\n \"vpc_static_ip\": true,\n \"deployment_config\": {\n \"credential_id\": \"<string>\",\n \"image_url\": \"<string>\",\n \"tag\": \"<string>\",\n \"repository\": \"<string>\",\n \"repository_url\": \"<string>\",\n \"branch\": \"<string>\",\n \"dockerfile_path\": \"<string>\",\n \"build_context\": \"<string>\",\n \"project_path\": \"<string>\",\n \"run_command\": \"<string>\",\n \"language\": \"<string>\",\n \"build_command\": \"<string>\",\n \"pre_deploy_command\": \"<string>\",\n \"post_deploy_command\": \"<string>\",\n \"use_dhi\": true,\n \"auto_deploy_enabled\": true,\n \"auto_deploy_branch\": \"<string>\",\n \"parent_app_id\": \"<string>\",\n \"parent_image_auto_sync\": true,\n \"ssh_keys\": [\n \"<string>\"\n ],\n \"command\": [\n \"<string>\"\n ],\n \"args\": [\n \"<string>\"\n ]\n },\n \"app_vars_attributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://app.miget.com/api/v1/apps")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"region_code\": \"<string>\",\n \"ram_size\": 123,\n \"cpu_size\": 123,\n \"size\": \"<string>\",\n \"private_access\": true,\n \"auto_sleep\": true,\n \"vpc_uuid\": \"<string>\",\n \"vpc_subnet_uuid\": \"<string>\",\n \"vpc_static_ip\": true,\n \"deployment_config\": {\n \"credential_id\": \"<string>\",\n \"image_url\": \"<string>\",\n \"tag\": \"<string>\",\n \"repository\": \"<string>\",\n \"repository_url\": \"<string>\",\n \"branch\": \"<string>\",\n \"dockerfile_path\": \"<string>\",\n \"build_context\": \"<string>\",\n \"project_path\": \"<string>\",\n \"run_command\": \"<string>\",\n \"language\": \"<string>\",\n \"build_command\": \"<string>\",\n \"pre_deploy_command\": \"<string>\",\n \"post_deploy_command\": \"<string>\",\n \"use_dhi\": true,\n \"auto_deploy_enabled\": true,\n \"auto_deploy_branch\": \"<string>\",\n \"parent_app_id\": \"<string>\",\n \"parent_image_auto_sync\": true,\n \"ssh_keys\": [\n \"<string>\"\n ],\n \"command\": [\n \"<string>\"\n ],\n \"args\": [\n \"<string>\"\n ]\n },\n \"app_vars_attributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.miget.com/api/v1/apps")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"region_code\": \"<string>\",\n \"ram_size\": 123,\n \"cpu_size\": 123,\n \"size\": \"<string>\",\n \"private_access\": true,\n \"auto_sleep\": true,\n \"vpc_uuid\": \"<string>\",\n \"vpc_subnet_uuid\": \"<string>\",\n \"vpc_static_ip\": true,\n \"deployment_config\": {\n \"credential_id\": \"<string>\",\n \"image_url\": \"<string>\",\n \"tag\": \"<string>\",\n \"repository\": \"<string>\",\n \"repository_url\": \"<string>\",\n \"branch\": \"<string>\",\n \"dockerfile_path\": \"<string>\",\n \"build_context\": \"<string>\",\n \"project_path\": \"<string>\",\n \"run_command\": \"<string>\",\n \"language\": \"<string>\",\n \"build_command\": \"<string>\",\n \"pre_deploy_command\": \"<string>\",\n \"post_deploy_command\": \"<string>\",\n \"use_dhi\": true,\n \"auto_deploy_enabled\": true,\n \"auto_deploy_branch\": \"<string>\",\n \"parent_app_id\": \"<string>\",\n \"parent_image_auto_sync\": true,\n \"ssh_keys\": [\n \"<string>\"\n ],\n \"command\": [\n \"<string>\"\n ],\n \"args\": [\n \"<string>\"\n ]\n },\n \"app_vars_attributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"uuid": "<string>",
"name": "<string>",
"label": "<string>",
"state": "<string>",
"project_id": "<string>",
"deployment_method": "<string>",
"deployment_config": {},
"builder": "<string>",
"manage_dns_records": true,
"maintenance": true,
"auto_sleep": true,
"private_access": true,
"service_name": "<string>",
"internal_url": "<string>",
"public_url": "<string>",
"allow_connections": true,
"basic_auth_enabled": true,
"basic_auth_username": "<string>",
"quota": {},
"ram_size": 123,
"cpu_size": 123,
"resource_id": "<string>",
"vpc_uuid": "<string>",
"vpc_subnet_uuid": "<string>",
"project_variables_enabled": true,
"project_secret_files_enabled": true,
"health_checks": {},
"scaling_profile": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"billing": "resource",
"held_at_monthly_budget": true,
"miget": {
"uuid": "<string>",
"name": "<string>",
"state": "<string>",
"labels": [
"<string>"
],
"total_disk_size": 123,
"total_ram_size": 123,
"total_cpu_size": 123,
"total_used_disk_size": 123,
"total_used_ram_size": 123,
"total_used_cpu_size": 123,
"available_cpu_size": 123,
"available_disk_size": 123,
"available_ram_size": 123,
"region_code": "<string>",
"component_quantities": [
{
"code_name": "1gb-ram",
"quantity": 2
}
],
"assigned": true,
"project_ids": [
"<string>"
],
"cron_minutes": {
"included": 123,
"used": 123,
"remaining": 123
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"plan": {
"name": "<string>",
"code_name": "<string>",
"description": "<string>",
"plan_type": "<string>",
"ram_size": 123,
"disk_size": 123,
"cpu_size": 123,
"unit_price": 123
},
"components": [
{
"name": "<string>",
"code_name": "<string>",
"unit_price": 123
}
]
},
"region": {
"id": 123,
"name": "<string>",
"code": "<string>"
},
"addons": [
{
"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"
}
}
}
],
"cronjobs": [
{
"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"
}
}
}
],
"workers": [
{
"name": "<string>",
"state": "running",
"replicas": 123,
"quota": {}
}
]
}Create a new application
Creates a new application in the specified project. You can choose between auto detection (Miget Buildpacks) for automatic build detection, Dockerfile for custom container builds, or custom builder for language-specific build detection.
curl --request POST \
--url https://app.miget.com/api/v1/apps \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"name": "<string>",
"project_id": "<string>",
"resource_id": "<string>",
"region_code": "<string>",
"ram_size": 123,
"cpu_size": 123,
"size": "<string>",
"private_access": true,
"auto_sleep": true,
"vpc_uuid": "<string>",
"vpc_subnet_uuid": "<string>",
"vpc_static_ip": true,
"deployment_config": {
"credential_id": "<string>",
"image_url": "<string>",
"tag": "<string>",
"repository": "<string>",
"repository_url": "<string>",
"branch": "<string>",
"dockerfile_path": "<string>",
"build_context": "<string>",
"project_path": "<string>",
"run_command": "<string>",
"language": "<string>",
"build_command": "<string>",
"pre_deploy_command": "<string>",
"post_deploy_command": "<string>",
"use_dhi": true,
"auto_deploy_enabled": true,
"auto_deploy_branch": "<string>",
"parent_app_id": "<string>",
"parent_image_auto_sync": true,
"ssh_keys": [
"<string>"
],
"command": [
"<string>"
],
"args": [
"<string>"
]
},
"app_vars_attributes": [
{
"key": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://app.miget.com/api/v1/apps"
payload = {
"label": "<string>",
"name": "<string>",
"project_id": "<string>",
"resource_id": "<string>",
"region_code": "<string>",
"ram_size": 123,
"cpu_size": 123,
"size": "<string>",
"private_access": True,
"auto_sleep": True,
"vpc_uuid": "<string>",
"vpc_subnet_uuid": "<string>",
"vpc_static_ip": True,
"deployment_config": {
"credential_id": "<string>",
"image_url": "<string>",
"tag": "<string>",
"repository": "<string>",
"repository_url": "<string>",
"branch": "<string>",
"dockerfile_path": "<string>",
"build_context": "<string>",
"project_path": "<string>",
"run_command": "<string>",
"language": "<string>",
"build_command": "<string>",
"pre_deploy_command": "<string>",
"post_deploy_command": "<string>",
"use_dhi": True,
"auto_deploy_enabled": True,
"auto_deploy_branch": "<string>",
"parent_app_id": "<string>",
"parent_image_auto_sync": True,
"ssh_keys": ["<string>"],
"command": ["<string>"],
"args": ["<string>"]
},
"app_vars_attributes": [
{
"key": "<string>",
"value": "<string>"
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: '<string>',
name: '<string>',
project_id: '<string>',
resource_id: '<string>',
region_code: '<string>',
ram_size: 123,
cpu_size: 123,
size: '<string>',
private_access: true,
auto_sleep: true,
vpc_uuid: '<string>',
vpc_subnet_uuid: '<string>',
vpc_static_ip: true,
deployment_config: {
credential_id: '<string>',
image_url: '<string>',
tag: '<string>',
repository: '<string>',
repository_url: '<string>',
branch: '<string>',
dockerfile_path: '<string>',
build_context: '<string>',
project_path: '<string>',
run_command: '<string>',
language: '<string>',
build_command: '<string>',
pre_deploy_command: '<string>',
post_deploy_command: '<string>',
use_dhi: true,
auto_deploy_enabled: true,
auto_deploy_branch: '<string>',
parent_app_id: '<string>',
parent_image_auto_sync: true,
ssh_keys: ['<string>'],
command: ['<string>'],
args: ['<string>']
},
app_vars_attributes: [{key: '<string>', value: '<string>'}]
})
};
fetch('https://app.miget.com/api/v1/apps', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'label' => '<string>',
'name' => '<string>',
'project_id' => '<string>',
'resource_id' => '<string>',
'region_code' => '<string>',
'ram_size' => 123,
'cpu_size' => 123,
'size' => '<string>',
'private_access' => true,
'auto_sleep' => true,
'vpc_uuid' => '<string>',
'vpc_subnet_uuid' => '<string>',
'vpc_static_ip' => true,
'deployment_config' => [
'credential_id' => '<string>',
'image_url' => '<string>',
'tag' => '<string>',
'repository' => '<string>',
'repository_url' => '<string>',
'branch' => '<string>',
'dockerfile_path' => '<string>',
'build_context' => '<string>',
'project_path' => '<string>',
'run_command' => '<string>',
'language' => '<string>',
'build_command' => '<string>',
'pre_deploy_command' => '<string>',
'post_deploy_command' => '<string>',
'use_dhi' => true,
'auto_deploy_enabled' => true,
'auto_deploy_branch' => '<string>',
'parent_app_id' => '<string>',
'parent_image_auto_sync' => true,
'ssh_keys' => [
'<string>'
],
'command' => [
'<string>'
],
'args' => [
'<string>'
]
],
'app_vars_attributes' => [
[
'key' => '<string>',
'value' => '<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://app.miget.com/api/v1/apps"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"region_code\": \"<string>\",\n \"ram_size\": 123,\n \"cpu_size\": 123,\n \"size\": \"<string>\",\n \"private_access\": true,\n \"auto_sleep\": true,\n \"vpc_uuid\": \"<string>\",\n \"vpc_subnet_uuid\": \"<string>\",\n \"vpc_static_ip\": true,\n \"deployment_config\": {\n \"credential_id\": \"<string>\",\n \"image_url\": \"<string>\",\n \"tag\": \"<string>\",\n \"repository\": \"<string>\",\n \"repository_url\": \"<string>\",\n \"branch\": \"<string>\",\n \"dockerfile_path\": \"<string>\",\n \"build_context\": \"<string>\",\n \"project_path\": \"<string>\",\n \"run_command\": \"<string>\",\n \"language\": \"<string>\",\n \"build_command\": \"<string>\",\n \"pre_deploy_command\": \"<string>\",\n \"post_deploy_command\": \"<string>\",\n \"use_dhi\": true,\n \"auto_deploy_enabled\": true,\n \"auto_deploy_branch\": \"<string>\",\n \"parent_app_id\": \"<string>\",\n \"parent_image_auto_sync\": true,\n \"ssh_keys\": [\n \"<string>\"\n ],\n \"command\": [\n \"<string>\"\n ],\n \"args\": [\n \"<string>\"\n ]\n },\n \"app_vars_attributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://app.miget.com/api/v1/apps")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"region_code\": \"<string>\",\n \"ram_size\": 123,\n \"cpu_size\": 123,\n \"size\": \"<string>\",\n \"private_access\": true,\n \"auto_sleep\": true,\n \"vpc_uuid\": \"<string>\",\n \"vpc_subnet_uuid\": \"<string>\",\n \"vpc_static_ip\": true,\n \"deployment_config\": {\n \"credential_id\": \"<string>\",\n \"image_url\": \"<string>\",\n \"tag\": \"<string>\",\n \"repository\": \"<string>\",\n \"repository_url\": \"<string>\",\n \"branch\": \"<string>\",\n \"dockerfile_path\": \"<string>\",\n \"build_context\": \"<string>\",\n \"project_path\": \"<string>\",\n \"run_command\": \"<string>\",\n \"language\": \"<string>\",\n \"build_command\": \"<string>\",\n \"pre_deploy_command\": \"<string>\",\n \"post_deploy_command\": \"<string>\",\n \"use_dhi\": true,\n \"auto_deploy_enabled\": true,\n \"auto_deploy_branch\": \"<string>\",\n \"parent_app_id\": \"<string>\",\n \"parent_image_auto_sync\": true,\n \"ssh_keys\": [\n \"<string>\"\n ],\n \"command\": [\n \"<string>\"\n ],\n \"args\": [\n \"<string>\"\n ]\n },\n \"app_vars_attributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.miget.com/api/v1/apps")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"region_code\": \"<string>\",\n \"ram_size\": 123,\n \"cpu_size\": 123,\n \"size\": \"<string>\",\n \"private_access\": true,\n \"auto_sleep\": true,\n \"vpc_uuid\": \"<string>\",\n \"vpc_subnet_uuid\": \"<string>\",\n \"vpc_static_ip\": true,\n \"deployment_config\": {\n \"credential_id\": \"<string>\",\n \"image_url\": \"<string>\",\n \"tag\": \"<string>\",\n \"repository\": \"<string>\",\n \"repository_url\": \"<string>\",\n \"branch\": \"<string>\",\n \"dockerfile_path\": \"<string>\",\n \"build_context\": \"<string>\",\n \"project_path\": \"<string>\",\n \"run_command\": \"<string>\",\n \"language\": \"<string>\",\n \"build_command\": \"<string>\",\n \"pre_deploy_command\": \"<string>\",\n \"post_deploy_command\": \"<string>\",\n \"use_dhi\": true,\n \"auto_deploy_enabled\": true,\n \"auto_deploy_branch\": \"<string>\",\n \"parent_app_id\": \"<string>\",\n \"parent_image_auto_sync\": true,\n \"ssh_keys\": [\n \"<string>\"\n ],\n \"command\": [\n \"<string>\"\n ],\n \"args\": [\n \"<string>\"\n ]\n },\n \"app_vars_attributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"uuid": "<string>",
"name": "<string>",
"label": "<string>",
"state": "<string>",
"project_id": "<string>",
"deployment_method": "<string>",
"deployment_config": {},
"builder": "<string>",
"manage_dns_records": true,
"maintenance": true,
"auto_sleep": true,
"private_access": true,
"service_name": "<string>",
"internal_url": "<string>",
"public_url": "<string>",
"allow_connections": true,
"basic_auth_enabled": true,
"basic_auth_username": "<string>",
"quota": {},
"ram_size": 123,
"cpu_size": 123,
"resource_id": "<string>",
"vpc_uuid": "<string>",
"vpc_subnet_uuid": "<string>",
"project_variables_enabled": true,
"project_secret_files_enabled": true,
"health_checks": {},
"scaling_profile": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"billing": "resource",
"held_at_monthly_budget": true,
"miget": {
"uuid": "<string>",
"name": "<string>",
"state": "<string>",
"labels": [
"<string>"
],
"total_disk_size": 123,
"total_ram_size": 123,
"total_cpu_size": 123,
"total_used_disk_size": 123,
"total_used_ram_size": 123,
"total_used_cpu_size": 123,
"available_cpu_size": 123,
"available_disk_size": 123,
"available_ram_size": 123,
"region_code": "<string>",
"component_quantities": [
{
"code_name": "1gb-ram",
"quantity": 2
}
],
"assigned": true,
"project_ids": [
"<string>"
],
"cron_minutes": {
"included": 123,
"used": 123,
"remaining": 123
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"plan": {
"name": "<string>",
"code_name": "<string>",
"description": "<string>",
"plan_type": "<string>",
"ram_size": 123,
"disk_size": 123,
"cpu_size": 123,
"unit_price": 123
},
"components": [
{
"name": "<string>",
"code_name": "<string>",
"unit_price": 123
}
]
},
"region": {
"id": 123,
"name": "<string>",
"code": "<string>"
},
"addons": [
{
"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"
}
}
}
],
"cronjobs": [
{
"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"
}
}
}
],
"workers": [
{
"name": "<string>",
"state": "running",
"replicas": 123,
"quota": {}
}
]
}Authorizations
Body
Create a new application
Where it runs: 'resource' (default, on the resource named by resource_id), 'pay_per_use' (without a resource, paying for what it reserves while it runs; not on an enterprise contract) or 'workspace_pool' (without a resource, in an enterprise contract's pool; refused with 422 when the pool has no room)
resource, pay_per_use, workspace_pool Give the app a fixed address on the subnet it joins instead of one that changes whenever its pod is replaced. Ignored unless vpc_uuid or vpc_subnet_uuid is given. The app must run a single replica without autoscaling, and deployments then replace the pod instead of rolling it, which means a short downtime on every deploy. The address is returned by the VPC attachments endpoints (address_v4, and address_v6 when the subnet has an IPv6 range). Defaults to false.
Deployment method: 'git_push', 'public_git', 'github', 'container_registry', 'parent_image', or 'kamal'. 'container_registry' requires a paid plan on the chosen resource; on a free plan the request is rejected with 422.
git_push, parent_image, container_registry, github, public_git, kamal, static_site Response
Create a new application
Api_V1_Entities_App model
Current state. While provisioning: pending, assigned, start_scheduled, started, deploying, cloning, stop_scheduled, restart_scheduled, stopped, blocked. An app that sleeps when idle (free plan, free compute, or auto_sleep) with no recent traffic: sleeping, until the next request wakes it. Once started, the live Kubernetes status: running, failed, or problem (pods failing while replicas are up)
Health check settings, keyed by the params of PUT /apps/{uuid}/health_checks: {liveness,readiness,startup}_probe_enabled (boolean), {liveness,readiness,startup}probe_path (string), {liveness,readiness,startup}probe{initial_delay_seconds,timeout_seconds,period_seconds,failure_threshold} (integer) and {liveness,readiness,startup}{in_app,email}_failure_notification_enabled (boolean). Values are those stored for the app; a path or number that was never set is null and a flag that was never set is false
Scaling settings, keyed by the params of PUT /apps/{uuid}/scaling_profile: replicas (integer, fixed instance count used when auto_scaling_enabled is false), auto_scaling_enabled (boolean), auto_min_replicas and auto_max_replicas (integer), scaling_start_time and scaling_end_time (HH:MM strings, null when no scheduled window is set), cpu_threshold and memory_threshold (integer percent). When the app has no scaling profile it runs one instance: replicas is 1, auto_scaling_enabled is false and the other keys are null
True while an application on Usage Billing runs on one replica because it reached the monthly budget of its scaling profile. A scaling profile that would run more replicas is refused with 422 until the next billing cycle, or until the budget is raised above what it spent, removed, or stop_at_budget_limit_enabled is turned off

