CreateEnv Parameters

Parameters for CreateEnvironment API

A new platform environment can be created through the CLI, a direct API request, or a JPS manifest. The CreateEnvironment method supports detailed topology settings through the 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 when nodeType is docker.
~/jelastic/environment/control/createenvironment \
  --env '{...}' \
  --nodes '[{...}]'

Common Environment Configurations

The following parameters are specified inside the env object.

NameDescriptionTypeExampleMandatory
regionEnvironment region. Available values depend on the hosting provider.stringdefault_hn_groupNo
ishaenabledEnables High Availability for supported legacy Java stacks.booleantrue, falseNo
engineProgramming-language version.stringjava8, php5.5Yes, except Docker-based environments
displayNameEnvironment alias.stringmy-env-aliasNo
sslstateEnables or disables Built-In SSL.booleantrue, falseNo
shortdomainName of the environment to create.stringmy-cli-envYes
--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.

NameDescriptionTypeExampleMandatory
extipAttaches a Public IP.booleantrue, falseNo
countNumber of nodes in the layer.integer1, 2, 3No
fixedCloudletsNumber of fixed Cloudlets.integer16Yes
flexibleCloudletsNumber of flexible Cloudlets. It cannot be lower than fixedCloudlets.integer32Yes
displayNameNode alias.stringmy-node-aliasNo
nodeTypeSoftware stack identifier.stringdocker, tomcat7, mysql5, apache2Yes
dockerDocker-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.

NameDescriptionTypeExampleMandatory
cmdContainer run command.stringrun.shNo
imageDocker image name with an optional tag.stringubuntu, jelastic/tomcat8:latestYes
nodeGroupEnvironment layer where the image should be placed.stringcp, bl, sqldb, nosqldb, cache, storageNo
linksLinks to other containers in the environment.array["cp:alias","sqldb:DB"]No
envContainer environment variables.object{"VAR":"value"}No
registryPrivate-registry credentials and endpoint.object{...}No
volumesLocal persistent volume paths.array["/data"]No
volumeMountsMounted remote data directories.object{...}No
volumesFromNodes 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": [{...}]
}
When nodeGroup is omitted, the custom image is added to the Extra layer.

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"
}
Credential security: Do not store private-registry passwords in public repositories, shared shell history, or exposed configuration files.

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"
    ]
  }
}]'
Validation: Confirm that flexibleCloudlets is not lower than fixedCloudlets, all required stack identifiers are valid, and the selected region is enabled for the account.

What’s next?