-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from cisco-en-programmability/develop
Develop 2.6.11
- Loading branch information
Showing
8 changed files
with
146 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from dnacentersdk import api | ||
|
||
# Create a DNACenterAPI connection object; | ||
# it uses DNA Center sandbox URL, username and password, with DNA Center API version 2.3.5.3. | ||
# and requests to verify the server's TLS certificate with verify=True. | ||
dnac = api.DNACenterAPI(username="devnetuser", | ||
password="Cisco123!", | ||
base_url="https://sandboxdnac.cisco.com:443", | ||
version='2.3.5.3', | ||
verify=True) | ||
|
||
# Find all devices that have 'Switches and Hubs' in their family | ||
devices = dnac.devices.get_device_list(family='Switches and Hubs') | ||
|
||
# Print all of demo devices | ||
for device in devices.response: | ||
print('{:20s}{}'.format(device.hostname, device.upTime)) | ||
|
||
# Find all tags | ||
all_tags = dnac.tag.get_tag(sort_by='name', order='des') | ||
demo_tags = [tag for tag in all_tags.response if 'Demo' in tag.name ] | ||
|
||
print(all_tags) |