File Browser#

This article describes the file-browser APIs available in the CTERA Portal, which provide programmatic access to files and directories.

The APIs support both synchronous and asynchronous execution models, enabling developers to choose the approach best suited to their integration needs, from real-time operations to background processing.

Preface: Authentication#

All file-browser operations require an authenticated session with the CTERA Portal. Authentication is performed by creating a portal context and calling login with valid credentials.

Once authenticated, the files attribute provides access to the file-browser APIs.

Synchronous Authentication#

Set cterasdk.settings.core.syn.settings.connector.ssl = False to disable SSL verification.

Authenticate as a tenant user using ServicesPortal:

with ServicesPortal('tenant.ctera.com') as user:
    user.login(username, password)
    files = user.files

Authenticate as a global administrator using GlobalAdmin:

with GlobalAdmin('global.ctera.com') as admin:
    admin.login(username, password)
    files = admin.files

Asynchronous Authentication#

Set cterasdk.settings.core.asyn.settings.connector.ssl = False to disable SSL verification.

Authenticate as a tenant user using AsyncServicesPortal:

async with AsyncServicesPortal('tenant.ctera.com') as user:
    await user.login(username, password)
    files = user.files

Authenticate as a global administrator using AsyncGlobalAdmin:

async with AsyncGlobalAdmin('global.ctera.com') as admin:
    await admin.login(username, password)
    files = admin.files

User Roles and Permissions#

The file access APIs are available to the following user roles:

  • Global Administrators with the Access End User Folders permission enabled.

  • Team Portal Administrators with the Access End User Folders permission enabled.

  • End Users, accessing their personal cloud drive folders.

For more information about configuring administrator permissions, see Customizing Administrator Roles.

Key Objects#

This section describes the core objects returned by the file-browser APIs.

class cterasdk.cio.core.types.PortalResource(i, name, path, is_dir, deleted, size, permalink, last_modified, volume, worm)

Class for a Portal Filesystem Resource.

Variables:
  • id (int,optional) – Resource ID, defaults to None if not exists

  • name (str) – Resource name

  • pathcterasdk.cio.types.ServicesPortalPath or cterasdk.cio.types.GlobalAdminPath

  • is_dir (bool) – True if directory, False otherwise

  • deleted (bool) – True if deleted, False otherwise

  • size (int) – Size

  • last_modified (datetime.datetime) – Last Modified

  • extension (str) – Extension

  • permalink (str) – Permalink

  • volume (cterasdk.cio.core.types.PortalVolume,optional) – Volume information.

  • worm (cterasdk.cio.core.types.ComplianceSettings,optional) – Compliance Retention Settings.

static from_server_object(server_object)
property with_user_namespace
class cterasdk.cio.core.types.PortalVolume(i, name, group, protected, owner)

Class for a Portal Cloud Volume.

Variables:
  • id (int) – Cloud Drive Folder ID

  • name (str) – Cloud Drive Folder Name

  • group (int) – Folder Group ID

  • protected (bool) – Passphrase-Protected

  • owner (cterasdk.cio.core.types.VolumeOwner) – Volume owner information.

static from_server_object(server_object)
class cterasdk.cio.core.types.VolumeOwner(i, name)

Class for a Cloud Volume Owner.

Variables:
  • id (str) – Owner ID

  • id – Owner Full Name.

  • namespace (str) – User namespace.

property user_namespace
class cterasdk.cio.core.types.PreviousVersion(server_object)

Class Representing a Previous Version

Variables:
  • current (bool) – Current

  • pathcterasdk.cio.types.ServicesPortalPath or cterasdk.cio.types.GlobalAdminPath

  • start_time (datetime.datetime) – Snapshot start time

  • end_time (datetime.datetime) – Snapshot end time

static from_server_object(server_object)

Synchronous API#

Listing Files and Directories#

FileBrowser.listdir(path=None, include_deleted=False)

List directory contents.

