Create Deployment
POST
/deployments
const url = 'https://api.mengi.cloud/deployments';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"cluster_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","name":"example","app_type":"web_app","config":{},"cpu_request":0.5,"memory_request_mb":512,"replicas":1,"container_port":8080,"environment_variables":[{"name":"example","value":"example","secret_ref":"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"}'};
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 \ --header 'Content-Type: application/json' \ --data '{ "cluster_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "app_type": "web_app", "config": {}, "cpu_request": 0.5, "memory_request_mb": 512, "replicas": 1, "container_port": 8080, "environment_variables": [ { "name": "example", "value": "example", "secret_ref": "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" }'Request Body required
Section titled “Request Body required ” Media type application/json
DeploymentCreate
object
cluster_id
required
Cluster Id
string format: uuid
name
required
Name
string
app_type
AppType
string
environment_variables
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" } ]}