In the recent release the process of environment management via API was greatly improved due to the newly implemented Jelastic CLI. Leveraging this simple but powerful solution, you are able to manage your multi-container environments by means of the API commands, that have been preliminarily properly arranged. This allows you to work just like during the conventional programming.
Jelastic CLI Specifics
Comparing to analogues, our CLI is more flexible and universal. Representing an easy way to discover and try Jelastic API, it can be run on top of any OS. Moreover, it is automatically adjusted according to the newest API version due to regular updates checking. This allows to keep your CLI up-to-date supporting even the most recent features.
However, the main benefit the Jelastic CLI provides is the advanced automation capabilities, that can be implemented by combining the command lines into special scripts. All you need to do for accomplishing this is to write down the consequent CLI commands, building the frequently used operations’ chains, within a dedicated file and make it executable. Now you are good to go - just call it at any time by simply typing that filename within your terminal for the corresponding operations to be performed! Such code pieces can be used to simplify and speed up various tasks, from the plain application monitoring to the complex DevOps scenarios’ implementation. Yes, welcome to the Cloud Scripting era!
Let us also highlight some key features of Jelastic CLI:
- API inherited structure: repeats the Jelastic API native hierarchy for even more convenient usage
- Remote control: allows to manage your Cloud directly from the console
- Fast & simple installation: get it in a couple of seconds with just a single command line
- OS independence: can be installed and run at any OS distributive
- Dynamic adaptation: works with all API versions, being automatically adjusted according to the required one while connecting to a particular platform
So, in order to install Jelastic CLI at your local machine, you need to run just a single line of code via your terminal:
curl -s ftp://ftp.jelastic.com/pub/cli/jelastic-cli-installer.sh | bash
Consequently, the Jelastic CLI will be installed to the dedicated jelastic folder at your home directory. As it was mentioned above, the structure of the folders and bash scripts inside represents the hierarchy of Jelastic API, so you can easily get used to our CLI due to the complete similarity of the corresponding working processes.
The base of the Jelastic CLI is represented with an executable .jar archive and a number of preconfigured commands (bash scripts) for its operating. With their help you are able to monitor, control and automate your environment lifecycle.
1. To get started, the authentication should be passed. It will be called automatically on the first command use.
Just follow the appearing questionnaire, specifying the asked values:
- Platform URL - Jelastic installation URL
- Email - email (login) binded to your account
- Password - your account password
If the entered data is correct, you’ll see the Jelastic logo and version of the currently used platform.
The information on actual user session (i.e. platform address and your credentials) is stored within the automatically generated ~/.config/jelastic/jelastic.properties file. It is automatically fetched when necessary, allowing you to concentrate on the performed operations with no repetitive authentication steps required.
2. In case you are new to our API and need details on its command-line interface structure, you can access the embedded help file:
Here you can see the hierarchical list of the available command types (methods), where each method has the dedicated same-named folder with a number of scripts (i.e. available functions) inside.
3. In order to get the list of all possible operations for a particular method, you can use a simple listing command for the appropriate directory, for example:
Each of the presented functions can be easily called using the full path to it.
4. For more information on a particular operation, run it without any parameters specified to see the complete list of missed requirements.
Also, you can look through all the available methods within the Jelastic API documentation.
Now you have some basic knowledge of our CLI. This can be a good start to test it out and find the benefits for your particular project development. And in the upcoming articles we’ll cover some real-case examples and reveal a few usage hints. So subscribe and stay tuned in order not to miss this and more other interesting articles!