NebulaPythonSDK is a Pythonic SDK to manage Nebula container orchestrator
Project description
Nebula-Python-SDK
Travis CI unit tests & auto PyPi push status:
An SDK for managing nebula via python.
translates all of Nebula API calls to something more pythonic.
Source code is available at github
How To Use
first get NebulaPythonSDK onto your machine
# Install from PyPi
pip install NebulaPythonSDK
now use it in your code
# Load API wrapper from library
from NebulaPythonSDK import Nebula
# Create API object.
# port defaults to 80, protocol defaults to "http" & request_timeout defaults to 60 if any of them is not set.
connection = Nebula(username="your_nebula_user", password="your_nebula_pass", host="nebula.example.com", port=80, protocol="http", request_timeout=60)
# List apps
app_list = connection.list_apps()
# List app info
app_config = connection.list_app_info("app_name")
# Create app
app_conf = {
"containers_per_cpu": 8,
"env_vars": {
"test": "blabla",
"test3t2t32": "tesg4ehgee"
},
"docker_ulimits": [],
"networks": ["nebula"],
"running": True,
"rolling_restart": False,
"volumes": ["/tmp:/tmp/1", "/var/tmp/:/var/tmp/1:ro"],
"containers_per": {
"cpu": 6
},
"starting_ports": [
{
"81": 80
}
],
"docker_image": "httpd",
"privileged": False,
"devices": []
}
connection.create_app("app_name", app_conf)
# create device group
device_group_config = {"apps": ["app_name"]}
connection.create_device_group("device_group_name", device_group_config)
# list device group
connection.list_device_group("device_group_name")
# list device group info
connection.list_device_group_info("device_group_name")
# ping api
connection.check_api()
# delete app
connection.delete_app("app_name")
# stop app
connection.stop_app("app_name")
# start app
connection.start_app("app_name")
# restart app
connection.restart_app("app_name")
# update app
connection.update_app("app_name", app_conf)
# prune images on all device groups
connection.prune_images()
# delete device_group
connection.delete_device_group("device_group_name")
# prune images on a selected device groups
connection.prune__device_group_images("device_group_name")
# update device group
connection.update_device_group("device_group_name", device_group_config)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
NebulaPythonSDK-2.1.1.tar.gz
(5.4 kB
view details)
Built Distribution
File details
Details for the file NebulaPythonSDK-2.1.1.tar.gz
.
File metadata
- Download URL: NebulaPythonSDK-2.1.1.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9faea62ba076dba6a33b652b8d51d9120aa798a99dbaa3331e38c31810541f6c |
|
MD5 | 56e3873c0856ced503c8f1671be171ef |
|
BLAKE2b-256 | d195334a4fcb1a6c3af614d60d94658cba6812492bb1b5b15252fe45230dda4b |
Provenance
File details
Details for the file NebulaPythonSDK-2.1.1-py3-none-any.whl
.
File metadata
- Download URL: NebulaPythonSDK-2.1.1-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1bdf30e7a6a0f0df8321cb9cb32596ff48d145fba1261044e6a4a7c2c6296bf |
|
MD5 | da087e3c3305d7ccbe812e59c2e22769 |
|
BLAKE2b-256 | 44c31d6381ae23f15b99324b1b80adf9cc1b0aaee6db59ae03c23b20d60aeb95 |