Giter Club home page Giter Club logo

nixbox's Introduction

NixBox

A very work in progress NixOS IPAM implantation. Trying to integrate with NetBox.

NetBox doesn't model routing topology which sucks for us since we want to know things like the default-gateway to dynamically generate NixOS config. There are quite a few issues about it, see:

Usage

You can follow the usage examples, since we can just interact with the demo instance at https://demo.netbox.dev The login credentials are admin:admin

Export data from an existing NetBox instance

First we need to get a api token to authenticate against the api. And store it in NIXBOX_NETBOX_TOKEN so NixBox can use it:

export NIXBOX_NETBOX_TOKEN=$(curl -s -X POST -H "Content-Type: application/json" -H "Accept: application/json; indent=4" https://demo.netbox.dev/api/users/tokens/provision/ --data '{ "username": "admin", "password": "admin" }' | jq -r -e .key)

Now you can run the NixBox CLI to fetch the data:

nix run github:Janik-Haag/nixbox -- export

Import data into netbox

NetBox has a concept called datafiles/datasources, you can read about the here Currently they only provide a structured interface for importing files, but I'm planning on adding synchronization support to NetBox, which shouldn't be too hard to pull of since most of the required infrastructure already exists.

In the meantime you can build a demo data file with:

nix build github:Janik-Haag/nixbox#dataSourceDemo

This will result in:

./result
└── address

You can now go ahead and upload the file on to the demo instance here And see that it successfully imports the objects from ./example/ipam/ip-addresses.json.

nixbox's People

Contributors

janik-haag avatar peterablehmann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

gwimm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.