Skip to content
Simple CLI program to browse Contrail API server
Branch: master
Clone or download
Latest commit 0f6467a Jun 6, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
contrail_api_cli schema: parent becomes a list Jun 6, 2019
debian Compare resource on their UUID and FQName Apr 6, 2019
doc Bump to 0.4.0rc1 Apr 3, 2019
.gitignore Extend gitignore Jun 27, 2016
LICENSE Initial commit Oct 10, 2015 Link to screencast in readme Aug 31, 2016
logger.conf.example Add option to specify python logging configuration Jun 24, 2016
setup.cfg Add setup.cfg Dec 8, 2015 Bump to 0.4.0rc1 Apr 3, 2019

Build Status Doc Status Coverage Status Join the chat at


Simple CLI program to browse Contrail API server


Python virtualenv

You can install contrail-api-cli inside a python virtualenv. First create the virtualenv and install contrail-api-cli with pip.

$ virtualenv contrail-api-cli-venv
$ source contrail-api-cli-venv/bin/activate
(contrail-api-cli-venv) $ pip install contrail-api-cli

Debian package

First you need to satisfy dependencies missing in Ubuntu Trusty. You can install them from newer distribution or from backports (eg. tcpcloud/extra)

  • python-pathlib
  • python-prompt-toolkit
  • python-wcwidth

When dependencies are satisfied, you can build package:

dpkg-buildpackage -uc -us

Then upload into your repository or install directly:

dpkg -i ../contrail-api-cli_*.deb


Run contrail-api-cli shell to start the cli. Use the -h option to see all supported options. By default it will try to connect to localhost on port 8082 with no authentication.

Type help to get the list of all available commands.

Here is a screen cast to see contrail-api-cli in action:



contrail-api-cli supports keystone (v2, v3) and Basic HTTP authentication mechanisms.

When running the contrail API server with --auth keystone you can login on port 8082 with keystone auth and on port 8095 with basic http auth.

Basic HTTP auth

contrail-api-cli --host localhost:8095 --os-auth-plugin http --os-username admin --os-password contrail123 shell

The username and password can be sourced from the environment variables OS_USERNAME, OS_PASSWORD.

The auth plugin default to http unless OS_AUTH_PLUGIN is set.

Kerberos auth

The easiest way is to source your openstack openrc file and run

contrail-api-cli --os-auth-plugin [v2password|v3password] shell

See contrail-api-cli --os-auth-plugin [v2password|v3password] --help for all options.

What if

virtualenv is missing

Install virtualenv

# pip install virtualenv

pip is missing

Install pip

# easy_install pip
You can’t perform that action at this time.