Ip under firewall

REST: GET /ip/{ip}/firewall
@param enabled [required] Filter the value of enabled property (=)
@param state [required] Filter the value of state property (=)
@param ip [required]
180705
public ArrayList<String> ip_firewall_GET(String ip, Boolean enabled, OvhFirewallStateEnum state) throws IOException {
		String qPath = "/ip/{ip}/firewall";
		StringBuilder sb = path(qPath, ip);
		query(sb, "enabled", enabled);
		query(sb, "state", state);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, t2);
	}
1146928
public boolean inRange(InetAddress ip) throws FilterException {
        Iterator iter = ranges.iterator();
        while (iter.hasNext()) {
            IPAddressRange range = (IPAddressRange) iter.next();
            if (range.inRange(ip)) {
                return true;
            }
        }

        return false;
    }
521841
def query_ip(self, ip):
        
        try:
            result = self.pssl.query(ip)
        except:
            self.error('Exception during processing with passiveSSL. '
                       'Please check the format of ip.')

        # Check for empty result
        # result is always assigned, self.error exits the function.
        if not result.get(ip, None):
            certificates = []
        else:
            certificates = list(result.get(ip).get('certificates'))

        newresult = {'ip': ip,
                     'certificates': []}
        for cert in certificates:
            newresult['certificates'].append({'fingerprint': cert,
                                              'subject': result.get(ip).get('subjects').get(cert).get('values')[0]})
        return newresult
658080
public static ipset[] get_filtered(nitro_service service, String filter) throws Exception{
		ipset obj = new ipset();
		options option = new options();
		option.set_filter(filter);
		ipset[] response = (ipset[]) obj.getfiltered(service, option);
		return response;
	}
254089
public boolean isAllowed(final DeviceState state) {
        boolean isAllowed = true;
        if (deniedStates.contains(state)) {
            isAllowed = false;
        }
        return isAllowed;
    }
161154
def get_by_ip(cls, ip):
        ''
        ret = cls.hosts_by_ip.get(ip)
        if ret is None:
            ret = cls.hosts_by_ip[ip] = [Host(ip)]
        return ret
691346
public static base_responses enable(nitro_service client, String ip[]) throws Exception {
		base_responses result = null;
		if (ip != null && ip.length > 0) {
			dnsnameserver enableresources[] = new dnsnameserver[ip.length];
			for (int i=0;i<ip.length;i++){
				enableresources[i] = new dnsnameserver();
				enableresources[i].ip = ip[i];
			}
			result = perform_operation_bulk_request(client, enableresources,"enable");
		}
		return result;
	}
1367063
function searchNetworkInterface(ip, networks) {
    networks = networks || getNetworkInterfaces();
    for (const [net, netinfo] of Object.entries(networks)) {
        const ipnet = netinfo.ip;
        const mask = netinfo.netmask;
        if (isNetworkSame(mask, ip, ipnet)) {
            return net;
        }
    }
    return null;
}
675879
public static Predicate<Connectivity> hasState(final NetworkInfo.State... states) {
    return new Predicate<Connectivity>() {
      @Override public boolean test(@NonNull Connectivity connectivity) throws Exception {
        for (NetworkInfo.State state : states) {
          if (connectivity.state() == state) {
            return true;
          }
        }
        return false;
      }
    };
  }
1342115
@Nullable protected de.uniulm.omi.cloudiator.flexiant.client.domain.Server searchByIp(
        Set<de.uniulm.omi.cloudiator.flexiant.client.domain.Server> servers, String ip) {
        for (de.uniulm.omi.cloudiator.flexiant.client.domain.Server server : servers) {
            if (server.getPublicIpAddress() != null && server.getPublicIpAddress().equals(ip)) {
                return server;
            }
            if (server.getPrivateIpAddress() != null && server.getPrivateIpAddress().equals(ip)) {
                return server;
            }
        }
        return null;
    }
473070
public <T> T get(Class<T> stateType) {
		Map<Class<?>, Object> states = getStates();
		T value = getState( states, stateType );

		if ( value == null ) {
			throw new IllegalArgumentException( "Accessing state of type not enabled: " + stateType );
		}

		return value;
	}
611317
public ArrayList<Long> ip_phishing_GET(String ip, String ipOnAntiphishing, OvhAntiphishingStateEnum state) throws IOException {
		String qPath = "/ip/{ip}/phishing";
		StringBuilder sb = path(qPath, ip);
		query(sb, "ipOnAntiphishing", ipOnAntiphishing);
		query(sb, "state", state);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, t1);
	}
800264
public static int aton(final String ip)
	{
		try
		{
			return aton(InetAddress.getByName(ip));
		}
		catch (UnknownHostException e)
		{
			throw new IllegalArgumentException("must pass a valid ip. Illegal input was: " + ip, e);
		}
	}
803234
public static iptunnel[] get_filtered(nitro_service service, String filter) throws Exception{
		iptunnel obj = new iptunnel();
		options option = new options();
		option.set_filter(filter);
		iptunnel[] response = (iptunnel[]) obj.getfiltered(service, option);
		return response;
	}
285611
public OvhArpBlockedIp ip_arp_ipBlocked_GET(String ip, String ipBlocked) throws IOException {
		String qPath = "/ip/{ip}/arp/{ipBlocked}";
		StringBuilder sb = path(qPath, ip, ipBlocked);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhArpBlockedIp.class);
	}
250422
protected void releaseIpAddress( String ip ) {
		this.logger.fine( "Releasing IP address: " + ip );
		this.usedIps.remove( ip );
		save( this );
	}
468183
def ipinfo_ip_check(ip):
    """"""
    if not is_IPv4Address(ip):
        return None

    response = requests.get('http://ipinfo.io/%s/json' % ip)
    return response.json()