Skip to main content

CDK

This is a command line interface. Purpose of this application is to enable user to interact with different parts of Digitalenabler platform from command line. Currently, beside commands that enable tracking of app's version, user initialization and configuration, there are commands for interaction with Workflow management and Cloudev functions.

User Manual

This document describes how to install DigitalEnabler CLI and how to use it properly.

Installation

Linux OS

System requirements

DigitalEnabler CLI is available for Linux users with following configurations

  • Ubuntu 16.04+
  • CentOS 7+

Programs that should be installed on the machine

  • Git client

How to install DigitalEnabler CLI on Linux

Step 1: Run this command to download the current stable release of DigitalEnabler CLI

sudo curl -L "https://github.com/digital-enabler/cli/releases/download/1.0.1/digitalenabler" -o /usr/local/bin/digitalenabler

Step 2: Apply executable permissions to the binary:

sudo chmod +x /usr/local/bin/digitalenabler

Step 3: Create a symbolic link in the path

sudo ln -s /usr/local/bin/digitalenabler  /usr/bin/digitalenabler

Step 4: Test the installation

digitalenabler version

Windows OS

System requirements

DigitalEnabler CLI is available for following versions of Windows

  • Windows 10

Programs that should be installed on the machine

  • Git client

How to install DigitalEnabler CLI on Windows

Step 1: Go to release page and download digitalenabler-installer.exe from the latest stable release

Step 2: Run digitalenabler-installer.exe

Step 3: Choose location where to install the program. If not chosen, it will create digitalenabler folder in Program Files and install it there by default.

Step 4: Restart your command prompt and start using DigitalEnabler CLI

Step 5: Test the installation

digitalenabler version

Uninstall

Linux OS

Step 1: Remove the symbolic link in the path

sudo rm /usr/bin/digitalenabler

Step 2: Delete the binary

sudo rm /usr/local/bin/digitalenabler

Windows OS

Step 1: Go to the location of DigitalEnabler CLI installation in your PC

Step 2: Run uninstall.exe program

How to use DigitalEnabler CLI

In the part below you can find all available commands in DigitalEnabler CLI.

version

version command returns current version of DigitalEnabler CLI. To check the version, execute:
$ digitalenabler version

init

init command is used for user initialization and this should be the first command that is executed using this CLI. By executing command below, CLI will ask user for username, password and tenant.
$ digitalenabler init

If the credentials are valid, user will be authorized to use other commands for communication with DigitalEnabler platform.

config

This command is used for configuring other parameters specified by administrator. This command should be used in following manner.

$ digitalenabler config parameter1=value1 parameter2=value2

If parameter is not supported, there will be a warning displayed to the end user.

workflow

workflow represents group of commands that are used for deploying, listing and deleting workflows on Airflow. Use --help option to see list of all available commands in this group.
$ digitalenabler worfklow --help
workflow list

This command is used for listing all workflows in Airflow. It doesn't take any parameter and it is supposed to be used like in example below.

$ digitalenabler worfklow list

As workflows are Python files, this command lists only Python files located in Dag directory.

workflow delete

This command is used for deletion of workflows. It takes workflow name as an argument and should be used like in example below

$ digitalenabler worfklow delete workflow_name

If there is no workflow with name worfklow_name, there will be a warning presented to the user. For more details use help option

$ digitalenabler worfklow delete --help
workflow deploy

This command is used for deployment of new workflows. It takes file path as an argument and should be used like in example below

$ digitalenabler worfklow deploy workflow_path

If there is no file with path workflow_path, there will be a warning presented to the user. For more details use help option

$ digitalenabler worfklow deploy --help

function

function command represents group of commands that are used for manipulating Cloudev functions. Use --help option to see list of all available commands in this group.
$ digitalenabler function --help
function describe

Subcommand describe is used for reading Cloudev function. It takes name of a function as an argument.

$ digitalenabler function describe function_name

If function_name doesn't exist, it gives a warning to the user. For more details use help option

$ digitalenabler function describe --help
function create

Subcommand create is used for creating new Cloudev function. This command takes 1 mandatory argument (file) and 4 optional arguments: name, runtime, timeout, dependencies.

Command arguments:

  • file - path to the file that contains code. Function in the file must have name main
  • name - function name. If not specified, random 15 character string is selected
  • runtime - programming language of your code. Default language is Python 3.7
  • timeout - specified period of time within function should be completed. This argument should be specified in ms and s. Maximum value is 60s and default value is 180ms.
  • dependencies - list of dependencies needed in your code. There is no dependencies by default.

This command returns name of created Cloudev function. To create a new Cloudev function execute:

$ digitalenabler function create file --name name --runtime runtime --timeout timeout --dependencies dependencies

For more details use help option

$ digitalenabler function create --help
function expose

This command is used to expose created function. It takes name of the function as an argument and returns URL of exposed function:

$ digitalenabler function expose name

For more details use help option

$ digitalenabler function expose --help
function retire

To retire exposed function use subcommand retire. It takes function name as an argument and removes exposed URL, but doesn't delete the function:

$ digitalenabler function retire name

For more details use help option

$ digitalenabler function retire --help
function delete

To delete the function use subcommand delete. This command deletes and also retires the function if it is exposed.

$ digitalenabler function delete name

For more details use help option

$ digitalenabler function delete --help