Parameters for CreateEnvironment API

Parameters for CreateEnvironment API

Automating the creation of a new environment on the platform can be done in several ways, such as using the platform CLI, making direct API requests, or specifying parameters in a JPS manifest. While this may seem like a straightforward task, it can involve numerous parameters to precisely define the environment’s topology.

Below, we outline the descriptions for all of these settings along with examples of their usage via the CLI. They are categorized into three main sections corresponding to the arrays of the ~/jelastic/environment/control/createenvironment method. These sections include two common ones and a listing of specialized parameters for creating Docker containers.

Common Environment Configurations

The parameters below should be specified within the env array, either in a CLI command or a JSON file. They define the most common environment configurations, such as programming language, name and others:

Name Description Type Example Value Mandatory
region Environment region string Name of the required region – depends on hosting service provider settings. no
ishaenabled High Availability boolean true, false
Note: Applicable only for Tomcat 6/7, Jetty6, TomEE, GlassFish3
no
engine Programming language version string java6, java7, java8, php5.3, php5.4, php5.5, etc. yes (except of Docker-based environments)
displayName Environment alias string my-env-alias no
sslstate Built-In SSL boolean true, false no
shortdomain Name for the environment to be created string my-cli-env yes

Example

env ‘{“region”: “default_hn_group”, “ishaenabled”: “false”, “engine”: “java7”, “displayName”: “my-env-alias”, “sslstate”: “true”, “shortdomain”: “my-cli-env”}’

Nodes Configurations

Within the nodes section, finer adjustments can be made to define the parameters of the servers included, such as their type, quantity, number of allocated reserved/dynamic cloudlets, and more.

Name Description Type Example Value Mandatory
extip Public IP boolean true, false no
count Number of nodes integer 1, 2, 3, … no
fixedCloudlets Number of fixed cloudlets integer 1, 2, 3, … yes
flexibleCloudlets Number of flexible cloudlets integer 1, 2, 3, … but can not be less than fixedCloudlets yes
displayName Node’s alias name string my-node-alias no
nodeType Type of the stack string docker, tomcat6, tomcat7, tomee, mysql5, apache2, nginxphp, etc. (see the full list of available values here) yes
docker List of Docker container settings array check the corresponding section below> only for docker nodeType

Example

nodes'[{“extip”: “true”, “count”: “2”, “fixedCloudlets”: “16”, “flexibleCloudlets”: “32”, “displayName”: “my-node-alias”, “nodeType”: “docker”, “docker”: {…}}]’

Docker-Based Environment Configurations

The docker subsection is dedicated to specifying specialized Docker container parameters required for deployment.

Name Description Type Example Value Mandatory
cmd Run command configuration string run.sh no
image Docker image name with a tag version (optionally) string ubuntu, tutum/apache-php, jelastic/tomcat8:latest, etc. yes
nodeGroup Environment layer the image should be placed to string cp – application server
bl – load balancer
nosqldb – noSQL database
sqldb – SQl database
cache – cache node
storage – storage node
no (if not specified, an image will be added to the Extra layer)
links Linking parameters array described within the expandable list below no
env The list of environment variables object described within the expandable list below no
registry Credentials for the private registry array described within the expandable list below no
volumes List of local volumes array described within the expandable list below no
volumeMounts List of mounted data directories array described within the expandable list below no
volumesFrom List of nodes to copy the volume settings from array described within the expandable list below no

Example

“dockr”: {“cmd”: “run.sh”, “image”: “jelastic/tomcat8:latest”, “nodeGroup”: “cp”, “links”: […], “env”: {…}, “registry”: {…}, “volumes”: […], “volumeMounts”: {…}, “volumesFrom”: [{…}]}

Configuration: Establishing Connections Between Docker Containers in the Same Environment

Name Description Type Example Value Mandatory
defines the layer/node the current instance should be linked with and sets an alias for this bundle string sqldb:DB, cp:alias no

Example

“link”: [“cp:alias”, “sqldb:DB”]

Environment Variables Configuration: Specifying Environment Variables in Docker Containers

Name Description Type Example Value Mandatory
custom_variable_name Sets the environment variables string var1 value1 (the entire string after first space will be treated as the value, including spaces and quotes) var2=value1 \value2 \value3 (for setting multiple values at a time, i.e. to create an array; here, quotes and backslashes are used as separators) no

Example

“env” {“var1”: “value1”, “var2”: “value1 \value2 \value3”}

Registry Configuration: Establishing Connection to Private Registry

Name Description Type Example Value Mandatory
password Password to a private registry string passw0rd only if you are using private registry
user Name of the user of a private registry string admin only if you are using private registry
url URL to a private registry string http://example.com/private-registry only if you are using private registry

Example

“regitry”: {“password”: “passw0rd”, “user”: “admin”, “url”: “http://example.com/private-registry”}

Local Volumes: Listing Volumes to Be Created Within Local File System of Docker Container

Name Description Type Example Value Mandatory
custom_path Local volume path string /my_custom_volume no

Example

“volues”: [“/volume1”, “/volume2”, “/volume3”]

Mount Points: Set of Parameters Defining Folders with Required Data to Be Attached from Other Servers

Name Description Type Example Value Mandatory
local_path Local path the mounted data will refer to array /mounted_data yes
sourcePath Path to the required data directory on the remote server string /required_data
if not defined, is stated equal to local_path (for remote storage server)
no
sourceNodeId Node ID of storage container integer 459315 yes in case neither sourceNodeGroup, nor sourceHost is specified
sourceNodeGroup Particular environment layer within current environment string cp – application server
bl – load balancer
nosqldb – noSQL database
sqldb – SQl database
cache – cache node
storage – storage node
yes in case neither sourceNodeId, nor sourceHost is specified
sourceHost Public IP or domain of the external Data Storage server string 195.67.231.39 yes in case neither sourceNodeGroup, nor sourceNodeId is specified
readOnly Defines read only or read & write rights for client node boolean true is false by default no

Example

“volueMaunts”: {“/data”: {“sourcePath”: “/exported”, “sourceNodeId”: “693215”, “readOnly”: “true”}}

Account Volumes: List of Nodes at the Current Account for the Volumes to Be Imported From

Name Description Type Example Value Mandatory
sourceNodeId ID of storage container integer 81725 yes, if sourceNodeGroup is not specified
sourceNodeGroup Particular environment layer within current environment string cp – application server
bl – load balancer
nosqldb – noSQL database
sqldb – SQl database
cache – cache node
storage – storage node
yes, if sourceNodeId is not specified
volumes List of volumes to export string /volume
If not specified, all volumes on a node will be exported
no
readOnly Defines read only or read & write rights for client node boolean true(states in false by default) no

Example

“volumesFrom”: [{“sourceNodeGroup”: “cp”, “volumes”: [“/master”, “/local”], “readOnly”: “true”}]