def setup(self): timer = Timer() timer.start("Setup") rest = RetryingRestProxy(RestRequests(self.config.get_url())) auth = Auth(rest) if not auth.authenticate(self.config.get_token()): print("Could not authenticate.") return False self.rest = AuthenticatingRestProxy(rest, self.config.get_token()) self.projects = Projects(self.rest) self.batches = Batches(self.rest) self.groups = Groups(self.rest) self.permissions = Permissions(self.rest) timer.stop() return True
def setup(self): timer = Timer() timer.start("Setup") rest = RetryingRestProxy(RestRequests(self.url)) auth = Auth(rest) if not auth.authenticate(self.token): print("Could not authenticate.") return False self.rest = AuthenticatingRestProxy(rest, self.token) self.projects = Projects(self.rest) self.batches = Batches(self.rest) self.groups = Groups(self.rest) self.permissions = Permissions(self.rest) self.processing_service = AdamProcessingService(self.rest) timer.stop() return True
def setup(self): """Sets up the API client and modules for issuing requests to the ADAM API.""" timer = Timer() timer.start("Setup") retrying_rest = RetryingRestProxy(RestRequests()) self.rest = AuthenticatingRestProxy(retrying_rest) auth = Auth(self.rest) if not auth.authenticate(): print("Could not authenticate.") return False self.projects = ProjectsClient(self.rest) self.batches = Batches(self.rest) self.groups = Groups(self.rest) self.permissions = Permissions(self.rest) self.processing_service = AdamProcessingService(self.rest) timer.stop() return True