cterasdk.core.files.browser module

class cterasdk.core.files.browser.FileBrowser(portal, base_path)

Bases: cterasdk.core.base_command.BaseCommand

Portal File Browser APIs

copy(src, dest)

Copy a file or directory

Parameters:
  • src (str) – The source path of the file or directory
  • dst (str) – The destination path of the file or directory
copy_multi(src, dest)
delete(path)

Delete a file

Parameters:path (str) – Path of the file or directory to delete
delete_multi(*args)

Delete multiple files and/or directories

Parameters:*args – Variable lengthed list of paths of files and/or directories to delete
download(path)

Download a file

Parameters:path (str) – Path of the file to download
download_as_zip(cloud_directory, files)

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
ls(path)

Execute ls on the provided path

Parameters:path (str) – Path to execute ls on
mkdir(path, recurse=False)

Create a new directory

Parameters:
  • path (str) – Path of the directory to create
  • recurse (bool,optional) – Whether to create the path recursivly, defaults to False

Create a link to a file

Parameters:
  • path (str) – The path of the file to create a link to
  • access (str,optional) – Access policy of the link, defaults to ‘RO’
  • expire_in (int,optional) – Number of days until the link expires, defaults to 30
mkpath(array)
move(src, dest)

Move a file or directory

Parameters:
  • src (str) – The source path of the file or directory
  • dst (str) – The destination path of the file or directory
move_multi(src, dest)
rename(path, name)

Rename a file

Parameters:
  • path (str) – Path of the file or directory to rename
  • name (str) – The name to rename to
undelete(path)

Restore a previously deleted file or directory

Parameters:path (str) – Path of the file or directory to restore
undelete_multi(*args)

Restore previously deleted multiple files and/or directories

Parameters:*args – Variable length list of paths of files and/or directories to restore
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
walk(path)

Perform walk on the provided path

Parameters:path (str) – Path to perform walk on