This repository is deprecated; please follow the main search page or use the ‘Related code repos’ widget on the right side of the current page.

cisco-dnac-ipam-smartsheet

Export Global IP Pools from Cisco DNA-C and then Import to Smartsheet


Why?

Because many people still likes XLS files with their IP Pools :)
Smartsheet offers history change.

Features

  • Export Cisco DNA-C to CSV File
  • Export Smartsheet to CSV File
  • Import to Smartsheet from CSV File
    • Search for Smartsheet (ID)

Technologies & Frameworks Used

This is Cisco Sample Code!

Cisco Products & Services:

Third-Party Products & Services:

Tools & Frameworks:

  • Python3
  • Smartsheet Python SDK
  • Docker (optional)

Usage

python run.py -h

usage: run.py [-h] [--export-from-dnac EXPORT_FROM_DNAC]
              [--import-to-smartsheet IMPORT_TO_SMARTSHEET IMPORT_TO_SMARTSHEET]
              [--export-from-smartsheet EXPORT_FROM_SMARTSHEET]
              [--search-smartsheets SEARCH_SMARTSHEETS]

cisco-dnac-ipam-smartsheet version 0.1

optional arguments: -h, --help show this help message and exit --export-from-dnac EXPORT_FROM_DNAC CSV export from Cisco DNA-C --import-to-smartsheet IMPORT_TO_SMARTSHEET IMPORT_TO_SMARTSHEET Import CSV file to Smartsheet --export-from-smartsheet EXPORT_FROM_SMARTSHEET CSV export from Smartsheet --search-smartsheets SEARCH_SMARTSHEETS Search sheets based on value

Sample file is ipam.csv

"Name","IP Subnet Mask","Gateways","DHCP Server","DNS Server","Overlapping"
"Global_Pool","192.168.0.0/16","['192.168.1.1']","[]","[]","False"
"Overlay","172.17.0.0/24","['172.17.0.254']","['10.10.0.1', '10.10.0.2']","['10.1.1.1', '10.2.1.1']","False"
"Overlay-Second","172.17.1.0/24","['172.17.1.254']","['10.10.0.1']","['10.1.1.1']","False"
"test01","10.0.0.0/16","['10.0.0.1']","[]","[]","True"
"test02","172.16.0.0/24","['172.16.0.1']","[]","[]","False"
"Underlay","10.10.0.0/16","['10.10.0.1']","['10.10.0.1']","['10.10.0.2']","True"

Installation

git clone https://github.com/robertcsapo/cisco-dnac-ipam-smartsheet
pip install -r requirements.txt

Edit settings for Smartsheet / Cisco DNA-C

vim run.py

run.py

''' Smartsheet API Token '''
access_token = "Changeme"
''' Cisco DNA-C Login '''
dnacHost = "sandboxdnac.cisco.com"
dnacUser = "devnetuser"
dnacPass = "Cisco123!"

Docker (optional)

Start

docker run -it robertcsapo/cisco-dnac-ipam-smartsheet /bin/bash

Edit settings for Smartsheet / Cisco DNA-C

vim run.py

Run code

python run.py

Authors & Maintainers

Credits

Inspiration from https://github.com/tdorssers/dnac

License

This project is licensed to you under the terms of the Cisco Sample
Code License
.

Use Case

This Python script leverages the Cisco DNA Center API to export IP pool information, including pool name, size, gateway, DNS, and DHCP. The data can be exported into a CSV file. There are also options to directly export the CSV file to Smartsheet.

View code on GitHub

Code Exchange Community

Get help, share code, and collaborate with other developers in the Code Exchange community.View Community
Disclaimer:
Cisco provides Code Exchange for convenience and informational purposes only, with no support of any kind. This page contains information and links from third-party websites that are governed by their own separate terms. Reference to a project or contributor on this page does not imply any affiliation with or endorsement by Cisco.