log-parser.py 文件源码

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

项目:aws-waf-security-automation 作者: cerbo 项目源码 文件源码
def waf_get_ip_set(ip_set_id):
    response = None
    waf = boto3.client('waf')

    for attempt in range(API_CALL_NUM_RETRIES):
        try:
            response = waf.get_ip_set(IPSetId=ip_set_id)
        except Exception, e:
            print(e)
            delay = math.pow(2, attempt)
            print("[waf_get_ip_set] Retrying in %d seconds..." % (delay))
            time.sleep(delay)
        else:
            break
    else:
        print("[waf_get_ip_set] Failed ALL attempts to call API")

    return response
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号