Use this API to count dnszone_domain_binding resources configued on NetScaler.
336094
public static long count(nitro_service service, String zonename) throws Exception{
		dnszone_domain_binding obj = new dnszone_domain_binding();
		obj.set_zonename(zonename);
		options option = new options();
		option.set_count(true);
		dnszone_domain_binding response[] = (dnszone_domain_binding[]) obj.get_resources(service,option);
		if (response != null) {
			return response[0].__count;
		}
		return 0;
	}
913858
def list_domains_by_service(self, service_id):
		""""""
		content = self._fetch("/service/%s/domain" % service_id, method="GET")
		return map(lambda x: FastlyDomain(self, x), content)
1423
def count_cookies(self, domain):
        ''''''
        cookies = self.cookie_jar._cookies

        if domain in cookies:
            return sum(
                [len(cookie) for cookie in cookies[domain].values()]
            )
        else:
            return 0
202904
public static long count(nitro_service service, String viewname) throws Exception{
		dnsview_gslbservice_binding obj = new dnsview_gslbservice_binding();
		obj.set_viewname(viewname);
		options option = new options();
		option.set_count(true);
		dnsview_gslbservice_binding response[] = (dnsview_gslbservice_binding[]) obj.get_resources(service,option);
		if (response != null) {
			return response[0].__count;
		}
		return 0;
	}
398710
function getRecordSetsAndDomains(result, callback) {
      HostedZoneId = result.HostedZones.find(i=>i.Name === `${domain}.`).Id
      parallel({
        apis(callback) {
          gateway.getDomainNames({
            limit: 500,
          }, callback)
        },
        records(callback) {
          route53.listResourceRecordSets({
            HostedZoneId,
          }, callback)
        }
      }, callback)
    }
77296
public static dnsnsrec get(nitro_service service, String domain) throws Exception{
		dnsnsrec obj = new dnsnsrec();
		obj.set_domain(domain);
		dnsnsrec response = (dnsnsrec) obj.get_resource(service);
		return response;
	}
1139175
public static long count(nitro_service service, String limitidentifier) throws Exception{
		nslimitidentifier_nslimitsessions_binding obj = new nslimitidentifier_nslimitsessions_binding();
		obj.set_limitidentifier(limitidentifier);
		options option = new options();
		option.set_count(true);
		nslimitidentifier_nslimitsessions_binding response[] = (nslimitidentifier_nslimitsessions_binding[]) obj.get_resources(service,option);
		if (response != null) {
			return response[0].__count;
		}
		return 0;
	}
525676
public static dnsview_binding get(nitro_service service, String viewname) throws Exception{
		dnsview_binding obj = new dnsview_binding();
		obj.set_viewname(viewname);
		dnsview_binding response = (dnsview_binding) obj.get_resource(service);
		return response;
	}
1087141
public static dnsparameter get(nitro_service service) throws Exception{
		dnsparameter obj = new dnsparameter();
		dnsparameter[] response = (dnsparameter[])obj.get_resources(service);
		return response[0];
	}
1295705
public static dnspolicy[] get(nitro_service service) throws Exception{
		dnspolicy obj = new dnspolicy();
		dnspolicy[] response = (dnspolicy[])obj.get_resources(service);
		return response;
	}
978012
public static base_responses add(nitro_service client, dnsnameserver resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			dnsnameserver addresources[] = new dnsnameserver[resources.length];
			for (int i=0;i<resources.length;i++){
				addresources[i] = new dnsnameserver();
				addresources[i].ip = resources[i].ip;
				addresources[i].dnsvservername = resources[i].dnsvservername;
				addresources[i].local = resources[i].local;
				addresources[i].state = resources[i].state;
				addresources[i].type = resources[i].type;
			}
			result = add_bulk_request(client, addresources);
		}
		return result;
	}
938398
def lookup_domain(domain, nameservers=[], rtype="A",
                  exclude_nameservers=[], timeout=2):
    """"""
    dns_exp = DNSQuery(domains=[domain], nameservers=nameservers, rtype=rtype,
                       exclude_nameservers=exclude_nameservers, timeout=timeout)
    return dns_exp.lookup_domain(domain)
973810
public static dns_stats get(nitro_service service) throws Exception{
		dns_stats obj = new dns_stats();
		dns_stats[] response = (dns_stats[])obj.stat_resources(service);
		return response[0];
	}
837233
public static dnssoarec[] get(nitro_service service) throws Exception{
		dnssoarec obj = new dnssoarec();
		dnssoarec[] response = (dnssoarec[])obj.get_resources(service);
		return response;
	}
53966
public static dnszone_domain_binding[] get(nitro_service service, String zonename) throws Exception{
		dnszone_domain_binding obj = new dnszone_domain_binding();
		obj.set_zonename(zonename);
		dnszone_domain_binding response[] = (dnszone_domain_binding[]) obj.get_resources(service);
		return response;
	}
446287
public static base_responses enable(nitro_service client, dnsnameserver resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			dnsnameserver enableresources[] = new dnsnameserver[resources.length];
			for (int i=0;i<resources.length;i++){
				enableresources[i] = new dnsnameserver();
				enableresources[i].ip = resources[i].ip;
				enableresources[i].dnsvservername = resources[i].dnsvservername;
			}
			result = perform_operation_bulk_request(client, enableresources,"enable");
		}
		return result;
	}
774555
public int countActiveInstances(ServiceManagerResourceRestService service, String templateName)
	{
		List<ResourceInstanceDTO> instances = activeInstances(service, templateName);

		return instances.size();
	}