def absent_strategy(api, wished_ip):
    response = api.get('ips')
    changed = False
    status_code = response.status_code
    ips_json = response.json
    ips_list = ips_json['ips']
    if (not response.ok):
        api.module.fail_json(msg='Error getting IPs [{0}: {1}]'.format(status_code, response.json['message']))
    ip_lookup = dict(((ip['id'], ip) for ip in ips_list))
    if (wished_ip['id'] not in ip_lookup.keys()):
        return (changed, {})
    changed = True
    if api.module.check_mode:
        return (changed, {'status': 'IP would be destroyed'})
    response = api.delete(('/ips/' + wished_ip['id']))
    if (not response.ok):
        api.module.fail_json(msg='Error deleting IP [{0}: {1}]'.format(response.status_code, response.json))
    return (changed, response.json)
def absent_strategy(api, wished_ip):
    response = api.get('ips')
    changed = False
    status_code = response.status_code
    ips_json = response.json
    ips_list = ips_json['ips']
    if (not response.ok):
        api.module.fail_json(msg='Error getting IPs [{0}: {1}]'.format(status_code, response.json['message']))
    ip_lookup = dict(((ip['id'], ip) for ip in ips_list))
    if (wished_ip['id'] not in ip_lookup.keys()):
        return (changed, {})
    changed = True
    if api.module.check_mode:
        return (changed, {'status': 'IP would be destroyed'})
    response = api.delete(('/ips/' + wished_ip['id']))
    if (not response.ok):
        api.module.fail_json(msg='Error deleting IP [{0}: {1}]'.format(response.status_code, response.json))
    return (changed, response.json)