def _get_container_from_db(c_id): cdb = query_db('select * from databases where docker_id = ?', args=[c_id], one=True) if cdb is None: raise Exception('No container by id %s' % c_id) return cdb
def get_containers(details=False): cs = [] with app.app_context(): for c in query_db('select * from databases'): cs.append({'id': c['docker_id'], 'name': c['name'], 'type': c['type']}) if not details: return cs else: detail_containers = [] for c in cs: # app.logger.debug(c) details = inspect_container(c['id']) details['name'] = c['name'] details['type'] = c['type'] detail_containers.append(details) return detail_containers
def get_containers(details=False): cs = [] with app.app_context(): for c in query_db('select * from databases'): cs.append({ 'id': c['docker_id'], 'name': c['name'], 'type': c['type'] }) if not details: return cs else: detail_containers = [] for c in cs: # app.logger.debug(c) details = inspect_container(c['id']) details['name'] = c['name'] details['type'] = c['type'] detail_containers.append(details) return detail_containers