How to use the pyopencga.rest_clients.user_client.Users function in pyopencga

To help you get started, we’ve selected a few pyopencga examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github opencb / opencga / opencga-client / src / main / python / pyOpenCGA / pyopencga / opencga_client.py View on Github external
self.projects = None
        self.studies = None
        self.files = None
        self.samples = None
        self.cohorts = None
        self.families = None
        self.jobs = None
        self.individuals = None
        self.clinical = None
        self.alignment = None
        self.variant = None
        self.ga4gh = None
        self.meta = None

        ## [TODO] convert to @properties
        self.users = Users(self.configuration, self.session_id, self._login_handler, auto_refresh=self.auto_refresh)
        self.projects = Projects(self.configuration, self.session_id, self._login_handler, auto_refresh=self.auto_refresh)
        self.studies = Studies(self.configuration, self.session_id, self._login_handler, auto_refresh=self.auto_refresh)
        self.files = Files(self.configuration, self.session_id, self._login_handler, auto_refresh=self.auto_refresh)
        self.samples = Samples(self.configuration, self.session_id, self._login_handler, auto_refresh=self.auto_refresh)
        self.cohorts = Cohorts(self.configuration, self.session_id, self._login_handler, auto_refresh=self.auto_refresh)
        self.families = Families(self.configuration, self.session_id, self._login_handler, auto_refresh=self.auto_refresh)
        self.jobs = Jobs(self.configuration, self.session_id, self._login_handler, auto_refresh=self.auto_refresh)
        self.individuals = Individuals(self.configuration, self.session_id, self._login_handler, auto_refresh=self.auto_refresh)
        self.clinical = Clinical(self.configuration, self.session_id, self._login_handler, auto_refresh=self.auto_refresh)
        self.alignment = Alignment(self.configuration, self.session_id, self._login_handler, auto_refresh=self.auto_refresh)
        self.variant = Variant(self.configuration, self.session_id, self._login_handler, auto_refresh=self.auto_refresh)
        self.ga4gh = GA4GH(self.configuration, self.session_id, self._login_handler, auto_refresh=self.auto_refresh)
        self.meta = Meta(self.configuration, self.session_id, self._login_handler, auto_refresh=self.auto_refresh)
        self.admin = Admin(self.configuration, self.session_id, self._login_handler, auto_refresh=self.auto_refresh)
        self.panels = Panels(self.configuration, self.session_id, self._login_handler, auto_refresh=self.auto_refresh)
        self.tool = Tool(self.configuration, self.session_id, self._login_handler, auto_refresh=self.auto_refresh)
github opencb / opencga / opencga-client / src / main / python / pyOpenCGA / pyopencga / opencga_client.py View on Github external
def login_handler(refresh=False):
            self.user_id = user
            if refresh:
                self.session_id = Users(self.configuration, session_id=self.session_id).refresh_token(user=user).responses[0]['results'][0]['token']
            else:
                self.session_id = Users(self.configuration).login(user=user, pwd=pwd).responses[0]['results'][0]['token']

            self.token = self.session_id

            for client in self.clients:
                client.session_id = self.session_id  # renew the client's token
                client.token = self.token  # renew the client's token
            return self.token
github opencb / opencga / opencga-client / src / main / python / pyOpenCGA / pyopencga / opencga_client.py View on Github external
def login_handler(refresh=False):
            self.user_id = user
            if refresh:
                self.session_id = Users(self.configuration, session_id=self.session_id).refresh_token(user=user).responses[0]['results'][0]['token']
            else:
                self.session_id = Users(self.configuration).login(user=user, pwd=pwd).responses[0]['results'][0]['token']

            self.token = self.session_id

            for client in self.clients:
                client.session_id = self.session_id  # renew the client's token
                client.token = self.token  # renew the client's token
            return self.token