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.