/bkapi

Access the BK Cloud API with Python

Primary LanguageNixISC LicenseISC

BKAPI

Access the BK Cloud API with Python

e.G. get the vnc link to a vserver of yours

bkapi vserver_vncinfo <your_id>
-->
https://vncproxy-dus2-de.virtualhosts.de/novnc/vnc_auto.html?mvid=1234567809003049304f&vncpw=123abcd

Getting Started

Clone the git repository to your local folder.

Prerequisites

Python 3
pip
PyYAML
docopt
requests

Installing

I recommend using a local environment.

python -m venv ./env
# activate it
. ./env/bin/activate

Install the necessary dependencies.

(env) pip install docopt
(env) pip install pyyaml
(env) pip install requests

Install the package

(env) python setup.py install

Install with nix

nix-env -f ./default.nix -i

Running bkapi (or: python ./interact.py) shows all available commands and --version the current version.

Set up the configuration file with the help of EXAMPLE.bkapi.yaml

cp EXAMPLE.bkapi.yaml bkapi.yaml

Example call:

(env) bkapi vservers_list

Built With

  • docopt - Command-line interface description langugae
  • PyYAML - Full-featured YAML framework for the Python programming language
  • requests - HTTP for Humans

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

License

This project is licensed under the ISC License - see the LICENSE.md file for details

Acknowledgments

  • Hat tip to the great support team of BK who found a nice bug in my code