def detach(gandi, resource, background, force):
    """Detach an ip from it's currently attached vm.

    resource can be an ip id or ip.
    """
    if not force:
        proceed = click.confirm('Are you sure you want to detach ip %s?' %
                                resource)
        if not proceed:
            return

    return gandi.ip.detach(resource, background, force)
Detach an ip from it's currently attached vm.

    resource can be an ip id or ip.