Giter VIP home page Giter VIP logo

csv2b1ddi's Introduction

CSV2B1DDI migration tool

Version: 0.6 Author: John Neerdael Email: [email protected]

Description

This script can be used to import data from NIOS CSV files in to BloxOne DDI. We expect CSV files per object type (example: networks.csv containing a header-network line and the objects which start with network).

Host objects are currently not supported in this script.

Prerequisites

Python 3.6 or above

Non-standard modules:

  • bloxone 0.5.6+

The latest version of the bloxone module is available on PyPI and can simply be installed using:

pip3 install bloxone --user

To upgrade to the latest version:

pip3 install bloxone --user --upgrade

Complete list of modules:

import bloxone
import csv
import json
import argparse
import re
    import ipaddress

Basic Configuration

The bloxone module use an ini file for configuration.

A sample is provided called demo.ini. Unless an alternative is specified on the command line, the script will automatically use the demo.ini from the current working directory if available.

The format of the ini file is:

[BloxOne]
url = 'https://csp.infoblox.com'
api_version = 'v1'
api_key = '<Your Region API Key Here>'

Once your API key is configured, your username and customer name are set you are ready to run the script with the required parameters.

Usage

csv2b1ddi.py supports -h or --help on the command line to access the options available:

$ ./csv2b1ddi.py --help
    usage: csv2b1ddi [-h] [-b NETWORKCONTAINERS] [-n NETWORKS] [-r RANGES] [-f FIXED] [-z AUTHZONES] [-a ARECORD] [-t TXTRECORD] [-m MXRECORD] [-p PTRRECORD] [-s SRVRECORD] [--aaaa AAAARECORD] [--cname CNAMERECORD] [--tags TAGS] -i IPSPACE -c CONFIG [-v]

    This is a simple NIOS to B1DDI migration tool

    optional arguments:
      -h, --help            show this help message and exit
      -b NETWORKCONTAINERS, --networkblock NETWORKCONTAINERS
                                                    CSV file with Networks data
      -n NETWORKS, --networks NETWORKS
                                                    CSV file with Networks data
      -r RANGES, --ranges RANGES
                                                    CSV file with DHCP ranges data
      -f FIXED, --fixed FIXED
                                                    CSV file with Fixed Address data
      -z AUTHZONES, --authzone AUTHZONES
                                                    CSV file with Authoritative Zones data
      -a ARECORD, --arecord ARECORD
                                                    CSV file with A record data
      -t TXTRECORD, --txtrecord TXTRECORD
                                                    CSV file with TXT record data
      -m MXRECORD, --mxrecord MXRECORD
                                                    CSV file with MX record data
      -p PTRRECORD, --ptrrecord PTRRECORD
                                                    CSV file with PTR record data
      -s SRVRECORD, --srvrecord SRVRECORD
                                                    CSV file with SRV record data
      --aaaa AAAARECORD     CSV file with AAAA record data
      --cname CNAMERECORD   CSV file with AAAA record data
      --tags TAGS           Tags to apply to imported objects
      -i IPSPACE, --ipspace IPSPACE
                                                    Name of IP space to import data in
      -c CONFIG, --config CONFIG
                                                    Path to ini file with API key
      -v, --version         show program's version number and exit
Tags are added in a specific format (note that currently the double quotes need to be escaped):
$ ./csv2b1ddi-0.5.py --tags '{"OWNER":"jneerdael","LOCATION":"Amsterdam"}'

There is currently no or very little error handling. Please thread with caution, EA's are not imported and tags are currently only supported as shown above. We except a correct and existing BloxOne DNS view to be present in the CSV files, the ipspace provided through the CLI also needs to be present.

csv2b1ddi's People

Contributors

johnneerdael avatar

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.