Parameters:
  • path (str, optional) – Path. Defaults to the Cloud Drive root.

  • include_deleted (bool, optional) – Include deleted files. Defaults to False.

Returns:

Directory contents.

Return type:

list[cterasdk.cio.core.types.PortalResource]

Raises:
resources = files.listdir('My Files')
for r in resources:
    print(r.name, r.is_dir)
FileBrowser.walk(path=None, include_deleted=False)

Walk directory contents.

Parameters:
  • path (str, optional) – Path to walk. Defaults to the root directory.

  • include_deleted (bool, optional) – Include deleted files. Defaults to False.

Returns:

A generator of file-system objects.

Return type:

Iterator[cterasdk.cio.core.types.PortalResource]

Raises:
for resource in files.walk('My Files'):
    if not resource.is_dir and resource.extension == 'pdf':
        files.download(resource.path)

Listing Files from Previous Versions#

FileBrowser.versions(path)

List snapshots of a file or directory.

Parameters:

path (str) – Path.

Returns:

List of versions.

Return type:

list[cterasdk.cio.core.types.PreviousVersion]

Raises:

cterasdk.exceptions.io.core.GetVersionsError – Raised on error retrieving versions.

# List all versions of a file
versions = files.versions('My Files/Keystone Project.docx')
for v in versions:
    print(v.start_time, v.end_time, v.current)

# List files in a previous version
prev_version = next(v for v in versions if not v.current)
for f in files.listdir(prev_version.path):
    print(f'File in previous version: {f.path}, Size: {f.size}, Last modified: {f.last_modified}')

# Download files from a previous version
for f in files.listdir(prev_version.path):
    local_path = files.download(f.path)
    print(local_path)

Inspecting Files#

FileBrowser.properties(path)

Get object properties.

Parameters:

path (str) – Path.

Returns:

Object properties.

Return type:

cterasdk.cio.core.types.PortalResource

Raises:

cterasdk.exceptions.io.core.GetMetadataError – Raised on error retrieving object metadata.

metadata = files.properties('My Files/Keystone Project.docx')
print(metadata.size, metadata.last_modified)
FileBrowser.exists(path)

Check whether an item exists.

Parameters:

path (str) – Path.

Returns:

True if the item exists, False otherwise.

Return type:

bool

exists = files.exists('My Files/Keystone Project.docx')

File Handles#

FileBrowser.handle(path, objects=None)

Get a file handle.

Parameters:
  • path (str) – Path to a file.

  • objects (list[str],optional) – Files and folders to include.

Returns:

File handle.

Return type:

object

Raises:
"""Retrieve a handle for a file"""
handle = files.handle('My Files/Keystone Project.docx')

"""Retrieve a handle for a folder"""
handle = files.handle('My Files/Project X')

"""Retrieve a handle for individual files within a folder"""
handle = files.handle('My Files', ['Keystone Project.docx', 'Images', 'Notes.txt'])

Downloading Files#

FileBrowser.download(path, objects=None, destination=None)

Download a file.

Parameters:
  • path (str) – Path.

  • objects (list[str],optional) – List of files and / or directory names to download.

  • destination (str, optional) – File destination. If a directory is provided, the original filename is preserved. Defaults to the default download directory.

Returns:

Path to the local file.

Return type:

str

Raises:
"""Download a file"""
path = files.download('My Files/Keystone Project.docx')

"""Download a folder"""
path = files.download('My Files/Project X')

"""Download individual files within a folder"""
zip_archive = files.download('My Files', ['Keystone Project.docx', 'Images'], destination='/tmp/MyFiles.zip')

Create Directories#

CloudDrive.mkdir(path)

Create a directory.

Parameters:

path (str) – Directory path.

Returns:

Remote directory path.

Return type:

str

Raises:

cterasdk.exceptions.io.core.CreateDirectoryError – Raised on error creating directory.

new_dir = files.mkdir('My Files/NewProject')
print(f'Created directory: {new_dir}')
CloudDrive.makedirs(path)

