Get Started

It’s easy to get started running CloudSlang flows, especially using the CLI and ready-made content.

Download, Unzip and Run

  • Download the CLI with content zip file.
  • Unzip the archive.
  • Run the CloudSlang executable in the cslang-cli/bin folder.
  • At the prompt enter:
run --f ../content/io/cloudslang/base/print/print_text.sl --i text=Hi
  • The CLI will run the ready-made print_text operation that will print the value passed to the variable text to the screen.

Set up python for CloudSlang cli

To use an external python in cloudslang-cli, set the use.jython.expressions property to false in cslang-cli/configuration/cslang.properties.

Important

By default, the property use.jython.expressions=true is set to true pointing to use Jython.

  1. Unzip the downloaded python 3.8.7 package to any directory. Notice the python-3.8.7 folder after unzipping.

  2. Navigate to cslang-cli/configuration and open the cslang.properties file using any text editor.

  3. Specify a property python.path to point it to the following locations based on your Operating System:

    • Windows: <unzipped_location>/python-3.8.7
    • Linux: <unzipped_location>/python-3.8.7/bin
  4. Additionally for Linux environment, perform the following steps to grant permissions:

    1. Open the terminal shell at /python-3.8.7/bin folder, and then run the following command:

      ln -sf python3 python
      
    2. Navigate back to /python-3.8.7 folder, and then run the following command. The permission to access the folder is granted.

      chmod -R 755 bin
      

Docker

There are two CloudSlang Docker images. One (cloudslang/cloudslang) is a lightweight image meant to get you running CloudSlang flows as quickly as possible. The other image (cloudslang/cloudslang-dev) adds the tools necessary to develop CloudSlang flows.

This image includes:

  • Java
  • CloudSlang CLI
  • CloudSlang content

To get and run the image: docker pull cloudslang/cloudslang

To run a flow with a CloudSlang prompt:

  • docker run -it cloudslang/cloudslang
  • At the prompt enter: run --f ../content/io/cloudslang/base/print/print_text.sl --i text=Hi

Or, to run the flow without the prompt:

docker run --rm cloudslang/cloudslang run --f ../content/io/cloudslang/base/print/print_text.sl --i text=first_flow

The CLI will run the ready-made print_text operation that will print the value passed to the variable text to the screen.

This image includes:

  • Java
  • CloudSlang CLI
  • CloudSlang content
  • Python
  • Pip
  • Vim
  • Emacs
  • SSH
  • Git
  • Atom
  • language-cloudslang Atom package

To get the image: docker pull cloudslang/cloudslang-dev

Next Steps

Now that you’ve run your first CloudSlang file, you might want to: