一个通过NX-API使用XML或jsonrpc管理思科设备的库。
项目描述
nxapi-plumbing
一个通过JSON-RPC和XML管理思科设备的低级库。
示例
使用JSON-RPC创建设备对象。
from nxapi_plumbing import Device
device = Device(
api_format="jsonrpc",
host="device.domain.com",
username="admin",
password="password",
transport="https",
port=8443,
)
返回结构化数据的JSON-RPC单条命令。
output = device.show("show hostname")
print(output)
输出将是命令的响应
{'hostname': 'nxos.domain.com'}
JSON-RPC命令列表
output = device.show_list(["show hostname", "show ntp status"])
pprint(output)
输出将是一系列响应(字典列表)
[
{
"command": "show hostname",
"result": {
"hostname": "nxos.domain.com"
}
},
{
"command": "show ntp status",
"result": {
"distribution": "Distribution : Disabled",
"operational_state": "Last operational state: No session"
}
}
]
项目详情
关闭
nxapi_plumbing-0.5.2.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 6f54f9983f023bd75b60acd907ff47f559541cc2b98f4fa638b8585ca0de0fb5 |
|
MD5 | 659fb78c98fe3edf30d812ab62cbb660 |
|
BLAKE2b-256 | 4d5f4c1d7dfbf987d3e4725957d0791d3c891c25a472bcee66ab20ebc4beb326 |