Cisco Edge Intelligence CLI utility tool
This document takes you through an example of a CLI utility tool designed for Cisco Edge Intelligence, Release 2.0. This utility tool example is available on GitHub, and offers guidance on how you can perform bulk pipeline operations. See the Readme file for instructions on how to build, install, and use the CLI package in your local system.
The tool contains JSON files that provide examples of pipeline templates, and data logic, data source, data target, and data variable configurations.
You can deploy one or more pipelines on one or more devices, by creating the necessary inventory files in the YAML format.
The CLI utility tool supports the following functions:
-
Change device passwords.
-
Create pipeline inventories.
-
Deploy or undeploy pipelines.
-
Check the health status of pipelines.
-
View event logs by operation type and timestamp for troubleshooting.
Download and install the Cisco Edge Intelligence CLI package
Before you begin
-
Python release 3.10 or later is required on your system.
-
To use the CLI tool, make sure that python bin folder is available to the system path.
-
Active Internet access is essential to download the Cisco Edge Intelligence CLI package.
Procedure
Step 1 |
Download the contents of the CLI utility tool for Cisco Edge Intelligence to your local system. |
Step 2 |
To build the CLI utility tool package, use the following commands:
|
Step 3 |
To install the package, use the following commands:
|
Configure and Initialize Cisco Edge Intelligence local manager CLI
Procedure
Step 1 |
To create an environment, create a directory eilm-cli in the Home folder. |
||
Step 2 |
Set the path for environment variable (EI_CLI_HOME=<path_to_eilm_home_dir>),
For Windows CMD
or
|
||
Step 3 |
To generate a configuration folder and sample configuration files, enter eilm-cli init.
|
||
Step 4 |
A folder with the name configs is created in the eilm-cli folder. The configs folder contains example JSON files for data logic, data source, and data target configurations. Example:
|
||
Step 5 |
To verify the functionality of eilm-cli utility tool, use the help command.
|
Create a pipeline inventory file
To create a pipeline configuration file (YAML file), you must first create individual configuration files (JSON files) defining data source, data logic, data target, and data variables. Then, create the inventory file that brings the various configurations together as a pipeline that can be deployed.
You can reuse the individual JSON configuration files in multiple pipelines, as needed.
You can create as many inventory files as needed.
The following taskflow contains examples of the configuration files that are available through the eilm-cli utility tool. To obtain the exact configuration for a pipeline, export the pipeline template from your Cisco Edge Intelligence GUI.
Procedure
Step 1 |
Use the exported pipeline template as a template to deploy on other EI agents. The file contains the data source, destination, and pipeline configuration.
|
Step 2 |
The data_source configuration file defines the sources from which a pipeline collects edge data. You can add up to 20 data sources to a pipeline.
|
Step 3 |
The data_logic file defines how a data is processed and transformed. The example file includes data rule and data logic configurations for your reference.
|
Step 4 |
The data_target file defines the destinations that the transformed data is delivered. The example file also includes output model configurations.
|
Step 5 |
The data_vars file defines the template variables used in the pipeline configuration.
|
Step 6 |
In the configs folder of the elim-cli tool, create an inventory file to define the pipelines you want to deploy. One inventory file can contain pipeline configurations for multiple Cisco Edge Intelligence agents. You can also choose to create multiple inventory files in the configs folder.
|
Commands for pipeline operations
The command for pipeline management requires password authentication. For bulk deployment or undeployment of pipelines across multiple devices, the access password across the devices must match.
To change the password across the devices mentioned in your inventory file, use the eilm-cli user change-pwd -f inventory.yaml
command.
You are prompted to enter the old and new passwords for each device in the inventory file, and the passwords are updated accordingly.
Deploy a Template
To deploy a template, use the eilm-cli pipeline deploy-template -f test_inventory.yml
command.
Deploy a pipeline
To deploy a pipeline, use the eilm-cli pipeline deploy -f inventory.yaml
command.
Undeploy a pipeline
To undeploy a pipeline, use the eilm-cli pipeline undeploy -f inventory.yaml
command.
Check pipeline status
To check the status of a pipeline, use the eilm-cli pipeline status -f inventory.yaml
command.
Logs Management
The eilm-cli.log folder in the Cisco Edge Intelligence CLI utility tool stores all the log files.
The log files are named based on the operation and timestamp:
-
change_pwd_<timestamp>.log
-
deploy_<timestamp>.log
-
status_<timestamp>.log
-
undeploy_<timestamp>.log
Troubleshooting
If you encounter issues:
-
Review the log files for error details.
-
Verify the
inventory.yml
file for accuracy. -
Ensure all dependencies are installed and up to date.
For additional command details, refer to the eilm-cli --help
command.