Recursively create a directory.

Parameters:

path (str) – Directory path.

Returns:

Remote directory path.

Return type:

str

Raises:

cterasdk.exceptions.io.core.CreateDirectoryError – Raised on error creating directory.

nested_dir = files.makedirs('My Files/Projects/2026/Q1')
print(f'Created nested directories: {nested_dir}')

Uploading Files#

CloudDrive.upload_file(path, destination)

Upload a file.

Parameters:
  • path (str) – Local path.

  • destination (str) – Remote path.

Returns:

Remote file path.

Return type:

str

Raises:

cterasdk.exceptions.io.core.UploadError – Raised on upload failure.

# Upload from a local path to a directory
remote_path = files.upload_file('/tmp/Keystone Project.docx', 'My Files')
print(f'File uploaded to: {remote_path}')

# Upload from a local path and rename the file at the destination
remote_path = files.upload_file('/tmp/Keystone Project.docx', 'My Files/Keystone 2026.docx')
print(f'File uploaded to: {remote_path}')
CloudDrive.upload(destination, handle, name=None, size=None)

Upload from file handle.

Parameters:
  • destination (str) – Remote path.

  • handle (object) – File-like handle.

  • size (str, optional) – File size. Defaults to content length.

  • name (str, optional) – Filename to use if it cannot be derived from destination

Returns:

Remote file path.

Return type:

str

Raises:

cterasdk.exceptions.io.core.UploadError – Raised on upload failure.

name = 'Keystone Project.docx'
destination = 'My Files'

# Upload from file handle
with open('/tmp/Keystone Project.docx', 'rb') as f:
    remote_path = files.upload(name, destination, f)
print(f'File uploaded from handle to: {remote_path}')

# Upload from string or bytes
remote_path = files.upload(name, destination, handle=b'Sample content for ProjectPlan.')
print(f'File uploaded from bytes to: {remote_path}')

Renaming Files and Folders#

CloudDrive.rename(path, name, *, resolver=None, wait=True)

Rename a file or folder.

Parameters:
  • path (str) – Path of the file or directory.

  • name (str) – New name.

  • resolver (cterasdk.core.types.ConflictResolver, optional) – Conflict resolver. Defaults None.

  • wait (bool, optional) – Wait for task completion. Defaults to True.

Returns:

Task status object, or awaitable task.

Return type:

cterasdk.common.object.Object or cterasdk.lib.tasks.AwaitablePortalTask

Raises:

cterasdk.exceptions.io.core.RenameError – Raised on error renaming object.

remote_path = files.rename('My Files/Keystone Project.docx', 'Keystone Project 2026.docx')
print(f'Renamed file: {remote_path}')

Copying and Moving Files and Folders#

FileBrowser.copy(*paths, destination=None, resolver=None, cursor=None, wait=True)

Copy one or more files or folders.

Parameters:
Returns:

Task status object, or awaitable task.

Return type:

cterasdk.common.object.Object or cterasdk.lib.tasks.AwaitablePortalTask

Raises:

cterasdk.exceptions.io.core.CopyError – Raised on failure to copy resources.

# Copy files into a destination directory
result = files.copy('My Files/Keystone Project.docx', 'My Files/Keystone Notes.txt', destination='Archive')
print(f'Files copied: {result}')

# Copy multiple files at once while renaming them. Requires explicitly defining the target path
result = files.copy(
    ('My Files/Keystone Project.docx', 'Archive/Keystone Project 2026.docx'),
    ('My Files/Keystone Notes.txt', 'Archive/Keystone Notes 2026.txt')
)
print(f'Files copied with explicit paths: {result}')
CloudDrive.move(*paths, destination=None, resolver=None, cursor=None, wait=True)

Move one or more files or folders.

Parameters:
Returns:

Task status object, or awaitable task.

Return type:

