Example #1
0
class BaseMessage(Struct):
    # needs default as json.py seems to get inheritance wrong
    req = Field(str, '?')

    time = Field(float, default = time.time)
    hostname = Field(str, default = socket.gethostname())
    blob_hash = Field(str, default = '')
Example #2
0
class LogtailMessage (BaseMessage):
    req = Field(str, "pub.logtail")
    filename = Field(str)
    data = Field(str)                   # file contents (data fork)
    comp = Field(str)                   # compression method used
    mode = Field(str, 'b')              # file mode to use for fopen
    fpos = Field(int)
    op_mode = Field(str)                # classic, rotated
    st_dev = Field(long)                # device number
    st_ino = Field(int)                 # inode number
Example #3
0
class LogMessage(BaseMessage):
    "log.*"
    log_level = Field(str)
    service_type = Field(str)
    job_name = Field(str)
    log_msg = Field(str)
    log_time = Field(float)
    log_pid = Field(int)
    log_line = Field(int)
    log_function = Field(str)
Example #4
0
class InfofileMessage(BaseMessage):
    req = Field(str, "pub.infofile")
    mtime = Field(float)                # last modification time of file
    filename = Field(str)
    data = Field(str)                   # file contents (data fork)
    comp = Field(str)                   # compression method used
    mode = Field(str, 'b')              # file mode to use for fopen
Example #5
0
class TaskReplyMessage (BaseMessage):
    req = Field(str, "task.reply")
    task_id = Field(str)
    status = Field(str) # launched, feedback, finished, failed, running, stopped
Example #6
0
class TaskSendMessage(BaseMessage):
    """Request to execute a task"""
    req = Field(str, "task.send")
    task_host = Field(str)
    task_handler = Field(str)
    task_id = Field(str)
Example #7
0
class TaskRegisterMessage(BaseMessage):
    req = Field(str, "task.register")
    host = Field(str)
Example #8
0
class JobConfigReplyMessage(BaseMessage):
    req = Field(str, "job.config")
    job_name = Field(str)
    config = Field(dict)
Example #9
0
class JobConfigRequestMessage(BaseMessage):
    req = Field(str, "job.config")
    job_name = Field(str)
Example #10
0
class DatabaseMessage (BaseMessage):
    req = Field (str, "db")
    function = Field (str)
    params = Field (str)
Example #11
0
class EchoResponseMessage (BaseMessage):
    req = Field(str, "echo.response")
    orig_hostname = Field(str)
    orig_target = Field(str)
    orig_time = Field(float)
Example #12
0
class EchoRequestMessage (BaseMessage):
    req = Field(str, "echo.request")
    target = Field(str)
Example #13
0
class ErrorMessage (ReplyMessage):
    req = Field(str, "error")
    msg = Field(str)
Example #14
0
class ReplyMessage (BaseMessage):
    req = Field(str, "reply")