cloudmesh-storage.cloudmesh.storage.provider.local.Provider

Module Contents

Classes

Provider

cloudmesh:

Functions

creation_date(path_to_file)

Try to get the date that a file was created, falling back to when it was

cloudmesh-storage.cloudmesh.storage.provider.local.Provider.creation_date(path_to_file)

Try to get the date that a file was created, falling back to when it was last modified if that isn’t possible. See http://stackoverflow.com/a/39501288/1709587 for explanation.

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

Bases: cloudmesh.abstract.StorageABC.StorageABC

cloudmesh:
a:
cm:

active: False heading: Local A host: localhost label: local_a kind: local version: 1.0

default:

directory: .

credentials:

directory: ~/.cloudmesh/storage/a

default location is credentials.directory / default.directory

kind = local
sample
output
_filename(self, filename)
_dirname(self, dirname)
identifier(self, dirname, filename, absolute=False, file=True, status='ok')
create_file(self, location, content)
create_dir(self, directory=None)

creates a directory

Parameters

directory – the name of the directory

Returns

dict

create_dir_from_filename(self, filename=None)

creates a directory form a filename

Parameters

filename – the filename path

Returns

dict

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

lists the information as dict

Parameters
  • source – the source 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, source=None, absolute=False, recursive=False, files_only=False, dir_only=False, status='ok')

lists the information as dict

Parameters
  • source – the source 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=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

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

gets the source and copies it in destination

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, source=None, recursive=False)

deletes the source

Parameters
  • source – the source 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

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

tree(self, directory=None)

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