cloudmesh-storage.cloudmesh.storage.Provider

Module Contents

Classes

Provider

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

Bases: cloudmesh.abstract.StorageABC.StorageABC

static get_kind()
static get_provider(kind)
monitor(self, status='all', output='table')

get the status of all the actions in status :param status: :return

clean(self)

clean all the actions in database

run(self)

Execute the actions in the database/queue

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

gets the content of the source on the server to the local destination

Parameters
  • source (string) – the source file on the server

  • destination (string) – the destination location ion teh local machine

  • recursive (boolean) – True if the source is a directory and ned to be copied recursively

Returns

cloudmesh cm dict

Return type

dict

put(self, source=None, destination=None, 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=None)

creates a directory

Parameters

directory – the name of the directory

Returns

dict

delete(self, name=None)

deletes the source

Parameters

name – The source

Returns

The dict representing the source

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

list(self, name=None, dir_only=False, recursive=False)

lists the information as dict

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

  • dir_only – Only the directory names

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

Returns

dict

tree(self, source)

Prints a visual representation of the files and directories :param directory: :type directory: :return: :rtype:

static get_source_provider(source_kind, source, config)
copy(self, source=None, destination=None, recursive=False)

Copies object(s) from source to destination

Parameters
  • source – “awss3:source.txt” the source is combination of source CSP name and source object name which either can be a directory or file

  • destination – “azure:target.txt” the destination is combination of destination CSP and destination object name 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

copyFiles(self, source_cloud, source_file, target_cloud, target_file)