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 DNA Center - Assign Network Devices to Site

Dynamically create and assign sites and devices using Cisco DNA Center APIs

  • Obtain the Device to Site Mapping
  • Source is a JSON file
  • Get Site and Device information
  • Assign Network Device to Site
  • Ready for Cisco DNA Center Automation and Assurance

Getting Started

Use the following command to create your sites in Cisco DNA Center. Sites are defined in site-info.json file:

python create-site.py site-info.json

After you've succesfully setup your sites, you can start assigning devices to sites. Device to site assignment is defined in device-to-site.json file. Run the command below once ready:

python device-to-site.py device-to-site.json

Note: You change the controller credentials either through environment variables or by editing the dnac_config.py file

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Use Case

This code prepares devices for Cisco DNA Center Automation and Assurance by automating the process of assigning devices to sites. You create a JSON file that defines sites within your network, and then create a second JSON file that maps a device serial number to a site name.

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.