def from_ip(cls, ip):
        """Retrieve webacc id associated to a webacc ip"""
        result = cls.list({'items_per_page': 500})
        webaccs = {}
        for webacc in result:
            for server in webacc['servers']:
                webaccs[server['ip']] = webacc['id']
        return webaccs.get(ip)
def from_ip ( cls , ip ) : result = cls . list ( { 'items_per_page' : 500 } ) webaccs = { } for webacc in result : for server in webacc [ 'servers' ] : webaccs [ server [ 'ip' ] ] = webacc [ 'id' ] return webaccs . get ( ip )
Retrieve webacc id associated to a webacc ip