Developer installation:
git clone https://github.com/kuberlab/python-klabclient
cd python-klabclient
pip install -e .
User installation:
pip install python-klabclient
Install in virtual environment:
virtualenv venv
cd venv
bin/pip install python-klabclient
klab
console command will be accessed from venv/bin/klab
path.pip uninstall python-klabclient
~/.kuberlab/config
.touch ~/.kuberlab/config
cat << EOF >> ~/.kuberlab/config
base_url: https://go.kuberlab.com/api/v0.2
token: <user-token>
EOF
Note: Refer to Config example to see all possible values.
# Set token
export KUBERLAB_TOKEN=token
# Or, use your login/password
export KUBERLAB_USERNAME=my@example.com
export KUBERLAB_PASSWORD=mypassword
klab workspace-list
# See help
klab --help
See how to install a simple app - App installation
Note: Priority for auth parameters: CLI parameters, Env variables, config values.
from klabclient.api import client
# Init session
ses = client.create_session(token='token') # Pick up default base_url
# Or, use username and password
# ses = client.create_session(username='username', password='password') # Pick up default base_url
klab = client.Client(session=ses) # Pick up default klab_url
workspaces = klab.workspaces.list()
# Print all workspace names
print([w.Name for w in workspaces])