Python library for Tutum’s API. Full documentation available at https://docs.tutum.co/v2/api/?python
Installing the library
In order to install the Tutum Python library, you can use pip install:
pip install python-tutum
It will install a Python module called tutum which you can use to interface with the API.
Errors
Errors in the HTTP API will be returned with status codes in the 4xx and 5xx ranges.
The Python library will detect this status codes and raise TutumApiError exceptions with the error message, which should be handled by the calling application accordingly.
Quick examples
Services
>>> import tutum
>>> tutum.Service.list()
[<tutum.api.service.Service object at 0x10701ca90>, <tutum.api.service.Service object at 0x10701ca91>]
>>> service = tutum.Service.fetch("fee900c6-97da-46b3-a21c-e2b50ed07015")
<tutum.api.service.Service object at 0x106c45c10>
>>> service.name
"my-python-app"
>>> service = tutum.Service.create(image="tutum/hello-world", name="my-new-app", target_num_containers=2)
>>> service.save()
True
>>> service.target_num_containers = 3
>>> service.save()
True
>>> service.stop()
True
>>> service.start()
True
>>> service.delete()
True
Containers
>>> import tutum
>>> tutum.Container.list()
[<tutum.api.container.Container object at 0x10701ca90>, <tutum.api.container.Container object at 0x10701ca91>]
>>> container = tutum.Container.fetch("7d6696b7-fbaf-471d-8e6b-ce7052586c24")
<tutum.api.container.Container object at 0x10701ca90>
>>> container.public_dns = "my-web-app.example.com"
>>> container.save()
True
>>> container.stop()
True
>>> container.start()
True
>>> container.logs
"2014-03-24 23:58:08,973 CRIT Supervisor running as root (no user in config file) [...]"
>>> container.delete()
True
Metadata
Release files for python-tutum 0.21.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| python-tutum-0.21.2.tar.gz | 34.8 kB | Without provenance | Details |
Release files / python-tutum-0.21.2.tar.gz
| Download URL | python-tutum-0.21.2.tar.gz |
|---|---|
| Size | 34.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d9dc2f6dd893b4243d8a794ce0e371989a4f6232523c6a934b50204cf0a187f
|
|
BLAKE2b-256 checksum How to use checksums |
572866aee0ff752c583360d4b7cfadb3a3d56da110dad85ca00b2a56b40c8e14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for python-tutum 0.21.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.