Metadata-Version: 2.4
Name: drppy_client
Version: 4.17.0
Summary: Python Library to interact with the digitalrebar API.
Home-page: https://gitlab.com/rackn/drppy_client
Author-email: RackN Engineering <eng@rackn.com>
Project-URL: Homepage, https://gitlab.com/rackn/drppy_client
Project-URL: Issues, https://gitlab.com/rackn/drppy_client
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.5
Description-Content-Type: text/markdown
Requires-Dist: certifi>=14.05.14
Requires-Dist: six>=1.10
Requires-Dist: python-dateutil>=2.5.3
Requires-Dist: urllib3>=1.15.1
Requires-Dist: click>=8.1.7
Requires-Dist: pynacl>=1.5
Dynamic: home-page

# drppy-client
# An RestFUL API-driven Provisioner and DHCP server

This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: 4.15.0
- Build package: io.swagger.codegen.languages.PythonClientCodegen
- For more information, please visit [https://doc.rackn.io/](https://docs.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:

```sh
pip install drppy_client
```

Once installed use the following code to import the package for use:

```python
import drppy_client
```

To use the development version of this library install directly from gitlab using:

```sh
pip install git+https://gitlab.com/rackn/drppy_client.git
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python -m pip install .
```


Then import the package:
```python
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.

```python
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
```sh
pip install click
```

Locate the examples directory. The examples are generally stored in $VENV_ROOT/share/drppy_client/examples

From the examples directory run:

```sh
$ 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](https://docs.rackn.io/developers/api/python/).

## Documentation For Authorization


## Bearer

- **Type**: API key
- **API key parameter name**: Authorization
- **Location**: HTTP header

## basicAuth

- **Type**: HTTP basic authentication


## Author

support@rackn.com

