cloudmesh-storage.cloudmesh.storage.provider.gdrive.Provider

Module Contents

Classes

Provider

class cloudmesh-storage.cloudmesh.storage.provider.gdrive.Provider.Provider(service=None)

Bases: cloudmesh.abstract.StorageABC.StorageABC

kind = gdrive
sample = TODO: missing
output
generate_flags_json(self)
generate_key_json(self)
get_credentials(self)
We have stored the credentials in “.credentials”

folder and there is a file named ‘google-drive-credentials.json’ that has all the credentials required for our authentication If there is nothing stored in it this program creates credentials json file for future authentication Here the authentication type is OAuth2

Returns

Return type

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 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

delete(self, filename=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

create_dir(self, directory=None)

creates a directory

Parameters

directory – the name of the directory

Returns

dict

list(self, source=None, 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

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

upload_file(self, source, filename, parent_it)
download_file(self, source, file_id, file_name, mime_type)
cloud_path(self, srv_path)
update_dict(self, elements)