storage.messages package

Submodules

storage.messages.delete_files module

Defines a command message that deletes files from ScaleFile

class storage.messages.delete_files.DeleteFiles

Bases: messaging.messages.message.CommandMessage

Command message that deletes scale_file models

add_file(file_id)

Adds the given file to this message

Parameters:file_id (int) – The file ID
can_fit_more()

Indicates whether more files can fit in this message

Returns:True if more jobs can fit, False otherwise
Return type:bool
execute()

See messaging.messages.message.CommandMessage.execute()

static from_json(json_dict)

See messaging.messages.message.CommandMessage.from_json()

to_json()

See messaging.messages.message.CommandMessage.to_json()

storage.messages.delete_files.create_delete_files_messages(files, job_id, trigger_id, source_file_id, purge)

Creates messages to delete the given files

Parameters:
  • files ([collections.namedtuple]) – The list of file IDs to delete
  • job_id (int) – The id of the job that produced the files
  • trigger_id (int) – The trigger event id for the purge operation
  • source_file_id (int) – The source file id for the original file being purged
  • purge (bool) – Boolean value to determine if files should be purged from workspace
Returns:

The list of messages

Return type:

list()

storage.messages.move_files module

Defines a command message that moves files to a different workspace/location

class storage.messages.move_files.MoveFile

Bases: messaging.messages.message.CommandMessage

Command message that moves a scale_file model

execute()

See messaging.messages.message.CommandMessage.execute()

static from_json(json_dict)

See messaging.messages.message.CommandMessage.from_json()

to_json()

See messaging.messages.message.CommandMessage.to_json()

storage.messages.move_files.create_move_file_message(file_id)

Creates message to move the given file

Parameters:file_id (int) – The id of the file to update
Returns:The message
Return type:storage.messages.move_files.MoveFiles

Module contents