Skip to content

SteelScript is a collection of libraries and scripts in Python for interacting with Riverbed solutions and appliances, and other network infrastructure devices

License

Notifications You must be signed in to change notification settings

riverbed/steelscript

Repository files navigation

Riverbed SteelScript

Documentation Status latest release

Riverbed SteelScript is a collection of libraries and scripts written in Python for interacting with Riverbed solutions and appliances, and other network infrastructure devices.

Quick Start

Here are 4 things you can do to start quick and easy with SteelScript (click to expand the section).

Try examples just with git and Docker

Quick start SteelScript examples in a container

If you have git and Docker installed, for example on a Linux machine in your lab.

Open your shell (bash or PowerShell), build a container image of SteelScript from the latest source code, and run it locally in a Docker container as follows:

Build and run SteelScript in a container

Build a docker image:

# Build a docker image from latest code
docker build --tag steelscript:latest https://github.com/riverbed/steelscript.git

Run SteelScript in a container:

# Run the image in an interactive container
docker run -it steelscript:latest /bin/bash

Try examples

You can try some script examples.

  1. AppResponse example, print the Host Groups:
python examples/steelscript-appresponse/print_hostgroups-formatted.py {appresponse fqdn or IP address} -u {admin account} -p {password}
  1. Client Accelerator Controller example, get the licenses and services:
python examples/steelscript-cacontroller/cacontroller-rest_api.py {client accelerator controller fqdn or IP address} --access_code {access_code}
  1. NetIM example, list the Devices:
python examples/steelscript-netim/print-netim-devices-raw.py {netim core fqdn or IP address} --username {account} --password {password}
  1. NetProfiler example, get the list of the Ports Top Talkers:
python examples/steelscript-netprofiler/top_ports.py {netprofiler fqdn or IP address} -u {admin account} -p {password}
Try SteelScript notebooks, just with git and Docker

Quick Start SteelScript notebooks in a container

If you have git and Docker installed. You can build a steelscript container image that includes the Jupyter server and allows to run notebooks.

Build both steelscript bash imags and notebook image:

# Build the steelscript base image
docker build --tag steelscript:latest https://github.com/riverbed/steelscript.git

# Build the steelscript image for Jupyter Notebook
docker build --tag steelscript.notebook -f Dockerfile.notebook https://github.com/riverbed/steelscript.git

Run a container with the steelscript.notebook image. It contains the Jupyter Notebook server and will be listening on port 8888 by default.

# Start the steelscript.notebook container with built-in Jupyter Notebook
docker run --init --rm -p 8888:8888 --name=steelscript.notebook steelscript.notebook

In the output, grab the url containing the token, for example http://127.0.0.1:8888/tree?token=123456 , and open it in your browser to log into the Jupyter web-console.

From there, in the Notebooks folder you can find some notebooks based on SteelScript:

Try SteelScript notebooks in your own SteelScript environment, just with python, pip, git and vscode

Quick start SteelScript notebooks in your environment

If you have all the tools ready:

  1. Python and pip
  2. git
  3. Visual Studio Code

Download a notebook for SteelScript, open it in Visual Studio Code and your good to go:

Jupyter Notebook files have .ipynb extension, more about Jupyter Notebook

Just install SteelScript modules in your Python environment, with pip and git

Quick Start SteelScript in your environment

If you have all the tools installed in your environment: Python, pip, and git

Then, open your shell (bash or PowerShell) to install SteelScript and modules (directly from the latest source code):

# Install SteelScript and modules
pip install git+https://github.com/riverbed/steelscript
pip install git+https://github.com/riverbed/steelscript-appresponse
pip install git+https://github.com/riverbed/steelscript-netim
pip install git+https://github.com/riverbed/steelscript-netprofiler
pip install git+https://github.com/riverbed/steelscript-steelhead
pip install git+https://github.com/riverbed/steelscript-scc
# ... and others check the list on https://github.com/orgs/riverbed/repositories?q=steelscript

Find all the steelscript modules: steelscript repositories

Get SteelScript

SteelScript and modules are distributed via Riverbed on GitHub. The main repository is SteelScript.

To use SteelScript, it is recommended to either build your own SteelScript container or install the SteelScript modules in your own Python environment directly from the source on GitHub main repository. Refer to the quickstarts in the section above - the guide needs update.

Note

Other distributions have not been maintained and contain outdated versions of SteelScript: outdated SteelScript on Dockerhub, outdated SteelScript in pypi, ...

Guide

Note

The SteelScript guide needs a good refresh. The source is there: outdated source in docs subfolder

About SteelScript

The Framework

The common module for SteelScript is in the SteelScript repository. It contains common code but also it is the entrypoint for Documentation, Build, Test and releases.

Other SteelScript modules have their own repository. The repository name is prefixed by "steelscript": List of SteelScript repositories

Modules for Riverbed products and appliances:

Extra modules

Other repos for components and SteelScript extensions:

Note

The following have known issues and maintenance is pending

More about SteelScript

Folder Structure for Modules

SteelScript is based on Python 3. The repos of SteelScript modules have a common structure

   steelscript-module-name        # for example: steelscript-appresponse
   ├── README.md or README.rst    # Markdown is preferred (.md) and reStructuredText (.rst)
   ├── LICENSE
   ├── CHANGELOG
   ├── .gitignore
   ├── docs
   ├── steelscript
   │   ├── __init__.py
   │   └── module-name            # for example: appresponse
   │       ├── core
   │       │   └── __init__.py
   │       ├── commands
   │       │   └── __init__.py
   │       └── __init__.py
   ├── tests
   ├── setup.py
   ├── examples
   ├── notebooks
   └── tox.ini

