Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netboxlabs-device-discovery-0.1.0.tar.gz (27.9 kB view details)

Uploaded Source

File details

Details for the file netboxlabs-device-discovery-0.1.0.tar.gz.

File metadata

File hashes

Hashes for netboxlabs-device-discovery-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b2ad66197ee4881a7cc1b1fc8f3690bb88a188ef9cf27591e3d85e14b01e9b6d
MD5 67ada3df485c7c370ebd6c1bc82b2108
BLAKE2b-256 4632363792dddc208c89d1872a8da54991d83113b45c8ac11201023c214ebccd

See more details on using hashes here.

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

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page