curl --request POST \
--url https://api.gcore.com/cloud/v1/caas/{project_id}/{region_id}/containers \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"commands": "python3 app.py -m test",
"description": "My first container",
"envs": {
"ENVIRONMENT_VARIABLE": "value 2",
"ENV_VAR": "value 1"
},
"flavor": "250mCPU-512MiB",
"image": "nginx:latest",
"is_api_key_auth": false,
"is_disabled": false,
"listening_port": 80,
"logging": {
"destination_region_id": 1,
"enabled": true,
"retention_policy": {
"period": 45
},
"topic_name": "my-log-name"
},
"name": "nginx",
"pull_secret": "my-secret",
"scale": {
"max": 2,
"min": 1
},
"timeout": 5
}'
{
"tasks": [
"d478ae29-dedc-4869-82f0-96104425f565"
]
}
Create a new container with the specified configuration.
curl --request POST \
--url https://api.gcore.com/cloud/v1/caas/{project_id}/{region_id}/containers \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"commands": "python3 app.py -m test",
"description": "My first container",
"envs": {
"ENVIRONMENT_VARIABLE": "value 2",
"ENV_VAR": "value 1"
},
"flavor": "250mCPU-512MiB",
"image": "nginx:latest",
"is_api_key_auth": false,
"is_disabled": false,
"listening_port": 80,
"logging": {
"destination_region_id": 1,
"enabled": true,
"retention_policy": {
"period": 45
},
"topic_name": "my-log-name"
},
"name": "nginx",
"pull_secret": "my-secret",
"scale": {
"max": 2,
"min": 1
},
"timeout": 5
}'
{
"tasks": [
"d478ae29-dedc-4869-82f0-96104425f565"
]
}
API key for authentication. Make sure to include the word apikey
, followed by a single space and then your token.
Example: apikey 1234$abcdef
Project id
1
Region id
1
OK
The response is of type object
.
Was this page helpful?