CreateEnv Parameters
Parameters for CreateEnvironment API
env, nodes, and Docker-specific configuration arrays.
CreateEnvironment Structure
The topology parameters are divided into three main sections:
env— general environment settings.nodes— server types, counts, resource limits, and Public IP settings.docker— specialised settings used whennodeTypeisdocker.
~/jelastic/environment/control/createenvironment \
--env '{...}' \
--nodes '[{...}]'
Common Environment Configurations
The following parameters are specified inside the env object.
| Name | Description | Type | Example | Mandatory |
|---|---|---|---|---|
region | Environment region. Available values depend on the hosting provider. | string | default_hn_group | No |
ishaenabled | Enables High Availability for supported legacy Java stacks. | boolean | true, false | No |
engine | Programming-language version. | string | java8, php5.5 | Yes, except Docker-based environments |
displayName | Environment alias. | string | my-env-alias | No |
sslstate | Enables or disables Built-In SSL. | boolean | true, false | No |
shortdomain | Name of the environment to create. | string | my-cli-env | Yes |
--env '{
"region": "default_hn_group",
"ishaenabled": "false",
"engine": "java7",
"displayName": "my-env-alias",
"sslstate": "true",
"shortdomain": "my-cli-env"
}'
Node Configurations
The nodes array defines each server layer and its resource limits.
| Name | Description | Type | Example | Mandatory |
|---|---|---|---|---|
extip | Attaches a Public IP. | boolean | true, false | No |
count | Number of nodes in the layer. | integer | 1, 2, 3 | No |
fixedCloudlets | Number of fixed Cloudlets. | integer | 16 | Yes |
flexibleCloudlets | Number of flexible Cloudlets. It cannot be lower than fixedCloudlets. | integer | 32 | Yes |
displayName | Node alias. | string | my-node-alias | No |
nodeType | Software stack identifier. | string | docker, tomcat7, mysql5, apache2 | Yes |
docker | Docker-specific configuration object. | object | {...} | Required for Docker node type |
--nodes '[{
"extip": "true",
"count": "2",
"fixedCloudlets": "16",
"flexibleCloudlets": "32",
"displayName": "my-node-alias",
"nodeType": "docker",
"docker": {...}
}]'
Docker-Based Configurations
The docker subsection contains the specialised parameters required for custom-container deployment.
| Name | Description | Type | Example | Mandatory |
|---|---|---|---|---|
cmd | Container run command. | string | run.sh | No |
image | Docker image name with an optional tag. | string | ubuntu, jelastic/tomcat8:latest | Yes |
nodeGroup | Environment layer where the image should be placed. | string | cp, bl, sqldb, nosqldb, cache, storage | No |
links | Links to other containers in the environment. | array | ["cp:alias","sqldb:DB"] | No |
env | Container environment variables. | object | {"VAR":"value"} | No |
registry | Private-registry credentials and endpoint. | object | {...} | No |
volumes | Local persistent volume paths. | array | ["/data"] | No |
volumeMounts | Mounted remote data directories. | object | {...} | No |
volumesFrom | Nodes from which volume settings should be imported. | array | [{...}] | No |
"docker": {
"cmd": "run.sh",
"image": "jelastic/tomcat8:latest",
"nodeGroup": "cp",
"links": [...],
"env": {...},
"registry": {...},
"volumes": [...],
"volumeMounts": {...},
"volumesFrom": [{...}]
}
nodeGroup is omitted, the custom image is added to the Extra layer.
Container Links
The links array connects Docker containers inside one environment and assigns an alias to each link.
"links": [ "cp:alias", "sqldb:DB" ]
Each value follows the nodeGroup:alias format.
Environment Variables
Use the Docker env object to declare container environment variables:
"env": {
"DB_HOST": "database",
"APP_MODE": "production"
}
Private Registry
When the image is stored in a private registry, provide the registry endpoint and credentials inside the registry configuration.
"registry": {
"url": "registry.example.com",
"user": "registry-user",
"password": "registry-password"
}
Volumes and Mounts
Local Volumes
"volumes": [ "/var/lib/app", "/var/log/app" ]
Mounted Directories
"volumeMounts": {
"/mnt/shared": {
"sourcePath": "/data",
"sourceNodeId": 459315,
"readOnly": false
}
}
A mount source can be identified by a source node ID, a source node group, or a source host, depending on the storage topology.
Volumes from Another Node
"volumesFrom": [{
"sourceNodeId": 459315,
"readOnly": false,
"volumes": [
"/var/lib/app"
]
}]
Combined Example
~/jelastic/environment/control/createenvironment \
--env '{
"region": "default_hn_group",
"shortdomain": "my-docker-env",
"displayName": "My Docker Environment",
"sslstate": "true"
}' \
--nodes '[{
"nodeType": "docker",
"count": 1,
"fixedCloudlets": 1,
"flexibleCloudlets": 8,
"extip": false,
"docker": {
"image": "jelastic/tomcat8:latest",
"nodeGroup": "cp",
"cmd": "run.sh",
"links": ["sqldb:DB"],
"env": {
"APP_MODE": "production"
},
"volumes": [
"/var/lib/app"
]
}
}]'
flexibleCloudlets is not lower than fixedCloudlets, all required stack identifiers are valid, and the selected region is enabled for the account.