Mandatory:

  • README.md (or README.rst): README in Markdown (.md) or reStructuredText (.rst) format. Markdown is preferred.
  • LICENSE: Riverbed Technology copyright, terms and conditions based on MIT
  • CHANGELOG: Simple text file tracking major changes
  • /docs: Documentation using reStructured Text (rst) file format.
  • /examples: Python scripts samples showing how to use the module (only .py files)
  • /steelscript: The actual code, written in Python (Python 3).
  • /tests: Test plans and unit test. Can be organized in subfolders. Test plan are ideally documented and easy to run scripts but can be anything defining a test plan (script, text, ...), for example a Python script based on pytest.
  • setup.py: Python setup file containing meta descriptions and requirements. Based on setuptools, distutils and pytest. Should NOT contain unit test (use Tox and put unit test inside /tests folder instead)

Optional:

  • /notebooks: Notebooks based on Jupyter
  • /tox.ini: standardized python testing definition based on Tox

Contributions for alternative distribution methods and packaging (like pypi, rpm, .deb, rpm, tgz, ...) can be organized inside the /packaging folder in the main SteelScript repository

Build

Builds are defined in the SteelScript repository

Prebuild test-plans validations

Execute test-plans with tox

  pip install tox
  tox

Building Docker containers

Some Dockerfiles are provided to build different flavors of the SteelScript container image:

  1. Dockerfile: scripting playground, with all CLI and tools.
  2. Dockerfile.notebook: build for demo and learning with Jupyter Notebooks.
  3. Dockerfile.slim: small build just enough to run steelscript. Should pass security scans.
  4. Dockerfile.workload: optimized to use as a base image for custom workloads. Should pass security scans.
  5. Dockerfile.custom: example of a custom workload (based on Dockerfile.workload).
  6. Dockerfile.dev: build development and testing container from master or fork/branch
Build snippets
Playground (~1.1 GB)
  docker build --tag steelscript -f Dockerfile .
Notebook (~1.4 GB)
  docker build --tag steelscript.notebook -f Dockerfile.notebook .
Slim (~250 MB)
  docker build --tag steelscript.slim -f Dockerfile.slim .
Workload (<180 MB)
  docker build --tag steelscript.workload -f Dockerfile.workload .
Custom workload
#   # Build the SteelScript Optimized image
docker build --tag steelscript.workload:latest -f Dockerfile.workload .

# Create and edit your script
touch your_script.py

# Build your custom image
docker build --tag steelscript.your_custom_workload -f Dockerfile.custom .

# Run the workload
docker run --rm steelscript.your_custom_workload:latest python your_script.py
Release (<180 MB)
  docker build --tag steelscript.release -f Dockerfile.release .
Dev snippets
Dev from master
  git clone https://github.com/riverbed/steelscript --depth 1 --recurse-submodules
  git clone https://github.com/riverbed/steelscript-netprofiler --depth 1 --recurse-submodules
  git clone https://github.com/riverbed/steelscript-wireshark --depth 1 --recurse-submodules
  git clone https://github.com/riverbed/steelscript-cmdline --depth 1 --recurse-submodules
  git clone https://github.com/riverbed/steelscript-scc --depth 1 --recurse-submodules
  git clone https://github.com/riverbed/steelscript-appresponse --depth 1 --recurse-submodules
  git clone https://github.com/riverbed/steelscript-netim --depth 1 --recurse-submodules
  git clone https://github.com/riverbed/steelscript-client-accelerator-controller --depth 1 --recurse-submodules
  git clone https://github.com/riverbed/steelscript-steelhead --depth 1 --recurse-submodules
  git clone https://github.com/riverbed/steelscript-packets.git --depth 1 --recurse-submodules

  docker build --tag steelscript.dev --progress=plain -f steelscript/Dockerfile.dev .
Dev from your_fork/your_branch
  git clone https://github.com/your_fork/steelscript --depth 1 --recurse-submodules -b your_branch
  git clone https://github.com/your_fork/steelscript-netprofiler --depth 1 --recurse-submodules -b your_branch
  git clone https://github.com/your_fork/steelscript-wireshark --depth 1 --recurse-submodules -b your_branch
  git clone https://github.com/your_fork/steelscript-cmdline --depth 1 --recurse-submodules -b your_branch
  git clone https://github.com/your_fork/steelscript-scc --depth 1 --recurse-submodules -b your_branch
  git clone https://github.com/your_fork/steelscript-appresponse --depth 1 --recurse-submodules -b your_branch
  git clone https://github.com/your_fork/steelscript-netim --depth 1 --recurse-submodules -b your_branch
  git clone https://github.com/your_fork/steelscript-client-accelerator-controller --depth 1 --recurse-submodules -b your_branch
  git clone https://github.com/your_fork/steelscript-steelhead --depth 1 --recurse-submodules -b your_branch
  git clone https://github.com/your_fork/steelscript-packets.git --depth 1 --recurse-submodules -b your_branch

  docker build --tag steelscript.dev --progress=plain -f steelscript/Dockerfile.dev .

Contribute

Feel free to use, enhance and contribute by creating issues, sending pull requests (PR), extending with new modules ...

License

Copyright (c) 2021-2024 Riverbed Technology, Inc.

SteelScript is licensed under the terms and conditions of the MIT License accompanying the software ("License"). SteelScript is distributed "AS IS" as set forth in the License. SteelScript also includes certain third party code. All such third party code is also distributed "AS IS" and is licensed by the respective copyright holders under the applicable terms and conditions (including, without limitation, warranty and liability disclaimers) identified in the license notices accompanying the software.

About

SteelScript is a collection of libraries and scripts in Python for interacting with Riverbed solutions and appliances, and other network infrastructure devices

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages