cloudmesh-storage.cloudmesh.storage.queue.StorageQueueABC

Module Contents

Classes

StorageQueue

class cloudmesh-storage.cloudmesh.storage.queue.StorageQueueABC.StorageQueue(name=None, parallelism=4)
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.

Parameters
  • sourcefile

  • destinationfile

  • recursive

Returns

abstract _put(self, specification: dict)dict

function to upload file or directory 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

delete(self, path, recursive=True)

adds a delete action to the queue

Parameters
  • path

  • recursive

Returns

abstract _delete(self, specification: dict)dict

deletes the source

Parameters

specification

Returns

dict

cancel(self, id=None)

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

abstract _cancel(self, specification: dict)dict
mkdir(self, path)

adds a mkdir action to the queue

create the directory in the storage service :param path: :return:

abstract _mkdir(self, specification: dict)dict

function to create a directory the function will first check if the bucket exists or not,if the bucket doesn’t exist it will create the bucket and it will create the directory specified. the name of the bucket will come from YAML specifications and the directory name comes from the arguments.

Parameters

specification

Returns

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

adds a list action to the queue

list the directory in the storage service :param path: :param dir_only: :param recursive:

Returns

abstract _list(self, specification: dict)dict

lists the information as dict

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

  • specification.dir_only – Only the directory names

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

Returns

dict

action(self, specification)

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

Parameters

specification

Returns

get_actions(self)

TODO: missing

Returns

update_dict(self, elements, kind=None)

this is an internal function for building dict object

Parameters
  • elements

  • kind

Returns

run(self)

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

Returns