def kill(): """ Create kill message. Returns: str: Kill message. """ return __message('kill')
def ask_storage_state(): """ Create ask_storage_state message. Returns: str: Ask_storage_state message. """ return __message('ask_storage_state')
def file_sent(name): """ Create file_sent message. Args: name (str): The file name. Returns: str: File_sent message. """ return __message('file_sent', name=name)
def storage_state(blocks): """ Create disk_state message. Args: blocks (list of dict): List of blocks information. client (str): The client. Returns: str: Storage_state message. """ return __message('storage_state', blocks=blocks)
def disk_state(total, free): """ Create disk_state message. Args: total (int): Total bytes in the disk. free (int): Free bytes in the disk. Returns: str: Disk_state message. """ return __message('disk_state', total=total, free=free)
def delete_block(name='*', block_type='*', number='*'): """ Create delete_block message. Args: name (str): The name of the file. block_type (str, optional): The block type. number (str, optional): The block number. Returns: str: Delete_block message. """ return __message('delete_block', block_type=block_type, name=name, number=number)
def send_block(block_type, name, number, content): """ Create send_block message. Args: block_type (str): The block type. name (str): The name of the file. number (str, optional): The block number. content (str): The block content. Returns: str: Send_block message. """ return __message('send_block', block_type=block_type, name=name, number=number, content=content)
def block(block_type, name, number, content): """ Create block message. Args: block_type (str): The block type. name (str): The file name. number (int): The block number. content (str): The block content. Returns: str: Block message. """ return __message('block', block_type=block_type, name=name, number=number, content=content)