cterasdk.common.object.Object or cterasdk.lib.tasks.AwaitablePortalTask

Raises:

cterasdk.exceptions.io.core.MoveError – Raised on error moving resources.

# Move files into a destination directory
result = files.move('My Files/Keystone Project.docx', 'My Files/Keystone Notes.txt', destination='Archive')
print(f'Files moved: {result}')

# Move multiple files at once while renaming them. Requires explicitly defining the target path
result = files.move(
    ('My Files/Keystone Project.docx', 'Archive/Keystone 2026.docx'),
    ('My Files/Keystone Notes.txt', 'Archive/Keystone Notes 2026.txt')
)
print(f'Files moved with explicit paths: {result}')

Delete or Recovering Files and Folders#

CloudDrive.delete(*paths, wait=True)

Delete one or more files or folders.

Parameters:
  • paths (list[str]) – Paths to delete.

  • wait (bool, optional) – Wait for task completion. Defaults to True.

Returns:

Task status object, or awaitable task.

Return type:

cterasdk.common.object.Object or cterasdk.lib.tasks.AwaitablePortalTask

Raises:

cterasdk.exceptions.io.core.DeleteError – Raised on error deleting resources.

result = files.delete('My Files/Project Keystone.docx')
print(f'Deleted file: {result}')

result = files.delete('My Files/Project Keystone.docx', 'My Files/Keystone Notes.txt', 'Archive/Keystone')
print(f'Deleted multiple files/folders: {result}')
CloudDrive.undelete(*paths, wait=True)

Recover one or more files or folders.

Parameters:
  • paths (list[str]) – Paths to recover.

  • wait (bool, optional) – Wait for task completion. Defaults to True.

Returns:

Task status object, or awaitable task.

Return type:

cterasdk.common.object.Object or cterasdk.lib.tasks.AwaitablePortalTask

Raises:

cterasdk.exceptions.io.core.RecoverError – Raised on error recovering resources.

result = files.undelete('My Files/Project Keystone.docx')
print(f'Recovered file: {result}')

result = files.undelete('My Files/Project Keystone.docx', 'My Files/Keystone Notes.txt', 'Archive/Keystone')
print(f'Recovered multiple files/folders: {result}')

Collaboration Shares#

This section describes the main objects used for managing collaboration shares.

class cterasdk.core.types.UserAccount(name, directory=None)
property account_type

The Portal Account Type

Return cterasdk.core.enum.PortalAccountType:

The Portal Account Type

class cterasdk.core.types.GroupAccount(name, directory=None)
property account_type

The Portal Account Type

Return cterasdk.core.enum.PortalAccountType:

The Portal Account Type

class cterasdk.core.types.Collaborator(account, account_type, two_factor=False)

Class Representing a Collboration Share Recipient

static domain_group(group_account)

Share with a domain group

Parameters:

group_account (GroupAccount) – A domain group account

static domain_user(user_account)

Share with a domain user

Parameters:

user_account (UserAccount) – A domain user account

expire_in(days)

Set share to expire after (days)

Parameters:

days (int) – The number of days the share will remain accessible

expire_on(expiration_date)

Set the share expiration date

Parameters:

expire_on (str) – The expiration date (%Y-%m-%d)

static external(email, two_factor=False)

Share with an external user

Parameters:
  • email (str) – The email address of the recipient

  • two_factor (bool) – Require two factor authentication over e-mail

static from_server_object(server_object)
static local_group(group_account)

Share with a local group

Parameters:

group_account (GroupAccount) – A local group account

static local_user(user_account)

Share with a local user

Parameters:

user_account (UserAccount) – A local user account

no_access()

Deny access

preview_only()

Grant preview only access

read_only()

Grant read only access

read_write()

Grant read write access

upload_only()

Grant upload only access

CloudDrive.share(path, recipients, as_project=True, allow_reshare=True, allow_sync=True)

Share a file or folder.

