def authorize_guest(self, mac, minutes=60, up=None, down=None, mbytes=None, apmac=None):
"""
Authorize one guest
:param mac: the mac of the guest
:param minutes: for how many minutes it is authorized
:param up: upstream bandwidth in kbits
:param down: downstream bandwidth in kbits
:param mbytes: mbytes limit in kbits
:param apmac: AP mac address (faster performance)
:return:
"""
data = {
'mac': mac.lower(),
'cmd': 'authorize-guest',
'minutes': minutes
}
if up:
data['up'] = up
if down:
data['down'] = down
if mbytes:
data['bytes'] = mbytes
if apmac:
data['ap_mac'] = apmac.lower()
content = self.sitecmdjson('/cmd/stamgr', data)
return self.response(content, inspect.stack()[0].function, 'Guest Authorization')
评论列表
文章目录