Environment Creation
CLI Tutorial: Environment Creation
Create an Environment with CLI Parameters
The most direct method is to provide the environment and node parameters in the createenvironment command.
~/jelastic/environment/control/createenvironment --env '{"shortdomain" : "{env_name}", "engine" : "{engine_type}"}' --nodes '[{"nodeType" : "{node_type}", "fixedCloudlets" : {cloudlets_amount}, "flexibleCloudlets" : {cloudlets_amount}}]'
{env_name}Name of the new environment.{engine_type}Engine used by the environment.{node_type}Identifier of the required software stack.{cloudlets_amount}Number of fixed and flexible Cloudlets assigned to the node.
"result": 0 means that the operation completed successfully without errors.Create an Environment from a JSON File
For reusable configurations, store the complete environment topology in a JSON file. The same file can then be used repeatedly without entering all parameters for every deployment.
{
"env": {
"shortdomain": "{env_name}",
"engine": "{engine_type}"
},
"nodes": [
{
"nodeType": "{node_type}",
"fixedCloudlets": "{cloudlets_amount}",
"flexibleCloudlets": "{cloudlets_amount}"
}
]
}
After replacing the placeholders, run the environment-creation method with the --myparams option:
~/jelastic/environment/control/createenvironment --myparams {path_to_file}
Provide the full path to the JSON file, or only its filename when it is stored in the user’s home directory.
Override JSON Environment Settings
The reusable JSON topology can be combined with command-line values that override or add selected environment settings.
shortdomainregiondisplayName
For example, overriding shortdomain allows the same JSON topology to create another environment under a different name.

Create a Docker-Based Environment
A Docker-based environment uses a similar command but requires the Docker node type and image information.
~/jelastic/environment/control/createenvironment --env '{"shortdomain" : "{env_name}"}' --nodes '[{"nodeType" : "docker", "fixedCloudlets" : {cloudlets_amount}, "flexibleCloudlets" : {cloudlets_amount}, "docker" : {"image" : "{image_name}"}}]'
- Set
nodeTypetodocker. - Replace
{image_name}with the Docker image address. - A full image address can follow the format
server.com/images/image_name:tag. - For an image from the public Registry Hub, the registry hostname can be omitted.
- The version tag after
:is optional. - For a private registry, add a
registryparameter containing its URL, username, and password.