Parameters:
  • path (str) – Path of the file or folder to share.

  • recipients (list[cterasdk.core.types.Collaborator]) – Share recipients.

  • as_project (bool, optional) – Share as a team project. Defaults True if cloud folder.

  • allow_reshare (bool, optional) – Allow re-share. Defaults True.

  • allow_sync (bool, optional) – Allow sync. Defaults True if cloud folder.

Returns:

Current list of share members.

Return type:

list[cterasdk.core.types.Collaborator]

alice = core_types.UserAccount('alice')
engineers = core_types.GroupAccount('Engineers')

alice_rcpt = core_types.Collaborator.local_user(alice).expire_in(30).read_only()
engineers_rcpt = core_types.Collaborator.local_group(engineers).read_write()

# Share with a local user with read-only access, expiring in 30 days
# Share with a local group with read-write access and the default expiration date
user.files.share('Codebase', [alice_rcpt, engineers_rcpt])
# Share with an external user with view-only access, expiring in 10 days
jsmith = core_types.Collaborator.external('jsmith@hotmail.com').expire_in(10).preview_only()
user.files.share('My Files/Projects/2020/ProjectX', [jsmith])

# Share with an external user with read-only access, expiring in 5 days
jsmith = core_types.Collaborator.external('jsmith@hotmail.com', True).expire_in(5).read_only()
user.files.share('My Files/Projects/2020/ProjectX', [jsmith])
albany_group = core_types.GroupAccount('Albany', 'ctera.com')
cleveland_group = core_types.GroupAccount('Cleveland', 'ctera.com')

albany_rcpt = core_types.Collaborator.domain_group(albany_group).read_write()
cleveland_rcpt = core_types.Collaborator.domain_group(cleveland_group).read_only()

# Share with two domain groups, with the default expiration date
user.files.share('Cloud/Albany', [albany_rcpt, cleveland_rcpt])
# Share with an external user with upload-only access, expiring in 15 days
jsmith = core_types.Collaborator.external('jsmith@hotmail.com').expire_in(15).upload_only()
user.files.share('My Files/Projects/2020/ProjectX', [jsmith])
CloudDrive.add_share_recipients(path, recipients)

Add share recipients.

Parameters:
Returns:

Current list of share members.

Return type:

list[cterasdk.core.types.Collaborator]

# Add a read-write local group share recepient
engineering = core_types.GroupAccount('Engineering')
engineering_rcpt = core_types.Collaborator.local_group(engineering).read_write()
user.files.add_share_recipients('My Files/Projects/2020/ProjectX', [engineering_rcpt])
CloudDrive.remove_share_recipients(path, accounts)

Remove share recipients.

Parameters:
Returns:

Current list of share members.

Return type:

list[cterasdk.core.types.Collaborator]

# Remove a local user and group from a share
alice = core_types.UserAccount('alice')
engineering = core_types.GroupAccount('Engineering')
user.files.remove_share_recipients('My Files/Projects/2020/ProjectX', [alice, engineering])
CloudDrive.unshare(path)

Unshare a file or folder.

Parameters:

path (str) – Path of file/folder.

user.files.unshare('My Files/Projects/2020/ProjectX')

Managing S3 Credentials#

CTERA Portal supports programmatic access to cloud storage via the S3 protocol, also known as CTERA Fusion. This allows users and administrators to manage files and folders using standard S3 tools and SDKs, such as the Amazon SDK for Python (boto3).

For details on enabling CTERA Fusion and supported S3 features, see the CTERA KB article.

The following example demonstrates how to create S3 credentials and interact with the portal using boto3.

import boto3

bucket = 'my-bucket-name'
local_file = './ProjectOverview.docx'
remote_key = 'documents/ProjectOverview.docx'
download_file = './ProjectOverview_Copy.docx'

# CTERA Fusion: Create S3 credentials (user or admin)
creds = user.credentials.s3.create()  # or admin.credentials.s3.create(core_types.UserAccount('username', 'domain'))

