Installation
portainer-py is distributed on PyPI as a universal wheel and is available on Linux/macOS and Windows and supports Python 3.5+.
$ pip install portainer-py
Usage
If you’re running Portainer locally, which should be very easy using Docker, connect to it like this:
from portainer_py import portainer_for_host
portainer = portainer_for_host("http://localhost:9000")
portainer.login("<username>", "<password>")
stack = portainer.stack_with_name("my-stack")
try:
portainer.update_stack(
stack["Id"],
"path/to/stackfile.yml",
env_vars={"foo": "bar"}
)
except: PortainerError as error:
print(error.message)
License
portainer-py is distributed under the terms of the MIT License.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
portainer-py-0.5.0.tar.gz
(9.2 kB
view details)
File details
Details for the file portainer-py-0.5.0.tar.gz.
File metadata
- Download URL: portainer-py-0.5.0.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.6.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
612ece931cfe729f688b2c331542c50cfe09de6ac04c4891952d495f39bdead6
|
|
| MD5 |
c52fa7a8acd61bb11b90fed5d7fdca3e
|
|
| BLAKE2b-256 |
596cc6f97e0a53c9da6219b7f852b8be9657c6f0b738463d38d2f36540d20d0c
|