Parameters for CreateEnvironment API

Note: This document is based on Jelastic version 4.7

Creation of a new environment at Jelastic can be automated in a variety of different ways, e.g. with the help of Jelastic CLI, through the direct API request or by declaring the appropriate parameters via JPS manifest. Herewith, though representing a rather simple operation, it can include a bunch of different parameters for the precise topology definition. 

Thus, below we provide the description for all of such settings with the examples on their usage via CLI. They are divided into 3 major sections as arrays of the ~/jelastic/environment/control/createenvironment method, being named according to the appropriate arrays’ denominations - two common ones and listing of the specialized parameters for the Docker containers’ creation:

Common Environment Configurations

The parameters below are to be specified within the env array (of either CLI command or JSON file) and define the most common environment configurations, like programming language, name, region and others:

NameDescriptionTypeExample ValueMandatory
regionEnvironment regionstringName of the required region - depends on hosting service provider settings.no
ishaenabledHigh Availabilitybooleantrue, false
Note: Applicable only for Tomcat 6/7, Jetty6, TomEE, GlassFish3
no
engineProgramming language versionstringjava6, java7, java8, php5.3, php5.4, php5.5, etc.yes (except of Docker-based environments)
displayNameEnvironment aliasstringmy-env-aliasno
sslstateJelastic SSLbooleantrue, falseno
shortdomainName for the environment to be createdstringmy-cli-envyes

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, more subtle adjustment can be set to define the comprised servers’ parameters, like their type, amount, number of allocated reserved/dynamic cloudlets and more:

NameDescriptionTypeExample ValueMandatory
extipPublic IPbooleantrue, falseno
countNumber of nodesinteger1, 2, 3, ...no
fixedCloudletsNumber of fixed cloudletsinteger1, 2, 3, ...yes
flexibleCloudletsNumber of flexible cloudletsinteger1, 2, 3, … but can not be less than fixedCloudletsyes
displayNameNode’s alias namestringmy-node-aliasno
nodeTypeType of the stackstringdocker, tomcat6, tomcat7, tomee, mysql5, apache2, nginxphp, etc. (see the full list of available values here)yes
dockerList of Docker container settings arraycheck 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 intended to state the specialized Docker container parameters, required for its deployment.

NameDescriptionTypeExample ValueMandatory
cmdRun command configurationstringrun.shno
imageDocker image name with a tag version (optionally)stringubuntu, tutum/apache-php, jelastic/tomcat8:latest, etc.yes
nodeGroupEnvironment layer the image should be placed tostringcp - 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)
linksLinking parametersarraydescribed within the expandable list belowno
envThe list of environment variablesobjectdescribed within the expandable list belowno
registryCredentials for the private registryarraydescribed within the expandable list belowno
volumesList of local volumesarraydescribed within the expandable list belowno
volumeMountsList of mounted data directoriesarraydescribed within the expandable list belowno
volumesFromList of nodes to copy the volume settings fromarraydescribed within the expandable list belowno

Example: "docker": {"cmd": "run.sh", "image": "jelastic/tomcat8:latest", "nodeGroup": "cp", "links": [...], "env": {...}, "registry": {...}, "volumes": [...], "volumeMounts": {...}, "volumesFrom": [{...}]}

  • linking configuration - for establishing connection between Docker containers in confines of a single environment
    NameDescriptionTypeExample ValueMandatory
    -defines the layer/node the current instance should be linked with and sets an alias for this bundlestringsqldb:DB, cp:aliasno

    Example: "links": ["cp:alias", "sqldb:DB"]

  • environment variables configuration - for stating environment variables in Docker containers
    NameDescriptionTypeExample ValueMandatory
    custom_variable_nameSets the environment variablesstringvar1 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 - for connection to private registry
    NameDescriptionTypeExample ValueMandatory
    passwordPassword to a private registrystringpassw0rdonly if you are using private registry
    userName of the user of a private registrystringadminonly if you are using private registry
    urlURL to a private registrystringhttp://example.com/private-registryonly if you are using private registry

    Example: "registry": {"password": "passw0rd", "user": "admin", "url": "http://example.com/private-registry"}

  • local volumes - list of volumes to be created within local file system of Docker container
    NameDescriptionTypeExample ValueMandatory
    custom_pathLocal volume pathstring/my_custom_volumeno

    Example: "volumes": ["/volume1", "/volume2", "/volume3"]

  • mount points - set of parameters that define folder(s) with required data to be attached from other servers
    NameDescriptionTypeExample ValueMandatory
    local_pathLocal path the mounted data will refer toarray/mounted_datayes
    sourcePathPath to the required data directory on the remote serverstring

    /required_data

    if not defined, is stated equal to local_path (for remote storage server)
    no
    sourceNodeId
    Node ID of storage containerinteger459315yes in case neither sourceNodeGroup, nor sourceHost is specified
    sourceNodeGroupParticular environment layer within current environmentstringcp - 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
    sourceHostPublic IP or domain of the external Data Storage serverstring195.67.231.39yes in case neither sourceNodeGroup, nor sourceNodeId is specified
    readOnlyDefines read only or read & write rights for client nodeboolean

    true

    is false by default
    no

    Example: "volumeMaunts": {"/data": {"sourcePath": "/exported", "sourceNodeId": "693215", "readOnly": "true"}}

  • account volumes - list of nodes at the current account for the volumes to be imported from
    NameDescriptionTypeExample ValueMandatory
    sourceNodeIdID of storage containerinteger81725yes, if sourceNodeGroup is not specified
    sourceNodeGroupParticular environment layer within current environmentstringcp - application server
    bl - load balancer
    nosqldb - noSQL database
    sqldb - SQl database
    cache - cache node
    storage - storage node
    yes, if sourceNodeId is not specified
    volumesList of volumes to exportstring

    /volume

    If not specified, all volumes on a node will be exported
    no
    readOnlyDefines read only or read & write rights for client nodeboolean

    true

    (states in false by default)
    no

    Example: "volumesFrom": [{"sourceNodeGroup": "cp", "volumes": ["/master", "/local"], "readOnly": "true"}]