Create App Hosting Deployment
POST
/deployments/app-hosting
const url = 'https://api.mengi.cloud/deployments/app-hosting';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"geographic_region":"example","deployment_name":"example","app_type":"helm","config":{},"cpu_request":0.5,"memory_request_mb":512,"replicas":1,"container_port":8080,"environment_variables":["example"],"docker_image":"example","storage_size_gb":1,"volumes":[{"path":"example","sizeGb":10,"purpose":"example"}],"run_as_uid":1,"deployment_type":"docker","helm_repo_url":"example","helm_chart_name":"example","helm_chart_version":"example","custom_values_yaml":"example","image_update_strategy":"example","image_update_constraint":"example","image_allow_tags":"example","image_ignore_tags":"example","kubernetes_version":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.mengi.cloud/deployments/app-hosting \ --header 'Content-Type: application/json' \ --data '{ "geographic_region": "example", "deployment_name": "example", "app_type": "helm", "config": {}, "cpu_request": 0.5, "memory_request_mb": 512, "replicas": 1, "container_port": 8080, "environment_variables": [ "example" ], "docker_image": "example", "storage_size_gb": 1, "volumes": [ { "path": "example", "sizeGb": 10, "purpose": "example" } ], "run_as_uid": 1, "deployment_type": "docker", "helm_repo_url": "example", "helm_chart_name": "example", "helm_chart_version": "example", "custom_values_yaml": "example", "image_update_strategy": "example", "image_update_constraint": "example", "image_allow_tags": "example", "image_ignore_tags": "example", "kubernetes_version": "example" }'Create a deployment on App Hosting infrastructure.
Each App Hosting deployment gets its own vCluster running on the shared host cluster infrastructure. This provides isolated Kubernetes environments with minimal resource overhead.
This will:
- Pick the best available location for the geographic region
- Create a vCluster (tier=SHARED) for this deployment
- Trigger app-hosting job to provision vCluster + deploy the app
Request Body required
Section titled “Request Body required ” Media type application/json
AppHostingDeploymentCreate
Request for creating an App Hosting deployment on shared infrastructure.
object
geographic_region
required
Geographic Region
string
deployment_name
required
Deployment Name
string
app_type
App Type
string
volumes
Any of:
Array<object>
VolumeConfigVolume configuration for persistent storage.
null
deployment_type
Deployment Type
string
Responses
Section titled “ Responses ”Successful Response
Media type application/json
DeploymentResponse
object
id
required
Id
string format: uuid
user_id
required
User Id
string format: uuid
cluster_id
required
Cluster Id
string format: uuid
name
required
Name
string
app_type
required
AppType
string
status
required
DeploymentStatus
string
is_adopted
Is Adopted
boolean
created_at
required
Created At
string format: date-time
updated_at
required
Updated At
string format: date-time
Example
{ "app_type": "web_app", "status": "pending", "is_adopted": false}Validation Error
Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}