netbox-handler 0.1.0
A Python library to interact with the Netbox API
Requires Python: >=3.6

# Netbox Handler

A Python library to interact with the Netbox API.

The project aims to provide the user with as much information as if they were looking at the reference guide themselves.

This is a part of my 'Handler' series, currently following suit of [librenms-handler](https://github.com/WhaleJ84/librenms_handler).

## Usage

The following statement will initialise the chosen endpoint:

```python
from netbox_handler.status import Status

netbox_status = Status(
    'https://netbox.example.com',
    'e4ef9234abab59a90628dd3f616a60b4'
)
```

**NOTE:** If you are using a self-signed certificate for your server, you can bypass the errors by passing the initialisation option `verify=False`.

Once done, a list of methods will be available to you such as `netbox_status.status_list()`.
Upon operation, the method will execute and return the required request to your Netbox instance.

```
>>> netbox_status.list_status()
{'django-version': '3.2', 'installed-apps': {'cacheops': '5.0.1', 'debug_toolbar': '3.2.1', 'django_filters': '2.4.0', 'django_prometheus': '2.1.0', 'django_rq': '2.4.1', 'django_tables2': '2.3.4', 'drf_yasg': '1.20.0', 'mptt': '0.12.0', 'rest_framework': '3.12.4', 'taggit': '1.3.0', 'timezone_field': '4.1.2'}, 'netbox-version': '2.11.0', 'plugins': {}, 'python-version': '3.8.5', 'rq-workers-running': 1}
```

The output is exactly the same as if you were using Curl to make the requests.

Should you wish to use any other endpoint, the situation would be the same: `from netbox_handler.endpoint import Endpoint`.

## Environment Variables

While initialising the handler, the following parameters are required.
The handler first checks for the following environment variables, should you choose to use them.

| Environment variable | Description | Type | Example |
| -------------------- | ----------- | ---- | ------- |
| NETBOX_URL           | Full URL to the target Netbox instance | string | https://netbox.example.com |
| NETBOX_TOKEN         | Token generated from `NETBOX_URL/admin/users/token` | string | e4ef9234abab59a90628dd3f616a60b4 |

## Endpoints

While I will likely never have reason to fully complete all endpoints, the progress of such is shown below:
See [Projects](https://github.com/WhaleJ84/netbox_handler/projects) to track the progress of the endpoints.

| Endpoint                                                                | Started | Done |
| ----------------------------------------------------------------------- | ------- | ---- |
| [Circuits](https://github.com/WhaleJ84/netbox_handler/projects/1)       | False   |      |
| [DCIM](https://github.com/WhaleJ84/netbox_handler/projects/2)           | False   |      |
| [Extras](https://github.com/WhaleJ84/netbox_handler/projects/3)         | False   |      |
| [IPAM](https://github.com/WhaleJ84/netbox_handler/projects/4)           | False   |      |
| [Secrets](https://github.com/WhaleJ84/netbox_handler/projects/5)        | False   |      |
| [Status](https://github.com/WhaleJ84/netbox_handler/projects/6)         | True    | True |
| [Tenancy](https://github.com/WhaleJ84/netbox_handler/projects/7)        | False   |      |
| [Users](https://github.com/WhaleJ84/netbox_handler/projects/8)          | False   |      |
| [Virtualization](https://github.com/WhaleJ84/netbox_handler/projects/9) | False   |      |