def list_systems(self): """ List all DAS systems. """ cond = {"system": {"$ne": None}} gen = (row["system"] for row in self.col.find(cond, ["system"])) return list(set(gen2list(gen)) & set(self.services))
def list_systems(self): """ List all DAS systems. """ cond = { 'system' : { '$ne' : None } } gen = (row['system'] for row in self.col.find(cond, ['system'])) return gen2list(gen)
def api_params(self, api): """ Retrieve API parameters from analytics DB """ cond = {'api.name':api} gen = (row['api']['params'] for row in \ self.col.find(cond, ['api.params'])) return gen2list(gen)
def list_systems(self): """ List all DAS systems. """ if not self.systems: spec = {"type": "service", "system": {"$ne": None}} gen = (row["system"] for row in self.col.find(spec, ["system"], exhaust=True)) self.systems = list(set(gen2list(gen)) & set(self.services)) return self.systems
def list_apis(self, system=None): """ List all APIs. """ cond = { 'api.name' : { '$ne' : None } } if system: cond['system'] = system gen = (row['api']['name'] for row in \ self.col.find(cond, ['api.name'])) return gen2list(gen)
def list_systems(self): """ List all DAS systems. """ if not self.systems: spec = { 'type': 'service', 'system' : { '$ne' : None } } gen = (row['system'] \ for row in self.col.find(spec, ['system'], **PYMONGO_OPTS)) self.systems = list( set(gen2list(gen)) & set(self.services) ) return self.systems
def list_apis(self, system=None): """ List all APIs. """ if self.apicache and self.apicache.has_key(system): return self.apicache[system] cond = {"urn": {"$ne": None}} if system: cond["system"] = system gen = (row["urn"] for row in self.col.find(cond, ["urn"])) self.apicache[system] = gen2list(gen) return self.apicache[system]
def list_apis(self, system=None): """ List all APIs. """ if self.apicache and system in self.apicache: return self.apicache[system] spec = {"type": "service", "urn": {"$ne": None}} if system: spec["system"] = system gen = (row["urn"] for row in self.col.find(spec, ["urn"], exhaust=True)) self.apicache[system] = gen2list(gen) return self.apicache[system]
def list_apis(self, system=None): """ List all APIs. """ if self.apicache and system in self.apicache: return self.apicache[system] spec = { 'type': 'service', 'urn' : { '$ne' : None } } if system: spec['system'] = system gen = (row['urn'] \ for row in self.col.find(spec, ['urn'], **PYMONGO_OPTS)) self.apicache[system] = gen2list(gen) return self.apicache[system]