NetBox Labs, Device Discovery backend for Orb Agent, part of NetBox Discovery
Project description
device-discovery
Orb device discovery backend
Config RFC
discovery:
config:
target: grpc://localhost:8080/diode
api_key: ${DIODE_API_KEY}
host: 0.0.0.0
port: 8072
Policy RFC
discovery:
policies:
discovery_1:
config:
schedule: "* * * * *" #Cron expression
defaults:
site: New York NY
scope:
- hostname: 192.168.0.32
username: ${USER}
password: admin
- driver: eos
hostname: 127.0.0.1
username: admin
password: ${ARISTA_PASSWORD}
optional_args:
enable_password: ${ARISTA_PASSWORD}
discover_once: # will run only once
scope:
- hostname: 192.168.0.34
username: ${USER}
password: ${PASSWORD}
Run device-discovery
device-discovery can be run by installing it with pip
git clone https://github.com/netboxlabs/orb-discovery.git
cd orb-discovery/
pip install --no-cache-dir ./device-discovery/
device-discovery -c config.yaml
Docker Image
device-discovery can be build and run using docker:
docker build --no-cache -t device-discovery:develop -f device-discovery/docker/Dockerfile .
docker run -v /local/orb:/usr/local/orb/ -p 8072:8072 device-discovery:develop device-discovery -c /usr/local/orb/config.yaml
Routes (v1)
Get runtime and capabilities information
GET
/api/v1/status
(gets discovery runtime data)
Parameters
None
Responses
http code content-type response 200
application/json; charset=utf-8
{"version": "0.1.0","up_time_seconds": 3678 }
Example cURL
curl -X GET -H "Content-Type: application/json" http://localhost:8072/api/v1/status
GET
/api/v1/capabilities
(gets device-discovery capabilities)
Parameters
None
Responses
http code content-type response 200
application/json; charset=utf-8
{"supported_drivers":["ios","eos","junos","nxos","cumulus"]}
Example cURL
curl -X GET -H "Content-Type: application/json" http://localhost:8072/api/v1/capabilities
Policies Management
POST
/api/v1/policies
(Creates a new policy)
Parameters
name type data type description None required YAML object yaml format specified in Policy RFC
Responses
http code content-type response 201
application/json; charset=UTF-8
{"detail":"policy 'policy_name' was started"}
400
application/json; charset=UTF-8
{ "detail": "invalid Content-Type. Only 'application/x-yaml' is supported" }
400
application/json; charset=UTF-8
Any other policy error 403
application/json; charset=UTF-8
{ "detail": "config field is required" }
409
application/json; charset=UTF-8
{ "detail": "policy 'policy_name' already exists" }
Example cURL
curl -X POST -H "Content-Type: application/x-yaml" --data-binary @policy.yaml http://localhost:8072/api/v1/policies
DELETE
/api/v1/policies/{policy_name}
(delete a existing policy)
Parameters
name type data type description policy_name
required string The unique policy name
Responses
http code content-type response 200
application/json; charset=UTF-8
{ "detail": "policy 'policy_name' was deleted" }
400
application/json; charset=UTF-8
Any other policy deletion error 404
application/json; charset=UTF-8
{ "detail": "policy 'policy_name' not found" }
Example cURL
curl -X DELETE http://localhost:8072/api/v1/policies/policy_name
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
File details
Details for the file netboxlabs-device-discovery-0.1.0.tar.gz
.
File metadata
- Download URL: netboxlabs-device-discovery-0.1.0.tar.gz
- Upload date:
- Size: 27.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2ad66197ee4881a7cc1b1fc8f3690bb88a188ef9cf27591e3d85e14b01e9b6d |
|
MD5 | 67ada3df485c7c370ebd6c1bc82b2108 |
|
BLAKE2b-256 | 4632363792dddc208c89d1872a8da54991d83113b45c8ac11201023c214ebccd |
Provenance
The following attestation bundles were made for netboxlabs-device-discovery-0.1.0.tar.gz
:
Publisher:
device-discovery-release.yaml
on netboxlabs/orb-discovery
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
netboxlabs_device_discovery-0.1.0.tar.gz
- Subject digest:
b2ad66197ee4881a7cc1b1fc8f3690bb88a188ef9cf27591e3d85e14b01e9b6d
- Sigstore transparency entry: 150606678
- Sigstore integration time:
- Predicate type: