Annet Netbox client
Project description
Annetbox - Netbox client used by annet and related projects
This project implements subset of Netbox API methods
Usage
- Install
syncorasyncversion
pip install 'annetbox[sync]'
- Create client instance according to your netbox version (only some are supported)
from annetbox.v37.client_sync import NetboxV37
netbox = NetboxV37(url="https://demo.netbox.dev", token="YOUR NETBOX TOKEN")
- Call methods
res = netbox.dcim_devices(limit=1)
Configuration
Verbose logging
For sync client
import http.client
import logging
logging.basicConfig()
http.client.HTTPConnection.debuglevel = 1
requests_log = logging.getLogger("requests.packages.urllib3")
requests_log.setLevel(logging.DEBUG)
requests_log.propagate = True
Custom SSL context
- Create context
import ssl
context = ssl.create_default_context(cafile="path/to/cacert.pem")
- Pass it to client
netbox = NetboxV37(url=url, token=token, ssl_context=context)
Development
Adding new methods
- Read openapi spec
- Edit
models.py - Edit
client_async.py, do not forget addinglimit/offset - Convert async code to sync
python transform_to_sync.py src/annetbox/v37/client_async.py > src/annetbox/v37/client_sync.py
python transform_to_sync.py src/annetbox/v41/client_async.py > src/annetbox/v41/client_sync.py
python transform_to_sync.py src/annetbox/v42/client_async.py > src/annetbox/v42/client_sync.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file annetbox-0.11.0.tar.gz.
File metadata
- Download URL: annetbox-0.11.0.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10686dacb32443caa38d15302925a1545f95533c8fc55a8d9318be4a77520548
|
|
| MD5 |
4d4f514768caea67f360b18cb60df838
|
|
| BLAKE2b-256 |
5a3c948d00d014302025abf68d4426429c24da32644b950a36524dfca33e589e
|
Provenance
The following attestation bundles were made for annetbox-0.11.0.tar.gz:
Publisher:
publish-to-pypi.yml on annetutil/annetbox
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
annetbox-0.11.0.tar.gz -
Subject digest:
10686dacb32443caa38d15302925a1545f95533c8fc55a8d9318be4a77520548 - Sigstore transparency entry: 1185652910
- Sigstore integration time:
-
Permalink:
annetutil/annetbox@d89d4aa0a11e653333e79e87f846de9f241e22eb -
Branch / Tag:
refs/tags/v0.11.0 - Owner: https://github.com/annetutil
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@d89d4aa0a11e653333e79e87f846de9f241e22eb -
Trigger Event:
push
-
Statement type:
File details
Details for the file annetbox-0.11.0-py3-none-any.whl.
File metadata
- Download URL: annetbox-0.11.0-py3-none-any.whl
- Upload date:
- Size: 24.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c89071b27484deada2f5643d587316b69c6ce594d4fda2ee1cf8e4d068a9d3a
|
|
| MD5 |
289f6fe9ee267a99c57c94e77c5ae627
|
|
| BLAKE2b-256 |
69783b1e16cbde976cb2042f4ac08181766569fa3f32ff6e7f3554ed0cd98678
|
Provenance
The following attestation bundles were made for annetbox-0.11.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on annetutil/annetbox
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
annetbox-0.11.0-py3-none-any.whl -
Subject digest:
8c89071b27484deada2f5643d587316b69c6ce594d4fda2ee1cf8e4d068a9d3a - Sigstore transparency entry: 1185652940
- Sigstore integration time:
-
Permalink:
annetutil/annetbox@d89d4aa0a11e653333e79e87f846de9f241e22eb -
Branch / Tag:
refs/tags/v0.11.0 - Owner: https://github.com/annetutil
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@d89d4aa0a11e653333e79e87f846de9f241e22eb -
Trigger Event:
push
-
Statement type: