'Takes a string ipaddress and return the ip_pool API object dict'

def _get_ip_pool_for_string_ip_2_1(self, ip):

    pool = 'default'
    ip_obj = ipaddress.ip_address(six.text_type(ip))
    ip_pools = self._issue_api_request('access_network_ip_pools', api_version='2.1')
    for ipdata in ip_pools['data']:
        for adata in ipdata['network_paths']:
            if (not adata.get('start_ip')):
                continue
            pool_if = ipaddress.ip_interface('/'.join((adata['start_ip'], str(adata['netmask']))))
            if (ip_obj in pool_if.network):
                pool = ipdata['name']
    return self._issue_api_request('access_network_ip_pools/{}'.format(pool), api_version='2.1')['path']
