UnifiAPI.py 文件源码

python
阅读 44 收藏 0 点赞 0 评论 0

项目:pythonUnifiAPI 作者: delian 项目源码 文件源码
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')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号