NebulaPythonSDK is a Pythonic SDK to manage Nebula container orchestrator
Project description
Nebula-Python-SDK
An SDK for managing nebula via python.
translates all of Nebula API calls to something more pythonic.
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
# TODO - add example of create a device_group
# list device group info
# TODO - add example of listing a device group info
Note that the response returned is a requests formatted response.
NOTE THIS IS A POC BRANCH WHICH RADICALLY BREAKS EVERYTHING AND IS DESIGNED TO IMPLEMENT A NEW COMMUNICATION METHOD based around monotonic ID's (inspired by Kafka) inside the API and memoization rather then using RabbitMQ.
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
Built Distribution
Close
Hashes for NebulaPythonSDK-2.0.0a1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65b30892f52d3623ac693e189ce251c0fa07acd2bb82bd0089fd156d38753132 |
|
MD5 | 3af5ee4c5489b9eec984f6cf0f780929 |
|
BLAKE2b-256 | 30aa4df26cf5e93c46e62a3df5def6cdb47fc2ccdf0f5ff209acc6938e758017 |