# Instantiate boto3 client
client = boto3.client('s3', endpoint_url='https://tenant.ctera.com:8443', aws_access_key_id=creds.accessKey,
                      aws_secret_access_key=creds.secretKey, verify=False)

# List buckets
for b in client.list_buckets()['Buckets']:
    print(b['Name'])

# Upload a file
client.upload_file(local_file, bucket, remote_key)

# List files in a bucket
for item in client.list_objects_v2(Bucket=bucket).get('Contents', []):
    print(item['Key'], item['LastModified'])

# List files with pagination
for page in client.get_paginator('list_objects_v2').paginate(Bucket=bucket):
    for item in page.get('Contents', []):
        print(item['Key'], item['LastModified'])

# Download a file
client.download_file(bucket, remote_key, download_file)

Note

For more details on using the Amazon SDK for Python (boto3), refer to the official boto3 documentation.

Asynchronous API#

async FileBrowser.handle(path, objects)

Get a file handle.

Parameters:
  • path (str) – Path to a file.

  • objects (list[str],optional) – Files and folders to include.

Returns:

File handle.

Return type:

object

Raises:
async FileBrowser.download(path, objects=None, destination=None)

Download a file.

Parameters:
  • path (str) – Path.

  • objects (list[str],optional) – List of files and / or directory names to download.

  • destination (str, optional) – File destination. If a directory is provided, the original filename is preserved. Defaults to the default download directory.

Returns:

Path to the local file.

Return type:

str

Raises:
async FileBrowser.listdir(path=None, include_deleted=False)

List directory contents.

Parameters:
  • path (str, optional) – Path, defaults to Cloud Drive root.

  • include_deleted (bool, optional) – Include deleted files. Defaults to False.

Returns:

Directory contents.

Return type:

AsyncIterator[cterasdk.cio.core.types.PortalResource]

Raises:
async FileBrowser.versions(path)

List snapshots of a file or directory.

Parameters:

path (str) – Path.

Returns:

List of versions.

Return type:

list[cterasdk.cio.core.types.PreviousVersion]

Raises:

cterasdk.exceptions.io.core.GetVersionsError – Raised on error retrieving versions.

async FileBrowser.walk(path=None, include_deleted=False)

Walk directory contents.

Parameters:
  • path (str, optional) – Path to walk, defaults to root directory.

  • include_deleted (bool, optional) – Include deleted files. Defaults to False.

Returns:

Async generator of file-system objects.

Return type:

AsyncIterator[cterasdk.cio.edge.types.PortalResource]

Raises:
async FileBrowser.public_link(path, access='RO', expire_in=30)

Create a public link to a file or folder.

Parameters:
  • path (str) – Path of file/folder.

  • access (str, optional) – Access policy. Defaults ‘RO’.

  • expire_in (int, optional) – Days until link expires. Defaults 30.

Returns:

Public link.

Return type:

str

Raises:

cterasdk.exceptions.io.core.CreateLinkError – Raised on failure generating public link.

async FileBrowser.copy(*paths, destination=None, resolver=None, cursor=None, wait=False)

Copy one or more files or folders.

Parameters:
Returns:

Task status object or awaitable task.

Return type:

cterasdk.common.object.Object or cterasdk.lib.tasks.AwaitablePortalTask

Raises:

cterasdk.exceptions.io.core.CopyError – Raised on failure copying resources.

async CloudDrive.move(*paths, destination=None, resolver=None, cursor=None, wait=False)

Move one or more files or folders.

Parameters:
Returns:

Task status object or awaitable task.

Return type:

cterasdk.common.object.Object or cterasdk.lib.tasks.AwaitablePortalTask

Raises:

cterasdk.exceptions.io.core.MoveError – Raised on error moving resources.

async FileBrowser.permalink(path)

Get permalink for a path.

Parameters:

path (str) – Path.

Returns:

Permalink.

Return type:

str

Raises:

