cloudmesh-storage.cloudmesh.storage.provider.StorageQueue

Module Contents

Classes

StorageQueue

class cloudmesh-storage.cloudmesh.storage.provider.StorageQueue.StorageQueue(service=None, parallelism=4)

Bases: cloudmesh.abstract.StorageABC.StorageABC

put_run
get_run
mkdir_run
cancel_run
delete_run
copy_run
list_run
search_run
pretty_print(self, data, data_type, output=None)
update_dict(self, elements)

this is an internal function for building dict object :param elements: :return:

abstract _notimplemented(self, specification)
Parameters

specification

Returns

add_cm(self, cm_name)
copy(self, sourcefile, destinationfile, recursive=False)

adds a copy action to the queue copies the file from the source service to the destination service using the file located in the path and storing it into the remote. If remote is not specified path is used for it. The copy will not be performed if the files are the same. :param sourcefile: The source file to copy :param destinationfile: The destination file path :param recursive: whether or not copy the file/dir recursively :return:

delete(self, source, recursive=True)

adds a delete action to the queue

Parameters
  • source

  • recursive

Returns

search(self, directory=None, filename=None, recursive=False)

gets the destination and copies it in source

Parameters
  • directory – the directory which either can be a directory or file

  • recursive – in case of directory the recursive refers to all subdirectories in the specified source

Returns

dict

cancel(self, name=None)

cancels a job with a specific id :param name: :return:

get(self, source, destination, recursive=False)

gets the destination and copies it in source

Parameters
  • source – the source which either can be a directory or file

  • destination – the destination which either can be a directory or file

  • recursive – in case of directory the recursive refers to all subdirectories in the specified source

Returns

dict

put(self, source, destination, recursive=False)

puts the source on the service

Parameters
  • source – the source which either can be a directory or file

  • destination – the destination which either can be a directory or file

  • recursive – in case of directory the recursive refers to all subdirectories in the specified source

Returns

dict

create_dir(self, directory)

adds a mkdir action to the queue create the directory in the storage service :param directory: :return:

list(self, source, dir_only=False, recursive=False)

adds a list action to the queue list the directory in the storage service :param source: :param dir_only: :param recursive: :return:

action(self, specification)

executes the action identified by the specification. This is used by the run command. :param specification: :return:

get_actions(self)

get all the actions from database param: :return lists of actions from database

run(self)

runs the copy process for all jobs in the queue and completes when all actions are completed

Returns

monitor(self, status, rate=5, output='table')
clean(self)