1、激活 key 认证时,会获取一个 key,这个 key 就是通过云简网络网关访问接口的钥匙。
2、获取设备序列号:devSN
在云简网络平台页面顶部导航栏中选择"网络管理",而后在左侧导航栏中选择"总览 > 网
络 > 概览",在"设备"页签下设备列表中勾选显示"序列号"。
3、
import requests
url = "https://lvzhouapi.h3c.com/device/onlineclients"
headers = {"apikey": "xxxxxxxx","Accept": "application/json","Content-Type": "application/json"}
data = {"findoption": {"ApName": "A-6F"},"sortoption": {"ApName": 1}}
skip_num=0
for i in range(0,1):
querystring = {"devSN":"xxxxxxxx","skipnum":str(skip_num),"limitnum":"1000",} #limitnum:查看数量
skip_num +=999
response = requests.get( url, headers=headers, params=querystring,json=data)
client_list = response.json().get("clientList")
if i ==0 :print('在线用户: ',client_list.get("count_total"))
for client_info in client_list.get("clientInfo"):
print('终端ip:', client_info.get('clientIP'),
'接入的ap: ', client_info.get('ApName'),)