dnacentersdk
所属分类:生物医药技术
开发工具:Python
文件大小:793KB
下载次数:0
上传日期:2022-12-08 05:54:08
上 传 者:
sh-1993
说明: 思科DNA中心Python SDK
(Cisco DNA Center Python SDK)
文件列表:
.flake8 (525, 2019-08-24)
.travis.yaml (175, 2019-08-24)
LICENSE (1070, 2019-08-24)
MANIFEST.in (39, 2019-08-24)
Pipfile (659, 2019-08-24)
Pipfile.lock (20130, 2019-08-24)
dnacentersdk (0, 2019-08-24)
dnacentersdk\__init__.py (1980, 2019-08-24)
dnacentersdk\_metadata.py (1503, 2019-08-24)
dnacentersdk\api (0, 2019-08-24)
dnacentersdk\api\__init__.py (17456, 2019-08-24)
dnacentersdk\api\authentication.py (6667, 2019-08-24)
dnacentersdk\api\custom_caller.py (6942, 2019-08-24)
dnacentersdk\api\v1_2_10 (0, 2019-08-24)
dnacentersdk\api\v1_2_10\__init__.py (24, 2019-08-24)
dnacentersdk\api\v1_2_10\clients.py (8380, 2019-08-24)
dnacentersdk\api\v1_2_10\command_runner.py (8794, 2019-08-24)
dnacentersdk\api\v1_2_10\devices.py (142490, 2019-08-24)
dnacentersdk\api\v1_2_10\fabric_wired.py (12665, 2019-08-24)
dnacentersdk\api\v1_2_10\file.py (10605, 2019-08-24)
dnacentersdk\api\v1_2_10\network_discovery.py (129961, 2019-08-24)
dnacentersdk\api\v1_2_10\networks.py (18975, 2019-08-24)
dnacentersdk\api\v1_2_10\non_fabric_wireless.py (21023, 2019-08-24)
dnacentersdk\api\v1_2_10\path_trace.py (18581, 2019-08-24)
dnacentersdk\api\v1_2_10\pnp.py (110522, 2019-08-24)
dnacentersdk\api\v1_2_10\site_profile.py (9111, 2019-08-24)
dnacentersdk\api\v1_2_10\sites.py (12376, 2019-08-24)
dnacentersdk\api\v1_2_10\swim.py (25137, 2019-08-24)
dnacentersdk\api\v1_2_10\tag.py (43504, 2019-08-24)
dnacentersdk\api\v1_2_10\task.py (21378, 2019-08-24)
dnacentersdk\api\v1_2_10\template_programmer.py (56249, 2019-08-24)
dnacentersdk\api\v1_3_0 (0, 2019-08-24)
dnacentersdk\api\v1_3_0\__init__.py (24, 2019-08-24)
dnacentersdk\api\v1_3_0\clients.py (8309, 2019-08-24)
dnacentersdk\api\v1_3_0\command_runner.py (8789, 2019-08-24)
dnacentersdk\api\v1_3_0\devices.py (142035, 2019-08-24)
... ...
=============
dnacentersdk
=============
*Work with the DNA Center APIs in native Python!*
-------------------------------------------------------------------------------
**dnacentersdk** is a *community developed* Python library for working with the DNA Center APIs. Our goal is to make working with DNA Center in Python a *native* and *natural* experience!
.. code-block:: python
from dnacentersdk import api
# Create a DNACenterAPI connection object;
# it uses DNA Center sandbox URL, username and password, with DNA Center API version 1.2.10.
dnac = api.DNACenterAPI(username="devnetuser",
password="Cisco123!",
base_url="https://sandboxdnac2.cisco.com:443",
version='1.2.10')
# 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 ]
# Delete all of the demo tags
for tag in demo_tags:
dnac.tag.delete_tag(tag.id)
# Create a new demo tag
demo_tag = dnac.tag.create_tag(name='dna Demo')
task_demo_tag = dnac.task.get_task_by_id(task_id=demo_tag.response.taskId)
if not task_demo_tag.response.isError:
# Retrieve created tag
created_tag = dnac.tag.get_tag(name='dna Demo')
# Update tag
update_tag = dnac.tag.update_tag(id=created_tag.response[0].id,
name='Updated ' + created_tag.response[0].name,
description='DNA demo tag')
print(dnac.task.get_task_by_id(task_id=update_tag.response.taskId).response.progress)
# Retrieved updated
updated_tag = dnac.tag.get_tag(name='Updated dna Demo')
print(updated_tag)
else:
# Get task error details
print('Unfortunately ', task_demo_tag.response.progress)
print('Reason: ', task_demo_tag.response.failureReason)
Introduction_
Installation
------------
Installing and upgrading dnacentersdk is easy:
**Install via PIP**
.. code-block:: bash
$ pip install dnacentersdk
**Upgrading to the latest Version**
.. code-block:: bash
$ pip install dnacentersdk --upgrade
Documentation
-------------
**Excellent documentation is now available at:**
https://dnacentersdk.readthedocs.io
Check out the Quickstart_ to dive in and begin using dnacentersdk.
Release Notes
-------------
Please see the releases_ page for release notes on the incremental functionality and bug fixes incorporated into the published releases.
Questions, Support & Discussion
-------------------------------
dnacentersdk is a *community developed* and *community supported* project. If you experience any issues using this package, please report them using the issues_ page.
Contribution
------------
dnacentersdk_ is a community development projects. Feedback, thoughts, ideas, and code contributions are welcome! Please see the `Contributing`_ guide for more information.
Inspiration
------------
This library is inspired by the webexteamssdk_ library
*Copyright (c) 2019 Cisco and/or its affiliates.*
.. _Introduction: https://dnacentersdk.readthedocs.io/en/latest/api/intro.html
.. _dnacentersdk.readthedocs.io: https://dnacentersdk.readthedocs.io
.. _Quickstart: https://dnacentersdk.readthedocs.io/en/latest/api/quickstart.html
.. _dnacentersdk: https://github.com/cisco-en-programmability/dnacentersdk
.. _issues: https://github.com/cisco-en-programmability/dnacentersdk/issues
.. _pull requests: https://github.com/cisco-en-programmability/dnacentersdk/pulls
.. _releases: https://github.com/cisco-en-programmability/dnacentersdk/releases
.. _the repository: dnacentersdk_
.. _pull request: `pull requests`_
.. _Contributing: https://github.com/cisco-en-programmability/dnacentersdk/blob/master/docs/contributing.rst
.. _webexteamssdk: https://github.com/CiscoDevNet/webexteamssdk
近期下载者:
相关文件:
收藏者: