Create Deployment With Cluster
POST
/deployments/with-cluster
const url = 'https://api.mengi.cloud/deployments/with-cluster';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"cluster_name":"example","provider":"example","region":"example","tier":"shared","server_type":"example","deployment_name":"example","app_type":"helm","config":{},"cpu_request":0.5,"memory_request_mb":512,"replicas":1,"container_port":8080,"environment_variables":["example"],"storage_size_gb":1,"volumes":[{"path":"example","sizeGb":10,"purpose":"example"}],"run_as_uid":1,"docker_image":"example","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"}'};
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/with-cluster \ --header 'Content-Type: application/json' \ --data '{ "cluster_name": "example", "provider": "example", "region": "example", "tier": "shared", "server_type": "example", "deployment_name": "example", "app_type": "helm", "config": {}, "cpu_request": 0.5, "memory_request_mb": 512, "replicas": 1, "container_port": 8080, "environment_variables": [ "example" ], "storage_size_gb": 1, "volumes": [ { "path": "example", "sizeGb": 10, "purpose": "example" } ], "run_as_uid": 1, "docker_image": "example", "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" }'Create a new cluster and deployment in one transaction.
Request Body required
Section titled “Request Body required ” Media type application/json
ClusterAndDeploymentCreate
Combined request for creating a cluster and deployment together.
object
cluster_name
required
Cluster Name
string
provider
required
Provider
string
region
required
Region
string
tier
ClusterTier
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" } ]}