cterasdk.exceptions.io.core.GetMetadataError – Raised on error retrieving object metadata.

async CloudDrive.upload(destination, handle, name=None, size=None)

Upload from file handle.

Parameters:
  • destination (str) – Remote path.

  • handle (object) – File-like handle.

  • size (str, optional) – File size. Defaults to content length.

  • name (str, optional) – Filename to use if it cannot be derived from destination

Returns:

Remote file path.

Return type:

str

Raises:

cterasdk.exceptions.io.core.UploadError – Raised on upload failure.

async CloudDrive.upload_file(path, destination)

Upload a file.

Parameters:
  • path (str) – Local path.

  • destination (str) – Remote path.

Returns:

Remote file path.

Return type:

str

Raises:

cterasdk.exceptions.io.core.UploadError – Raised on upload failure.

async CloudDrive.mkdir(path)

Create a directory.

Parameters:

path (str) – Directory path.

Returns:

Remote directory path.

Return type:

str

Raises:

cterasdk.exceptions.io.core.CreateDirectoryError – Raised on error creating directory.

async CloudDrive.makedirs(path)

Recursively create a directory.

Parameters:

path (str) – Directory path.

Returns:

Remote directory path.

Return type:

str

Raises:

cterasdk.exceptions.io.core.CreateDirectoryError – Raised on error creating directory.

async CloudDrive.rename(path, name, *, resolver=None, wait=False)

Rename a file or folder.

Parameters:
  • path (str) – Path to rename.

  • name (str) – New name.

  • resolver (cterasdk.core.types.ConflictResolver, optional) – Conflict resolver. Defaults None.

  • wait (bool, optional) – Wait for task completion. Defaults False.

Returns:

Task status object or awaitable task.

Return type:

cterasdk.common.object.Object or cterasdk.lib.tasks.AwaitablePortalTask

Raises:

cterasdk.exceptions.io.core.RenameError – Raised on error renaming object.

async CloudDrive.delete(*paths, wait=False)

Delete one or more files or folders.

Parameters:
  • paths (list[str]) – Paths to delete.

  • wait (bool, optional) – Wait for task completion. Defaults False.

Returns:

Task status object or awaitable task.

Return type:

cterasdk.common.object.Object or cterasdk.lib.tasks.AwaitablePortalTask

Raises:

cterasdk.exceptions.io.core.DeleteError – Raised on error deleting resources.

async CloudDrive.undelete(*paths, wait=False)

Recover one or more files or folders.

Parameters:
  • paths (list[str]) – Paths to recover.

  • wait (bool, optional) – Wait for task completion. Defaults False.

Returns:

Task status object or awaitable task.

Return type:

cterasdk.common.object.Object or cterasdk.lib.tasks.AwaitablePortalTask

Raises:

cterasdk.exceptions.io.core.RecoverError – Raised on error recovering resources.

async CloudDrive.share(path, recipients, as_project=True, allow_reshare=True, allow_sync=True)

Share a file or folder.

Parameters:
  • path (str) – Path to file/folder.

  • recipients (list[cterasdk.core.types.Collaborator]) – Recipients to share with.

  • as_project (bool, optional) – Share as team project. Defaults True if cloud folder.

  • allow_reshare (bool, optional) – Allow re-share. Defaults True.

  • allow_sync (bool, optional) – Allow sync. Defaults True if cloud folder.

Returns:

Current list of share members.

Return type:

list[cterasdk.core.types.Collaborator]

async CloudDrive.add_share_recipients(path, recipients)

Add share recipients.

Parameters:
Returns:

Current list of share members.

Return type:

list[cterasdk.core.types.Collaborator]

async CloudDrive.remove_share_recipients(path, accounts)

Remove share recipients.

Parameters:
Returns:

Current list of share members.

Return type:

list[cterasdk.core.types.Collaborator]

async CloudDrive.unshare(path)

Unshare a file or folder.

Parameters:

path (str) – Path of file/folder.