Skip to main content

Command line interface to easy communicate to your Portainer application.

Project description

Portainer CLI

Powered by Ilhasoft's Web Team.

Portainer CLI is a Python software to use in command line. Use this command line interface to easy communicate with your Portainer application, like in a continuous integration and continuous deployment environments.

Install

pip install [--user] portainer-cli

Usage

Global flags

Flag Description
-l or --local Save and load configuration file (.portainer-cli.json) in current directory.
-d or --debug Enable DEBUG messages in stdout

configure command

Configure Portainer HTTP service base url.

portainer-cli configure base_url

E.g:

portainer-cli configure http://10.0.0.1:9000/

login command

Identify yourself and take action.

portainer-cli login username password

E.g:

portainer-cli login douglas d1234

update_stack command

Update stack.

portainer-cli update_stack id endpoint_id [stack_file]

E.g:

portainer-cli update_stack 2 1 docker-compose.yml

Environment variables arguments

portainer-cli update_stack id endpoint_id [stack_file] --env.var=value

Where var is the environment variable name and value is the environment variable value.

Flags

Flag Description
-p or --prune Prune services
-c or --clear-env Clear all environment variables

update_registry command

Update registry.

portainer-cli update_registry id [-name] [-url]

E.g:

portainer-cli update_registry 1 -name="Some registry" -url="some.url.com/r"

Authentication

You can use authentication passing -a or --authentication flag, but you must pass the -username and -password options.

portainer-cli update_registry 1 -a -username=douglas -password=d1234

request command

Make a request.

portainer-cli request path [method=GET] [data]

E.g:

portainer-cli request status

Flags

Flag Description
-p or --printc Print response content in stdout.

Development

This project use Pipenv to manager Python packages.

With Pipenv installed, run make install to install all development packages dependencies.

Run make lint to run flake8 following PEP8 rules.

Run make or make sdist to create/update dist directory.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

portainer-cli-0.2.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

portainer_cli-0.2.1-py2.py3-none-any.whl (5.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file portainer-cli-0.2.1.tar.gz.

File metadata

  • Download URL: portainer-cli-0.2.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.6.7

File hashes

Hashes for portainer-cli-0.2.1.tar.gz
Algorithm Hash digest
SHA256 ee8c10e1136c1ffa4aee0a91536c94bd9212a3938f81159581c7fef51e959ec5
MD5 c732e43f76fb0f7b11123c7126c9bd73
BLAKE2b-256 4a3fd230464991cc6bcd84be25e9a44a286cb191e8b4b7c4ac59fb4f8c912d2e

See more details on using hashes here.

File details

Details for the file portainer_cli-0.2.1-py2.py3-none-any.whl.

File metadata

  • Download URL: portainer_cli-0.2.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.6.7

File hashes

Hashes for portainer_cli-0.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d5a873604c3422d25e3806b660d89c4509b43798418a731dea4cc2c82f3856de
MD5 2f11c6e174e7ff8a2790d2b2faff1a88
BLAKE2b-256 aabc3e076611e05e67320df90009df81edafbdc02b02e349d3a4679d5e04598f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page