cterasdk.edge.files.browser module#

class cterasdk.edge.files.browser.FileBrowser(Gateway)#

Bases: object

Gateway File Browser APIs

copy(src, dest, overwrite=False)#

Copy a file or a folder

Parameters:
  • src (str) – Source file or folder path

  • dest (str) – Destination folder path

  • overwrite (bool,optional) – Overwrite on conflict, defaults to False

delete(path)#

Delete a file

Parameters:

path (str) – The file’s path on the gateway

download(path, destination=None)#

Download a file

Parameters:
  • path (str) – The file path on the Edge Filer

  • destination (str,optional) – File destination, if it is a directory, the original filename will be kept, defaults to the default directory

download_as_zip(cloud_directory, files, destination=None)#

Download a list of files and/or directories from a cloud folder as a ZIP file

Warning

The list of files is not validated. The ZIP file will include only the existing files and directories

Parameters:
  • cloud_directory (str) – Path to the cloud directory

  • files (list[str]) – List of files and/or directories in the cloud folder to download

  • destination (str,optional) – File destination, if it is a directory, the filename will be calculated, defaults to the default directory

static ls(_path)#
mkdir(path, recurse=False)#

Create a new directory

Parameters:
  • path (str) – The path of the new directory

  • recurse (bool,optional) – Create subdirectories if missing, defaults to False

static mkpath(path)#
move(src, dest, overwrite=False)#

Move a file or a folder

Parameters:
  • src (str) – Source file or folder path

  • dest (str) – Destination folder path

  • overwrite (bool,optional) – Overwrite on conflict, defaults to False

openfile(path)#

Obtain a file handle

Parameters:

path (str) – The file path on the Edge Filer

upload(file_path, server_path)#

Upload a file

Parameters:
  • file_path (str) – Path to the local file to upload

  • server_path (str) – Path to the directory to upload the file to