drppy-client
An RestFUL API-driven Provisioner and DHCP server
This Python package is automatically generated by the Swagger Codegen project:
- API version: 4.15.0
- Build package: io.swagger.codegen.languages.PythonClientCodegen
- For more information, please visit https://doc.rackn.io/
Requirements.
Python 3.4+
Installation & Usage
pip install
This should be done in a virtual environment and not directly installed into the system python.
To install directly from public pypi use the following command:
pip install drppy_client
Once installed use the following code to import the package for use:
import drppy_client
To use the development version of this library install directly from gitlab using:
pip install git+https://gitlab.com/rackn/drppy_client.git
Setuptools
Install via Setuptools.
python -m pip install .
Then import the package:
import drppy_client
Getting Started
Examples are provided in the examples/ directory, and make an excellent initial place to start exploring for how to use the library. The examples are implemented as a basic drpcli example.
Below is a basic example that can be created once the library is installed to verify things are working. It assumes at least 1 machine exists, and also uses the default credentials and endpoint location. Be sure to adjust the host, username, and password as needed to match your environment.
from pprint import pprint
from drppy_client.configuration import Configuration
from drppy_client.api_client import ApiClient
from drppy_client.api.machines_api import MachinesApi
config = Configuration()
config.host = 'https://localhost:8092/api/v3'
config.username = "rocketskates"
config.password = "r0cketsk8ts"
config.verify_ssl = False
client = ApiClient(config)
machines = MachinesApi(client)
my_machines = machines.list_machines()
print(my_machines[0])
DRPCLI example using Python
The drpcli.py example is implemented using Python Click. Be sure click is installed if you plan to use the example
pip install click
Locate the examples directory. The examples are generally stored in $VENV_ROOT/share/drppy_client/examples
From the examples directory run:
$ python drpcli.py --help
Usage: drpcli.py [OPTIONS] COMMAND [ARGS]...
Main entry point for the CLI.
Options:
--endpoint TEXT API host URL
--token TEXT API token
--key TEXT user:password Used for basic auth
--help Show this message and exit.
Commands:
contents Contents Specific Commands.
machines Machine Specific Commands.
params Parameter Specific Commands.
profiles Profiles Specific Commands.
subnets Subnets Specific Commands.
$ python drpcli.py machines list
If you do not want to run the examples and just want to look at the code to see how to use the SDK open up the file for the thing you want to learn. Machine examples are in the machines.py file, Profile examples in the profiles.py file etc.. The examples implemented are minimal by design to give you a starting point. If you are having trouble using them, or finding an example that demonstrates the feature you need please send a support request to support@rackn.com
API & Model Reference
The full class and method reference is generated from docstrings in the
installed package — view it with pydoc:
# One class
python -m pydoc drppy_client.api.machines_api.MachinesApi
# All classes in a local browser
python -m pydoc -b
For a high-level overview and installation instructions, see the RackN Python Client Library page.
Documentation For Authorization
Bearer
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
basicAuth
- Type: HTTP basic authentication
Author
Metadata
Release files for drppy-client 4.17.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| drppy_client-4.17.0.tar.gz | 838.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| drppy_client-4.17.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.3 MB
Release files / drppy_client-4.17.0.tar.gz
| Download URL | drppy_client-4.17.0.tar.gz |
|---|---|
| Size | 838.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7bd739af40b97f2eb0d918c86fc05feeb40515dff8a06e721430161f8b29555e
|
|
BLAKE2b-256 checksum How to use checksums |
5da7f0a984cb73377669d678983927bb6a275a3caa40d8395fe853747e8fd76b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|
Release files / drppy_client-4.17.0-py3-none-any.whl
| Download URL | drppy_client-4.17.0-py3-none-any.whl |
|---|---|
| Size | 1.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c7fb521ffe64e032a874cf207ba60c837183c1c462dcde18a62ddc7791bd861c
|
|
BLAKE2b-256 checksum How to use checksums |
755044a74b44430e6a7c96d0a1b63e58ef408303ddb13376fb409c4a98976ce8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|