命令行界面,便于与Portainer应用程序通信。
portainer-cli的Python项目详细描述
Portainer客户端
由Ilhasoft's Web Team提供动力。
portainer cli是一个在命令行中使用的python软件。使用此命令行界面可以轻松地与Portainer应用程序通信,就像在连续集成和连续部署环境中一样。
安装
pip install [--user] portainer-cli
用法
全局标志
Flag | Description |
---|---|
^{ | Save and load configuration file (^{ |
^{ | Enable DEBUG messages in stdout |
配置命令
配置Portainer HTTP服务基URL。
portainer-cli configure base_url
例如:
portainer-cli configure http://10.0.0.1:9000/
登录命令
认清自己并采取行动。
portainer-cli login username password
例如:
portainer-cli login douglas d1234
更新堆栈命令
更新堆栈。
portainer-cli update_stack id endpoint_id [stack_file][-env-file]
例如:
portainer-cli update_stack 21 docker-compose.yml
环境变量参数
portainer-cli update_stack id endpoint_id [stack_file] --env.var=value
其中,var
是环境变量名,value
是环境变量值。
标志
Flag | Description |
---|---|
^{ | Pass env file path, usually ^{ |
^{ | Prune services |
^{ | Clear all environment variables |
更新注册表命令
更新注册表。
portainer-cli update_registry id [-name][-url]
例如:
portainer-cli update_registry 1 -name="Some registry" -url="some.url.com/r"
身份验证
可以使用身份验证传递-a
或--authentication
标志,但必须传递-username
和-password
选项。
portainer-cli update_registry 1 -a -username=douglas -password=d1234
请求命令
提出请求。
portainer-cli request path [method=GET][data]
例如:
portainer-cli request status
标志
Flag | Description |
---|---|
^{ | Print response content in stdout. |
开发
这个项目使用Pipenv来管理python包。
安装pipenv后,运行make install
以安装所有开发包依赖项。
运行make lint
以按照pep8规则运行flake8。
运行make
或make sdist
创建/更新dist
目录。