1、激活 key 认证时,会获取一个 key,这个 key 就是通过云简网络网关访问接口的钥匙。
2、获取设备序列号:devSN
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'),)