Use this API to fetch filtered set of hostcpu resources.
filter string should be in JSON format.eg: "vm_state:DOWN,name:[a-z]+"
170901
public static hostcpu[] get_filtered(nitro_service service, String filter) throws Exception
	{
		hostcpu obj = new hostcpu();
		options option = new options();
		option.set_filter(filter);
		hostcpu[] response = (hostcpu[]) obj.getfiltered(service, option);
		return response;
	}
815624
def get_filter(self, name=constants.STRING_FILTER):
        
        try:
            filter_key = c_uamqp.symbol_value(name)
            return self._address.filter_set[filter_key].value
        except (TypeError, KeyError):
            return None
250054
public static service[] get_filtered(nitro_service service, String filter) throws Exception{
		service obj = new service();
		options option = new options();
		option.set_filter(filter);
		service[] response = (service[]) obj.getfiltered(service, option);
		return response;
	}
500506
public static managed_device[] get_filtered(nitro_service service, String filter) throws Exception
	{
		managed_device obj = new managed_device();
		options option = new options();
		option.set_filter(filter);
		managed_device[] response = (managed_device[]) obj.getfiltered(service, option);
		return response;
	}
195399
public static ntp_sync[] get_filtered(nitro_service service, String filter) throws Exception
	{
		ntp_sync obj = new ntp_sync();
		options option = new options();
		option.set_filter(filter);
		ntp_sync[] response = (ntp_sync[]) obj.getfiltered(service, option);
		return response;
	}
970000
public static ci[] get_filtered(nitro_service service, String filter) throws Exception{
		ci obj = new ci();
		options option = new options();
		option.set_filter(filter);
		ci[] response = (ci[]) obj.getfiltered(service, option);
		return response;
	}
424264
public static onlinkipv6prefix[] get_filtered(nitro_service service, String filter) throws Exception{
		onlinkipv6prefix obj = new onlinkipv6prefix();
		options option = new options();
		option.set_filter(filter);
		onlinkipv6prefix[] response = (onlinkipv6prefix[]) obj.getfiltered(service, option);
		return response;
	}
886255
public static appqoecustomresp[] get_filtered(nitro_service service, String filter) throws Exception{
		appqoecustomresp obj = new appqoecustomresp();
		options option = new options();
		option.set_filter(filter);
		appqoecustomresp[] response = (appqoecustomresp[]) obj.getfiltered(service, option);
		return response;
	}
811667
public static systemgroup[] get_filtered(nitro_service service, String filter) throws Exception{
		systemgroup obj = new systemgroup();
		options option = new options();
		option.set_filter(filter);
		systemgroup[] response = (systemgroup[]) obj.getfiltered(service, option);
		return response;
	}
293536
def get_computers(self, filterTerm=None, domain=None):
        

        cur = self.conn.cursor()

        # if we're returning a single host by ID
        if self.is_computer_valid(filterTerm):
            cur.execute("SELECT * FROM computers WHERE id=? LIMIT 1", [filterTerm])

        # if we're filtering by domain controllers
        elif filterTerm == 'dc':
            if domain:
                cur.execute("SELECT * FROM computers WHERE dc=1 AND LOWER(domain)=LOWER(?)", [domain])
            else:
                cur.execute("SELECT * FROM computers WHERE dc=1")

        # if we're filtering by ip/hostname
        elif filterTerm and filterTerm != "":
            cur.execute("SELECT * FROM computers WHERE ip LIKE ? OR LOWER(hostname) LIKE LOWER(?)", ['%{}%'.format(filterTerm), '%{}%'.format(filterTerm)])

        # otherwise return all computers
        else:
            cur.execute("SELECT * FROM computers")

        results = cur.fetchall()
        cur.close()
        return results
1077393
def filter_service_by_regex_host_name(regex):
    
    host_re = re.compile(regex)

    def inner_filter(items):
        """Inner filter for service. Accept if regex match service.host.host_name"""
        service = items["service"]
        host = items["hosts"][service.host]
        if service is None or host is None:
            return False
        return host_re.match(host.host_name) is not None

    return inner_filter
251911
public static ping[] get_filtered(nitro_service service, String filter) throws Exception
	{
		ping obj = new ping();
		options option = new options();
		option.set_filter(filter);
		ping[] response = (ping[]) obj.getfiltered(service, option);
		return response;
	}
620240
public static xen_health_disk[] get_filtered(nitro_service service, String filter) throws Exception
	{
		xen_health_disk obj = new xen_health_disk();
		options option = new options();
		option.set_filter(filter);
		xen_health_disk[] response = (xen_health_disk[]) obj.getfiltered(service, option);
		return response;
	}
431884
public static cacheglobal_cachepolicy_binding[] get_filtered(nitro_service service, String filter) throws Exception{
		cacheglobal_cachepolicy_binding obj = new cacheglobal_cachepolicy_binding();
		options option = new options();
		option.set_filter(filter);
		cacheglobal_cachepolicy_binding[] response = (cacheglobal_cachepolicy_binding[]) obj.getfiltered(service, option);
		return response;
	}
756790
public static ipsecprofile[] get_filtered(nitro_service service, String filter) throws Exception{
		ipsecprofile obj = new ipsecprofile();
		options option = new options();
		option.set_filter(filter);
		ipsecprofile[] response = (ipsecprofile[]) obj.getfiltered(service, option);
		return response;
	}
1214613
public static xen_appcvpx_image[] get_filtered(nitro_service service, String filter) throws Exception
	{
		xen_appcvpx_image obj = new xen_appcvpx_image();
		options option = new options();
		option.set_filter(filter);
		xen_appcvpx_image[] response = (xen_appcvpx_image[]) obj.getfiltered(service, option);
		return response;
	}
1269979
public static vpnicaconnection[] get_filtered(nitro_service service, String filter) throws Exception{
		vpnicaconnection obj = new vpnicaconnection();
		options option = new options();
		option.set_filter(filter);
		vpnicaconnection[] response = (vpnicaconnection[]) obj.getfiltered(service, option);
		return response;
	}