Sign inSign up

f5devcentral/f5-cli

By f5devcentral

Updated over 6 years ago

F5 CLI in a container

Image
4

2.4K

f5devcentral/f5-cli repository overview

Docker Pulls Docker Stars Docker Automated build

Introduction

The F5 CLI provides a command-line interface (CLI) to various F5 products and services. It focuses primarily on facilitating consuming our most popular APIs and services, currently including BIG-IP (via Automation Tool Chain) and F5 Cloud Services.

Similar to other popular cloud shells, it is built on a python client library. For those looking to write custom automation scripts or workloads, one may choose to leverage the same python library it is built on (https://github.com/f5devcentral/f5-sdk-python).

Benefits

  • Quickly access and consume F5’s APIs and Services with familiar remote CLI UX
  • Configurable settings
  • Include common actions in Continuous Deployment (CD) pipelines
  • Prototyping
    • Test calls that may be used in more complex custom integrations using the underlying SDK
    • Supports discovery activities/querying of command-line results (for example, “list accounts” to find the desired account which will be used as an input to final automation)
  • Support quick one-off automation activities (for example, leveraging a bash loop to create/delete large lists of objects)

References

The F5 CLI is currently in early development and we want to hear from you! To provide feedback on CLI or this documentation, you can file a GitHub Issue.

Usage

Run F5 CLI in Docker container
Example: Run the F5 CLI interactively from inside the docker container
docker run -it -v "$HOME/.f5_cli:/root/.f5_cli" -v "$(pwd):/f5-cli" f5devcentral/f5-cli:latest /bin/bash
Example: Run the F5 CLI container from your desktop using an alias
alias f5='docker run -it -v "$HOME/.f5_cli:/root/.f5_cli" -v "$(pwd):/f5-cli" f5devcentral/f5-cli:latest f5'
Example: Run the F5 CLI container from your desktop using your PATH

Another shortcut to launch f5-cli is to create a file containing the following content in your system's PATH (ex. cat /usr/local/bin/f5 ).

#!/usr/bin bash
docker run -it --rm -e "F5_SDK_LOG_LEVEL=INFO" -e "F5_DISABLE_SSL_WARNINGS=true" -v "$HOME/.f5_cli:/root/.f5_cli" -v "$(pwd):/f5-cli" f5devcentral/f5-cli:latest f5 $@
  • Notes:
    • This example also exports environment variables to set the log level and disable ssl warnings of the application.
    • Ensure that the config directory .f5_cli is mounted to the container so the container can authenticate and communicate properly with a target device.
    • To reference files (ex. named as3.json), make sure that the current directory is where the files are located. This will let the docker container mount the local directory onto the container "$(pwd):/f5-cli" and process the files with f5-cli container. ex.
f5 bigip extension as3 create --declaration as3.json
Build F5 CLI Docker container locally
docker build -t f5-cli:latest .

Tag summary

Content type

Image

Digest

Size

220.8 MB

Last updated

over 6 years ago

docker pull f5devcentral/f5-cli