Esempio n. 1
0
    def __init__(self):
        super(hQExecServerRequestProcessor, self).__init__()

        self.commands["RUN"] = hQCommand(
            name="run",
            regExp="^run:(.*)",
            arguments=["job_id"],
            help="message from hq-server to run job",
            fct=self.process_run,
        )
Esempio n. 2
0
    def __init__( self ):
        ############
        # define commands
        ############
        
        self.commands = {}	# {<COMMAND>: hQCommand, ...}

        
        self.commands["HELP"] = hQCommand( name = "help",
                                           regExp = "^help$",
                                           help = "return help",
                                           fct = self.process_help )
        self.commands["PING"] = hQCommand( name = "ping",
                                           regExp = '^ping$',
                                           help = "return 'pong'",
                                           fct = self.process_ping )
        self.commands["INFO"] = hQCommand( name = "info",
                                           regExp = "^info$",
                                           help = "return some information about server",
                                           fct = self.process_details )
        self.commands["STATUS"] = hQCommand( name = "status",
                                             regExp = "^status$",
                                             help = "print status of server",
                                             fct = self.process_status )
        self.commands["SHUTDOWN"] = hQCommand( name = "shutdown",
                                             regExp = "^shutdown$",
                                             help = "shutdown server",
                                             fct = self.process_shutdown )
        self.commands["LSTHREADS"] = hQCommand( name = "lsthreads",
                                                regExp = "^lsthreads$",
                                                help = "return list of active threads with [start time] [thread id] [thread name] [shorted command]",
                                                fct = self.process_lsthreads )
        self.commands["LSTHREAD"] = hQCommand( name = "lsthread",
                                               regExp = "^lsthread:(.*)",
                                               arguments = ['thread_id'],
                                               help = "return details of thread with specified id (see lsthread)",
                                               fct = self.process_lsthread )
        self.commands["LSLOGGER"] = hQCommand( name = "lslogger",
                                               regExp = "^lslogger$",
                                               help = "return logger setting",
                                               fct = self.process_lslogger )
        self.commands["ACTIVATELOGGER"] = hQCommand( name = "activatelogger",
                                                     regExp = "^activatelogger:(.*)",
                                                     arguments = ["logger"],
                                                     help = "activate logger",
                                                     fct = self.process_activatelogger )
        self.commands["DEACTIVATELOGGER"] = hQCommand( name = "deactivatelogger",
                                                       regExp = "^deactivatelogger:(.*)",
                                                       arguments = ["logger"],
                                                       help = "deactivate logger",
                                                       fct = self.process_deactivatelogger )
        self.commands["LSLOOP"] = hQCommand( name = "lsloops",
                                              regExp = "^lsloops$",
                                              help = "return list of loops",
                                              fct = self.process_lsloops )
        self.commands["SETLOOPINTERVAL"] = hQCommand( name = "setloopinterval",
                                              regExp = "^setloopinterval:(.*):(.*)$",
                                              arguments = ["loop_key","interval"],
                                              help = "set interval of loop with provided key (check lsloops) to interval in seconds",
                                              fct = self.process_updateloop )
        self.commands["SLEEP"] = hQCommand( name = "sleep",
                                            regExp = "^sleep:(.*)",
                                            arguments = ['time_in_secs'],
                                            help = "just sleep",
                                            fct = self.process_sleep )
Esempio n. 3
0
 def __init__( self ):
     super( hQUserServerRequestProcessor, self ).__init__()
     
     self.commands["LSS"] = hQCommand( name = "lss",
                                       regExp = "^lss$",
                                       help = "return list of hq-exec-servers",
                                       fct = self.process_lss )
     self.commands["INVOKESERVERS"] = hQCommand( name = "invokeservers",
                                           regExp = "^invokeservers$",
                                           help = "invoke all hq-exec-servers of hosts in cluster",
                                           fct = self.process_invokeservers )
     self.commands["CLEANUP"] = hQCommand( name = "cleanup",
                                       regExp = "^cleanup$",
                                       help = "cleanup servers",
                                       fct = self.process_cleanup )
     self.commands["ADD"] = hQCommand( name = "addjob",
                                          regExp = "^addjob:(.*)",
                                          arguments = ["json_str"],
                                          help = "add multiple jobs at once to hq.",
                                          fct = self.process_addjob )
     self.commands["ADDJOBS"] = hQCommand( name = "addjobs",
                                           regExp = "^addjobs:(.*)",
                                           arguments = ["json_str"],
                                           help = "add multiple jobs at once to hq.",
                                           fct = self.process_addjobs )
     self.commands["RUN"] = hQCommand( name = "run",
                                       regExp = "^run:(.*)",
                                       arguments = ["json_str"],
                                       help = "message from hq-server to run jobs",
                                       fct = self.process_run )
     self.commands["LSWJOBS"] = hQCommand( name = 'lswjobs',
                                           regExp = '^lswjobs:?(.*)',
                                           arguments = ['num'],
                                           help = "return the last num waiting jobs. default: return the last 10. specify 'all' in order to return all waiting jobs",
                                           fct = self.process_lswjobs )
     self.commands["LSPJOBS"] = hQCommand( name = 'lspjobs',
                                           regExp = '^lspjobs:?(.*)',
                                           arguments = ['num'],
                                           help = "return the last num pending jobs. default: return the last 10. specify 'all' in order to return all pending jobs",
                                           fct = self.process_lspjobs )
     self.commands["LSRJOBS"] = hQCommand( name = 'lsrjobs',
                                           regExp = '^lsrjobs:?(.*)',
                                           arguments = ['num'],
                                           help = "return the last num running jobs. default: return the last 10. specify 'all' in order to return all running jobs",
                                           fct = self.process_lsrjobs )
     self.commands["LSFJOBS"] = hQCommand( name = 'lsfjobs',
                                           regExp = '^lsfjobs:?(.*)',
                                           arguments = ['num'],
                                           help = "return the last num finished jobs. default: return the last 10. specify 'all' in order to return all finished jobs",
                                           fct = self.process_lsfjobs )
     self.commands["LAJOB"] = hQCommand( name = 'lajob',
                                         regExp = 'lajob:(.*)',
                                         arguments = ["job_id"],
                                         help = "return job info about job with given jobID",
                                         fct = self.process_lajob )
     self.commands["LSGROUPS"] = hQCommand( name = 'lsgroups',
                                         regExp = 'lsgroups',
                                         help = "return groups of user",
                                         fct = self.process_lsgroups )
     self.commands["LAGROUP"] = hQCommand( name = 'lagroup',
                                         regExp = 'lagroup:(.*)',
                                         arguments = ["group_name"],
                                         help = "return details about group with given group identifier",
                                         fct = self.process_lagroup )
     self.commands["FINDJOBS"] = hQCommand( name = 'findjobs',
                                            regExp = 'findjobs:(.*)',
                                            arguments = ["match_str"],
                                            help = "return all jobs which match the search string in command, info text or group.",
                                            fct = self.process_findjobs )