def migrate(session, task, id, revision): if id == 'all': instances = Instance.all(session) else: instances = [Instance.get(session, id)] for instance in instances: instance.upgrade_schema(revision)
def instances_allowed_for_user(context, request): email = urllib.unquote(request.matchdict['email']) user = User.get(request.db_session, email) res = {} for instance in Instance.all(request.db_session): if user.can_access(instance): res[instance.domain] = instance.to_dict() return res
def reload(session, task, id, force=False, kill=False): if id == 'all': instances = Instance.all(session) else: instances = [Instance.get(session, id)] for instance in instances: if instance.enabled: instance.reload(force=force, kill=kill)
def rewrite(session, task, id): if id == "all": instances = Instance.all(session) else: instances = [Instance.get(session, id)] envs = {} for instance in instances: if not instance.enabled: continue env = instance.environment envs[env.name] = env instance.rewrite(restart_services=False) for env in envs.values(): env.restart_services()