def runCommand(self): self.parseArgs(usage=""" cdb-get-users Description: Retrieves list of registered users. """) api = UserRestApi(self.getUsername(), self.getPassword(), self.getServiceHost(), self.getServicePort(), self.getServiceProtocol()) users = api.getUsers() for user in users: print user.getDisplayString(self.getDisplayKeys(), self.getDisplayFormat())
def runCommand(self): self.parseArgs(usage=""" cdb-get-user --id=ID|--username=USERNAME Description: Retrieves user information. """) self.checkArgs() api = UserRestApi(self.getUsername(), self.getPassword(), self.getServiceHost(), self.getServicePort(), self.getServiceProtocol()) if self.getId() is not None: userInfo = api.getUserById(self.getId()) else: userInfo = api.getUserByUsername(self.getUsername()) print(userInfo.getDisplayString(self.getDisplayKeys(), self.getDisplayFormat()))