### Installation Source: https://context7.com/ctera/ctera-python-sdk/llms.txt Instructions on how to install the CTERA SDK for Python using pip. ```APIDOC ## Installation ### Description Install the CTERA SDK for Python using pip. ### Method `pip` ### Endpoint N/A ### Request Example ```bash pip install cterasdk ``` ``` -------------------------------- ### SetupWizardStage Enum Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.core.md Enumeration for setup wizard stages. ```APIDOC ## SetupWizardStage Enum ### Description Represents the different stages of the setup wizard. ### Members - **Finish**: The final stage of the setup wizard. - **Portal**: The stage related to portal configuration. - **Restart**: The stage requiring a server restart. - **Server**: The stage for server configuration. ``` -------------------------------- ### Manage Cloud Storage via S3 using Python (boto3) Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/UserGuides/Portal/Files.md This example demonstrates how to interact with CTERA Fusion (S3 API) using the Amazon SDK for Python (boto3). It covers creating S3 credentials, listing buckets, uploading, listing objects, and downloading files. Ensure boto3 is installed (`pip install boto3`). ```python 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) ``` -------------------------------- ### POST /migrate/tasks/start Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.edge.ctera_migrate.md Starts an existing migration or discovery task. ```APIDOC ## POST /migrate/tasks/start ### Description Initiates the execution of a specific migration or discovery task. ### Method POST ### Parameters #### Request Body - **task** (Object) - Required - The task object to start ### Response #### Success Response (200) - **status** (string) - Confirmation of task initiation ``` -------------------------------- ### CTERA Setup Wizard Stage Enumerations Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.core.enum.md Defines the distinct stages of the CTERA portal setup wizard, including Server initialization, Portal setup, Server restart, and completion. These are string constants. ```python class SetupWizardStage(object): """Portal Setup Wizard Stage""" Server = 'initServer' Portal = 'initPortal' Restart = 'restartingServer' Finish = 'finish' Finish = 'finish' Portal = 'initPortal' Restart = 'restartingServer' Server = 'initServer' ``` -------------------------------- ### SetupWizardStatus Enum Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.core.md Enumeration for setup wizard statuses. ```APIDOC ## SetupWizardStatus Enum ### Description Indicates the current status of the setup wizard. ### Members - **Completed**: The setup wizard has completed successfully. - **Failed**: The setup wizard has failed. ``` -------------------------------- ### Wizard Management Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.edge.config.md Methods to enable, disable, or check the status of the first-time setup wizard. ```APIDOC ## GET /config/wizard/status ### Description Checks if the first-time setup wizard is enabled. ### Response - **enabled** (bool) - True if enabled, False otherwise. ## POST /config/wizard/enable ### Description Enables the first-time setup wizard. ## POST /config/wizard/disable ### Description Disables the first-time setup wizard. ``` -------------------------------- ### CTERA Setup Wizard Status Monitor Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.core.setup.md Monitors the progress of the CTERA setup wizard through different stages. ```APIDOC ## POST /api/setup/wizard/wait ### Description Waits for a specific stage in the CTERA setup wizard to complete. ### Method POST ### Endpoint /api/setup/wizard/wait ### Parameters #### Request Body - **stage** (string) - Required - The setup stage to wait for. ### Request Example { "stage": "network_configuration" } ### Response #### Success Response (200) - **status** (string) - Indicates whether the stage has been reached or completed. #### Response Example { "status": "completed" } ``` -------------------------------- ### CTERA Setup Status API Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.core.setup.md Retrieves the current setup status of the CTERA Portal. ```APIDOC ## GET /api/setup/status ### Description Gets the current setup status of the CTERA Portal. ### Method GET ### Endpoint /api/setup/status ### Response #### Success Response (200) - **status** (string) - The current setup status (e.g., 'pending', 'initializing', 'ready'). #### Response Example { "status": "ready" } ``` -------------------------------- ### Create and Start Migration Task in Python Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/UserGuides/Edge/Migration.md Configures a migration task with specific options such as NTFS ACLs, checksum validation, and file inclusion/exclusion patterns, then starts the migration process. ```python credentials = edge_types.HostCredentials('source-hostname', 'username', 'password') task = edge.ctera_migrate.migration.add('my-discovery', credentials, ['share1', 'share2'], auto_start=False, winacls=True, cloud_folder='my_cloud_folder', create_cloud_folder_per_share=False, compute_checksum=False, exclude=['*.pdf', '*.jpg'], include=['*.png', '*.avi'], notes='migration job 1') # Run the task edge.ctera_migrate.start(task) ``` -------------------------------- ### Monitor Setup Wizard Status Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.core.setup.md Uses the SetupWizardStatusMonitor to poll the status of a specific setup stage. It allows for configurable retry counts and intervals to ensure the process completes successfully. ```python from cterasdk.core.setup import SetupWizardStatusMonitor monitor = SetupWizardStatusMonitor(portal, retries=30, seconds=10) monitor.wait('initialization_stage') ``` -------------------------------- ### Install CTERA SDK via pip Source: https://github.com/ctera/ctera-python-sdk/blob/master/README.rst Installs the CTERA Python SDK package using the pip package manager. This is the standard method for setting up the library in a Python environment. ```console pip install cterasdk ``` -------------------------------- ### Start Notification Service Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.asynchronous.core.notifications.md Shows how to initialize and run the background notification service using a client queue and a cursor persistence callback. ```python import asyncio async def run_service(service, queue, save_callback): await service.run(client_queue=queue, save_cursor=save_callback) # Example usage: # service = Service(core) # await run_service(service, asyncio.Queue(), my_save_func) ``` -------------------------------- ### GET /cloud-drives Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.md Retrieves information about cloud drives associated with the account. ```APIDOC ## GET /cloud-drives ### Description Finds and retrieves details for cloud drives managed by the CTERA environment. ### Method GET ### Endpoint /cloud-drives ### Parameters #### Query Parameters - **drive_id** (string) - Optional - Filter by specific drive ID. ### Request Example GET /cloud-drives?drive_id=drive_01 ### Response #### Success Response (200) - **drives** (array) - List of cloud drive objects. #### Response Example { "drives": [ { "id": "drive_01", "name": "Primary Storage" } ] } ``` -------------------------------- ### Setup.init_application_server Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/UserGuides/Portal/Administration.md Initializes a CTERA Portal Application Server to connect to a master server. ```APIDOC ## POST /setup/init_application_server ### Description Connect a secondary application server to the master server using either a password or a private key. ### Method POST ### Parameters #### Request Body - **ipaddr** (str) - Required - The CTERA Portal master server IP address - **secret** (str) - Required - A password or a PEM-encoded private key ``` -------------------------------- ### Install Local License (Python) Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.edge.licenses.md Installs a local license on the Edge Filer using a provided license code. This is typically used for standalone appliance setups. ```python from cterasdk.edge.licenses import LocalLicenses # Assuming 'edge' is an initialized Edge object local_licenses_api = LocalLicenses(edge) license_code = "YOUR_LOCAL_LICENSE_CODE" local_licenses_api.add(license_code) ``` -------------------------------- ### Get Local Licenses (Python) Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.edge.licenses.md Retrieves a list of all local licenses currently installed on the Edge Filer. ```python from cterasdk.edge.licenses import LocalLicenses # Assuming 'edge' is an initialized Edge object local_licenses_api = LocalLicenses(edge) installed_local_licenses = local_licenses_api.get() ``` -------------------------------- ### Setup.init_master Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/UserGuides/Portal/Administration.md Initializes the CTERA Portal master server with initial user credentials. ```APIDOC ## POST /setup/init_master ### Description Initialize the CTERA Portal master server by creating the initial administrative user. ### Method POST ### Parameters #### Request Body - **name** (str) - Required - User name for the new user - **email** (str) - Required - E-mail address - **first_name** (str) - Required - First name - **last_name** (str) - Required - Last name - **password** (str) - Required - Account password - **domain** (str) - Required - Domain suffix ``` -------------------------------- ### Initialize and Use DirectIO Client Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.direct.client.md Demonstrates how to instantiate the DirectIO client and retrieve file metadata asynchronously. This is the entry point for performing direct I/O operations on files. ```python from cterasdk.direct.client import DirectIO import asyncio async def main(): client = DirectIO(baseurl="https://ctera-portal", access_key_id="key", secret_access_key="secret") metadata = await client.metadata(file_id=12345) print(metadata) await client.close() asyncio.run(main()) ``` -------------------------------- ### Get SSL Certificate Thumbprint (Python) Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.core.ssl.md This property retrieves the SHA1 thumbprint of the currently installed SSL certificate on the CTERA Portal. ```python from cterasdk.core.ssl import SSL # Assuming 'core' is an initialized CTERA SDK core object ssl_api = SSL(core) # Get the thumbprint thumbprint = ssl_api.thumbprint # print(f"SSL Certificate Thumbprint: {thumbprint}") ``` -------------------------------- ### Create and Start Discovery Task in Python Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/UserGuides/Edge/Migration.md Demonstrates how to initialize host credentials, create a new discovery task for specific shares, and trigger the task execution using the CTERA SDK. ```python credentials = edge_types.HostCredentials('source-hostname', 'username', 'password') task = edge.ctera_migrate.discovery.add('my-discovery', credentials, ['share1', 'share2'], auto_start=False, log_every_file=True, notes='job 1') # Add a local discovery task credentials = edge_types.HostCredentials.localhost() task = edge.ctera_migrate.discovery.add('my-discovery', credentials, ['share1', 'share2'], log_every_file=True, notes='local discovery job') # Run the task edge.ctera_migrate.start(task) ``` -------------------------------- ### Get Portal SSL Certificate Details (Python) Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.core.ssl.md This method retrieves and returns details about the currently installed SSL certificate on the CTERA Portal. The details are returned as an object. ```python from cterasdk.core.ssl import SSL # Assuming 'core' is an initialized CTERA SDK core object ssl_api = SSL(core) # Get certificate details certificate_details = ssl_api.get() # Access details (example attributes) # print(f"Subject: {certificate_details.subject}") # print(f"Issuer: {certificate_details.issuer}") # print(f"Not Before: {certificate_details.not_before}") # print(f"Not After: {certificate_details.not_after}") ``` -------------------------------- ### Configure and Manage Edge Filer Backups Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.edge.backup.md Demonstrates how to initialize the Backup class, configure it with a passphrase, and control the backup lifecycle using start, suspend, and unsuspend methods. ```python from cterasdk.edge.backup import Backup # Initialize backup manager backup = Backup(edge_filer) # Configure with passphrase backup.configure(passphrase="my-secure-passphrase") # Check status and control if not backup.is_configured(): print("Backup not configured") backup.start() backup.suspend() backup.unsuspend() ``` -------------------------------- ### Retrieve and Print File Ancestors (Python) Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/UserGuides/DataServices/NotificationService.md This example shows how to retrieve the ancestors of a file event using the `admin.notifications.ancestors()` method. It processes events, extracts ancestor names, and prints the full file path. It also includes setup for the Notification Service and a worker to handle events. ```python import asyncio import logging from pathlib import Path from cterasdk import AsyncGlobalAdmin import cterasdk.settings async def save_cursor(cursor): """Use this function to persist the cursor""" async def process_event(admin, event): # Print full file path """Process an event""" ancestors = await admin.notifications.ancestors(event) print(Path(*[ancestor.name for ancestor in ancestors]).as_posix()) async def worker(admin, queue): """Sample worker thread""" while True: event = await queue.get() try: if event.type == 'file' and not event.deleted: # if file exists await process_event(admin, event) except Exception: logging.getLogger().error('Error Message') finally: queue.task_done() # Service will not produce events unless all tasks are done. async def main(): cterasdk.settings.core.asyn.settings.connector.ssl = False cursor = None queue = asyncio.Queue() # Shared queue between producer and consumer threads async with AsyncGlobalAdmin('tenant.ctera.com') as admin: await admin.login('admin-username', 'admin-password') """Start event producer service.""" admin.notifications.service.run(queue, save_cursor, cursor=cursor) """Start event consumer to process events""" consumer = asyncio.create_task(worker(admin, queue)) await consumer await admin.logout() if __name__ == '__main__': asyncio.run(main()) ``` -------------------------------- ### Monitor CTERA Server Startup Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.core.startup.md This snippet demonstrates how to instantiate the Startup class to check the current server status and wait for the system to become fully operational. It utilizes the wait method with customizable retry attempts and interval timing. ```python from cterasdk.core.startup import Startup # Initialize the startup handler with a core object startup = Startup(core) # Check current status print(f"Current status: {startup.status()}") # Wait for startup with 60 retries at 2 seconds each startup.wait(retries=60, seconds=2) ``` -------------------------------- ### Configure and Add a Template Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/UserGuides/Portal/Administration.md Demonstrates how to build a software update policy, define scripts and CLI commands, and add a new configuration template to the portal. ```python schedule = common_types.TimeRange().start('01:00:00').end('02:00:00').days(common_enum.DayOfWeek.Weekdays).build() builder = common_types.SoftwareUpdatePolicyBuilder() update_settings = builder.download_and_install(True).reboot_after_update(True).schedule(schedule).build() scripts = [ core_types.TemplateScript.windows().after_logon('echo Current directory: %cd%'), core_types.TemplateScript.linux().before_backup('./mysqldump -u admin website > /mnt/backup/backup.sql'), core_types.TemplateScript.linux().after_backup('rm /mnt/backup/backup.sql') ] cli_commands = [ 'set /config/agent/stubs/deleteFilesOfCachedFolderOnDisable false', 'add /config/agent/stubs/allowedExplorerExtensions url' ] consent_page = common_types.ConsentPage('the header of your consent page', 'the body of your consent page') admin.templates.add('MyTemplate', 'woohoo', include_sets=[include_sets], exclude_sets=[exclude_sets], backup_schedule=backup_schedule, apps=apps, versions=versions, update_settings=update_settings, scripts=scripts, cli_commands=cli_commands, consent_page=consent_page) ``` -------------------------------- ### Python - Configure Software Versions Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/UserGuides/Portal/Administration.md Demonstrates how to configure specific software versions for platforms, such as setting a particular version for Edge Filers. This allows for precise control over the software environment being backed up. ```python """Configure software versions""" versions = [core_types.PlatformVersion(core_enum.Platform.Edge_7, '7.0.981.7')] # use 7.0.981.7 for v7 Edge Filers ``` -------------------------------- ### CTERA Setup Wizard Status Enumerations Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.core.enum.md Indicates the status of the CTERA portal setup wizard, such as Not Relevant (NA), Running, Failed, or Completed. These are represented as string constants. ```python class SetupWizardStatus(object): """Portal Setup Wizard Status""" NA = 'notRelevant' Running = 'inProgress' Failed = 'failed' Completed = 'completed' Completed = 'completed' Failed = 'failed' NA = 'notRelevant' Running = 'inProgress' ``` -------------------------------- ### Manage RSync Configuration with CTERA SDK Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.edge.rsync.md Demonstrates how to instantiate the RSync class and perform common operations such as enabling the service, modifying port settings, and retrieving the current configuration. ```python from cterasdk import edge # Initialize edge filer connection filer = edge.connect("https://filer-url", "admin", "password") rsync = filer.rsync # Enable RSync rsync.enable() # Modify configuration rsync.modify(port=873, max_connections=10) # Get current configuration config = rsync.get_configuration() print(config) ``` -------------------------------- ### SoftwareUpdatePolicyBuilder Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.md Builds policies for software updates, allowing configuration of download, installation, and reboot behavior. ```APIDOC ## SoftwareUpdatePolicyBuilder ### Description Builds a software update policy. ### Methods - `build()`: Finalizes and returns the software update policy. - `download_and_install()`: Configures the policy to download and install updates. - `reboot_after_update()`: Configures the policy to reboot the system after updates. - `schedule(schedule: TaskSchedule)`: Sets the schedule for the software updates. ``` -------------------------------- ### Manage NFS Server State and Configuration Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.edge.nfs.md Demonstrates how to instantiate the NFS controller, toggle the server state, and update specific configuration parameters such as NFSv4 support and port bindings. ```python from cterasdk import EdgeFiler filer = EdgeFiler('192.168.1.10', 'admin', 'password') nfs = filer.nfs # Enable NFS nfs.enable() # Modify configuration nfs.modify(nfsv4_enabled=True, mountd_port=2049) # Check status if not nfs.is_disabled(): config = nfs.get_configuration() print(config) ``` -------------------------------- ### Install CTERA SDK from Source Source: https://github.com/ctera/ctera-python-sdk/blob/master/README.rst Clones the repository and builds the package from source code. Useful for developers contributing to the SDK or requiring the latest unreleased features. ```console git clone https://github.com/ctera/ctera-python-sdk.git cd ctera-python-sdk python -m build ``` -------------------------------- ### GET /network/status Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.md Retrieves the current network status and configuration details for the edge device. ```APIDOC ## GET /network/status ### Description Fetches the current status of the network interfaces and IP configuration. ### Method GET ### Endpoint /network/status ### Parameters None ### Request Example {} ### Response #### Success Response (200) - **status** (object) - Current network status object #### Response Example { "status": { "dhcp": true, "ip": "192.168.1.10", "gateway": "192.168.1.1" } } ``` -------------------------------- ### GET /migration/list_tasks Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/UserGuides/Edge/Migration.md Retrieves a list of all migration tasks. ```APIDOC ## GET /migration/list_tasks ### Description Lists all migration tasks, with an optional filter to include deleted tasks. ### Method GET ### Endpoint Migration.list_tasks ### Parameters #### Query Parameters - **deleted** (bool) - Optional - Include deleted tasks in the result ### Response #### Success Response (200) - **tasks** (list) - A list of migration task objects ``` -------------------------------- ### Logging in as Global Admin Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/UserGuides/Portal/Quickstart.md Demonstrates how to import the SDK, log in to CTERA Portal as a global admin using a context manager, and perform basic administrative tasks. ```APIDOC ## Logging In as Global Admin ### Description This snippet shows how to initialize the `GlobalAdmin` object, log in to the CTERA Portal, and perform common administrative tasks such as listing tenants, browsing a specific tenant, retrieving cloud drive information, listing edge filers, and returning to the global administration view. It utilizes a context manager for automatic session management. ### Method Context Manager (`with GlobalAdmin(...) as admin:`) and direct login (`admin.login(...)`) ### Endpoint `tenant.ctera.com` (for login) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from cterasdk import GlobalAdmin def main(): with GlobalAdmin('tenant.ctera.com') as admin: admin.login('admin-username', 'admin-password') for tenant in admin.portals.list_tenants(): print(tenant) admin.portals.browse('acme') for drive in admin.cloudfs.drives.all(include=['folderStats']): print('Name: ', drive.name) print('Size: ', drive.folderStats.cloudFolderSize) print('Count: ', drive.folderStats.totalFiles) for edge in admin.devices.filers(include=['deviceConnectionstatus']): print(edge) admin.portals.browse_global_admin() if __name__ == '__main__': main() ``` ### Response #### Success Response (200) Output will be printed to the console, showing tenant information, cloud drive details, and edge filer status. #### Response Example ``` Tenant(id='...', name='acme', ...) Name: MyCloudDrive Size: 1024000 Count: 100 EdgeFiler(id='...', name='Edge1', ...) ``` ``` -------------------------------- ### Manage Storage Classes Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/UserGuides/Portal/Administration.md Enables the management of storage classes. You can add new storage classes by name, retrieve all existing storage classes, or get a specific storage class by its name. The 'all' and 'get' methods return objects representing the storage classes. ```python admin.storage_classes.add('Archive') for storage_class in admin.storage_classes.all(): print(storage_class) print(admin.storage_classes.get('Archive')) ``` -------------------------------- ### Manage Edge Filer Drives with Python SDK Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.edge.drive.md Demonstrates how to initialize the Drive interface, format specific or all drives, and retrieve drive information or status using the CTERA Python SDK. ```python from cterasdk import EdgeFiler from cterasdk.edge.drive import Drive # Initialize connection edge = EdgeFiler("192.168.1.10", "admin", "password") drive_manager = Drive(edge) # Get all drives all_drives = drive_manager.get() # Get status of a specific drive status = drive_manager.get_status(name="Drive1") # Format a specific drive drive_manager.format("Drive1") # Format all drives drive_manager.format_all() ``` -------------------------------- ### Startup Class - Server Startup APIs Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.core.startup.md Provides methods to interact with the server startup process, including checking status and waiting for completion. ```APIDOC ## Startup Class ### Description Represents the Server Startup APIs for the CTERA SDK. ### Methods #### status() ##### Description Get the server startup status. ##### Method GET (Implicit, as it's a status check) ##### Endpoint N/A (Method within a class instance) #### wait(retries=120, seconds=5) ##### Description Wait for server startup to complete. ##### Method GET (Implicit, as it's a status check) ##### Endpoint N/A (Method within a class instance) ##### Parameters ###### Query Parameters - **retries** (integer) - Optional - The number of retries to attempt. - **seconds** (integer) - Optional - The time in seconds to wait between retries. ### Request Example ```python # Assuming 'core' is an initialized CTERA Core object startup_api = Startup(core) # Check status status = startup_api.status() # Wait for startup startup_api.wait(retries=60, seconds=10) ``` ### Response #### Success Response (200) - **status** (string) - The current startup status (e.g., 'Started'). #### Response Example ```json { "status": "Started" } ``` ``` -------------------------------- ### Create and Manage Configuration Templates with Python Source: https://context7.com/ctera/ctera-python-sdk/llms.txt This snippet demonstrates how to create and manage device configuration templates using the CTERA Python SDK. It covers building backup schedules, configuring include/exclude sets for file filtering, setting software versions, and defining update settings. The template is then created and set as the default. ```python from cterasdk import GlobalAdmin, core_types, core_enum, common_types, common_enum with GlobalAdmin('tenant.ctera.com') as admin: admin.login('admin', 'password') admin.portals.browse('acme') # Build backup schedule time_range = common_types.TimeRange().start('07:00:00').days(common_enum.DayOfWeek.Weekdays).build() backup_schedule = common_types.BackupScheduleBuilder.window(time_range) # Configure include/exclude sets docs = common_types.FileFilterBuilder.extensions().include(['pptx', 'xlsx', 'docx']).build() include_sets = common_types.FilterBackupSet('Documents', filter_rules=[docs], template_dirs=[core_enum.EnvironmentVariables.ALLUSERSPROFILE]) # Configure software versions versions = [core_types.PlatformVersion(core_enum.Platform.Edge_7, '7.0.981.7')] # Configure update settings schedule = common_types.TimeRange().start('01:00:00').end('02:00:00').days(common_enum.DayOfWeek.Weekdays).build() builder = common_types.SoftwareUpdatePolicyBuilder() update_settings = builder.download_and_install(True).reboot_after_update(True).schedule(schedule).build() # Create template admin.templates.add('MyTemplate', 'Production template', include_sets=[include_sets], backup_schedule=backup_schedule, versions=versions, update_settings=update_settings) # Set as default admin.templates.set_default('MyTemplate', wait=True) ``` -------------------------------- ### FileBrowser.handle Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/UserGuides/Portal/Files.md Gets a file handle for a specified file path. ```APIDOC ## POST /ctera/ctera-python-sdk/files/handle ### Description Gets a file handle for a specified file path. ### Method POST ### Endpoint /ctera/ctera-python-sdk/files/handle ### Parameters #### Query Parameters - **path** (str) - Required - Path to a file. ### Request Example ```json { "path": "My Files/Keystone Project.docx" } ``` ### Response #### Success Response (200) - **file_handle** (object) - A handle to the file. #### Response Example ```json { "file_handle": "" } ``` ### Error Handling - **cterasdk.exceptions.io.core.OpenError**: Raised on error to obtain a file handle. ``` -------------------------------- ### GET /devices/agents Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/UserGuides/Portal/Administration.md Retrieves an iterator of agents registered within the tenant. ```APIDOC ## GET /devices/agents ### Description Retrieves a list of agents. Allows specifying fields to include and searching across all portals. ### Method GET ### Endpoint admin.devices.agents(include=None, allPortals=False) ### Parameters #### Query Parameters - **include** (list[str]) - Optional - List of fields to retrieve. - **allPortals** (bool) - Optional - Search in all portals. ### Response #### Success Response (200) - **Iterator** (QueryIterator) - Returns an iterator of Drive objects. ``` -------------------------------- ### StringCriteriaBuilder Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.md A builder for creating criteria based on string values, supporting operations like contains, equals, starts with, and ends with. ```APIDOC ## StringCriteriaBuilder ### Description Builds criteria for string comparisons. ### Methods - `contains(substring: str)`: Checks if the string contains the specified substring. - `endswith(suffix: str)`: Checks if the string ends with the specified suffix. - `equals(value: str)`: Checks if the string is exactly equal to the specified value. - `isoneof(values: list[str])`: Checks if the string is one of the specified values. - `startswith(prefix: str)`: Checks if the string starts with the specified prefix. ``` -------------------------------- ### GET /users/list_domain_users Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/UserGuides/Portal/Administration.md Retrieves a list of all users within a specified domain. ```APIDOC ## GET /users/list_domain_users ### Description Lists all users in a domain, with optional field selection. ### Method GET ### Endpoint Users.list_domain_users ### Parameters #### Query Parameters - **domain** (str) - Required - Domain name - **include** (list[str]) - Optional - List of fields to retrieve, defaults to ['name'] ### Response #### Success Response (200) - **users** (QueryIterator) - Iterator for all the domain users ``` -------------------------------- ### Integrate Directory Services with Python SDK Source: https://context7.com/ctera/ctera-python-sdk/llms.txt This example demonstrates how to integrate Active Directory or LDAP with CTERA Portal tenants using the Python SDK. It covers configuring UID/GID mapping, setting up access control entries for users and groups, connecting to Active Directory, fetching domain users, retrieving connected domain information, and disconnecting. ```python from cterasdk import GlobalAdmin, core_types, core_enum, common_types with GlobalAdmin('tenant.ctera.com') as admin: admin.login('admin', 'password') admin.portals.browse('acme') # Configure UID/GID mapping mapping = [ common_types.ADDomainIDMapping('demo.local', 200001, 5000000), common_types.ADDomainIDMapping('trusted.local', 5000001, 10000000) ] # Configure access control rw_admin = core_types.AccessControlEntry( core_types.GroupAccount('ctera_admins', 'demo.local'), core_enum.Role.ReadWriteAdmin ) ro_admin = core_types.AccessControlEntry( core_types.UserAccount('jsmith', 'demo.local'), core_enum.Role.ReadOnlyAdmin ) # Connect to Active Directory admin.directoryservice.connect( 'demo.local', 'svc_account', 'password', mapping=mapping, domain_controllers=core_types.DomainControllers('172.54.3.52'), acl=[rw_admin, ro_admin] ) # Fetch domain users alice = core_types.UserAccount('alice', 'domain.ctera.local') bruce = core_types.UserAccount('bruce', 'domain.ctera.local') admin.directoryservice.fetch([alice, bruce]) # Get connected domain print(admin.directoryservice.get_connected_domain()) # Disconnect admin.directoryservice.disconnect() ``` -------------------------------- ### GET /sync/status Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.edge.md Retrieves the current status of the cloud synchronization service. ```APIDOC ## GET /sync/status ### Description Returns the current operational status of the cloud sync engine. ### Method GET ### Endpoint /sync/status ### Response #### Success Response (200) - **enabled** (boolean) - Whether sync is currently active - **status** (string) - Current sync state #### Response Example { "enabled": true, "status": "idle" } ``` -------------------------------- ### Python - Specify Applications for Backup Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/UserGuides/Portal/Administration.md Shows how to specify which applications should be included in the backup. Examples include backing up specific applications like Active Directory (NTDS) and Hyper-V, or backing up all supported applications. ```python """Backup applications""" apps = [common_enum.Application.NTDS, common_enum.Application.HyperV] # back up Active Directory and Hyper-V apps = common_enum.Application.All # back up all applications ``` -------------------------------- ### GET /tasks/by_name Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.edge.tasks.md Retrieves information about a specific background task by its name. ```APIDOC ## GET /tasks/by_name ### Description Retrieves the details of a background task identified by its name. ### Method GET ### Endpoint /tasks/by_name ### Parameters #### Query Parameters - **name** (str) - Required - The name of the background task to retrieve. ### Request Example GET /tasks/by_name?name=sync_task ### Response #### Success Response (200) - **task_info** (object) - The details of the requested background task. #### Response Example { "name": "sync_task", "status": "running", "progress": 45 } ``` -------------------------------- ### Initialize and Track Status with StatusTracker Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.lib.tracker.md Demonstrates how to instantiate the StatusTracker class to monitor a reference object on a CTERA host. It includes methods to mark progress, failure, or success states. ```python from cterasdk.lib.tracker import StatusTracker # Initialize tracker tracker = StatusTracker(CTERAHost, ref="task_ref_id", success=True, progress=0, transient=False, failure=False, retries=300, seconds=1) # Update status tracker.increment() if tracker.running(): print("Task is still in progress") # Resolve final state tracker.resolve() ``` -------------------------------- ### GET /directory/domains Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.edge.directoryservice.md Retrieves a list of all discovered Active Directory domains. ```APIDOC ## GET /directory/domains ### Description Returns a list of names of all discovered domains. ### Method GET ### Response #### Success Response (200) - **domains** (list) - List of domain names #### Response Example [ "corp.example.com", "dev.example.com" ] ``` -------------------------------- ### GET /migrate/tasks Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.edge.ctera_migrate.md Lists all discovery or migration tasks currently configured. ```APIDOC ## GET /migrate/tasks ### Description Retrieves a list of all migration or discovery tasks. ### Method GET ### Parameters #### Query Parameters - **deleted** (bool) - Optional - If true, includes deleted tasks in the response ### Response #### Success Response (200) - **tasks** (list) - A list of task objects ``` -------------------------------- ### Configure and Manage Cloud Backup - Python Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/UserGuides/Edge/Configuration.md Functions for configuring and managing cloud backup operations. `configure` sets up the backup, optionally with a passphrase. `start` initiates the backup process, `suspend` pauses it, and `unsuspend` resumes a suspended backup. ```python edge.backup.configure() edge.backup.configure(passphrase='your_passphrase') ``` ```python edge.backup.start() ``` ```python edge.backup.suspend() ``` ```python edge.backup.unsuspend() ``` -------------------------------- ### GET /backup-folders Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.core.cloudfs.md Retrieve a list of all backup folders with optional filtering. ```APIDOC ## GET /backup-folders ### Description List all backup folders, optionally filtered by owner or status. ### Method GET ### Endpoint /backup-folders ### Parameters #### Query Parameters - **include** (str) - Optional - Fields to retrieve, defaults to ['name', 'group', 'owner'] - **list_filter** (ListFilter) - Optional - Filter status, defaults to 'NonDeleted' - **user** (UserAccount) - Optional - Filter by owner ### Response #### Success Response (200) - **folders** (Iterator) - Iterator for all Backup folders ``` -------------------------------- ### Manage Subscription Plans Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.core.plans.md Demonstrates how to add, retrieve, and modify subscription plans using the Plans class. ```python from cterasdk import Portal portal = Portal("portal_url", "admin", "password") plans = portal.plans # Add a new plan plans.add(name="GoldPlan", services={"cloudDrive": True}, quotas={"storage": 100}) # Retrieve a plan plan = plans.get(name="GoldPlan") # Modify a plan plans.modify(name="GoldPlan", quotas={"storage": 200}) ``` -------------------------------- ### GET /admins/{name} Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.core.admins.md Retrieves details for a specific global administrator. ```APIDOC ## GET /admins/{name} ### Description Retrieves the user account details for a specific global administrator. ### Method GET ### Endpoint /admins/{name} ### Parameters #### Path Parameters - **name** (str) - Required - Global administrator username #### Query Parameters - **include** (list) - Optional - List of fields to retrieve ### Response #### Success Response (200) - **account** (object) - The user account details ``` -------------------------------- ### Python: Create Cloud Drive Folder with Compliance Settings Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/UserGuides/Portal/Quickstart.md Demonstrates how to create a cloud drive folder with specific compliance settings using `core_types` and `core_enum` modules. It involves defining compliance duration and grace periods before creating the folder. ```python from cterasdk import core_types, core_enum admin.cloudfs.groups.add('FG-Compliance', svc_account) # Create a folder-group settings = core_types.ComplianceSettingsBuilder.enterprise(1, core_enum.Duration.Years).grace_period(1, core_enum.Duration.Hours).build() admin.cloudfs.drives.add('Compliance', 'FG-Compliance', svc_account, compliance_settings=settings) ``` -------------------------------- ### GET /files/exists Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/UserGuides/Edge/Files.md Checks if a file or directory exists at the specified path. ```APIDOC ## GET /files/exists ### Description Check whether an item exists at the provided path. ### Method GET ### Endpoint /files/exists ### Parameters #### Query Parameters - **path** (str) - Required - The path to check. ### Request Example edge.files.exists('path/to/file') ### Response #### Success Response (200) - **exists** (bool) - True if exists, False otherwise. ``` -------------------------------- ### Configure Antivirus Servers Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.core.antivirus.md Demonstrates how to use the AntivirusServers class to add, retrieve, and remove antivirus server configurations from the portal. ```python from cterasdk import Portal from cterasdk.core.enum import AntivirusType portal = Portal("portal.example.com", "admin", "password") servers = portal.antivirus.servers # Add a new antivirus server servers.add("AV-Server-01", AntivirusType.ICAP, "http://av.local:1234/signature") # List all servers print(portal.antivirus.list_servers()) # Delete a server servers.delete("AV-Server-01") ``` -------------------------------- ### GET /files/properties Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/UserGuides/Edge/Files.md Retrieves the metadata properties of a specific file or directory. ```APIDOC ## GET /files/properties ### Description Get object properties for a specific file or directory path. ### Method GET ### Endpoint /files/properties ### Parameters #### Query Parameters - **path** (str) - Required - The path to the resource. ### Request Example edge.files.properties('path/to/file') ### Response #### Success Response (200) - **resource** (Object) - EdgeResource object containing metadata. #### Response Example {"name": "doc.docx", "is_dir": false, "size": 2048, "last_modified": "2023-10-01"} ``` -------------------------------- ### GET /files/listdir Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/UserGuides/Edge/Files.md Lists the contents of a specified directory on the Edge Filer. ```APIDOC ## GET /files/listdir ### Description List directory contents for a given path. ### Method GET ### Endpoint /files/listdir ### Parameters #### Query Parameters - **path** (str) - Optional - Path to list. Defaults to root. ### Request Example edge.files.listdir('/') ### Response #### Success Response (200) - **list** (Array) - List of EdgeResource objects. #### Response Example [{"name": "file.txt", "is_dir": false, "size": 1024}] ``` -------------------------------- ### Manage Global Administrators with CTERA SDK Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.core.admins.md Demonstrates how to instantiate the Administrators class and perform common operations such as creating, retrieving, and deleting a global administrator account. ```python from cterasdk import PortalAdmin from cterasdk.core.enum import Role # Initialize connection portal = PortalAdmin('portal.example.com', 'admin', 'password') # Create a new Global Administrator portal.admins.add('jdoe', 'jdoe@example.com', 'John', 'Doe', 'SecurePass123!', Role.Admin) # Retrieve administrator details admin = portal.admins.get('jdoe') print(admin) # List all administrators for admin in portal.admins.list_admins(): print(admin) # Delete an administrator portal.admins.delete('jdoe') ``` -------------------------------- ### Configure Template Scripts for Platforms Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.core.types.md Demonstrates how to use the TemplateScript class to define pre- and post-backup or logon scripts for specific platforms like Windows, Linux, or Mac. This allows for automated execution of custom logic during backup cycles. ```python from cterasdk.core.types import TemplateScript # Initialize for Windows platform script_config = TemplateScript.windows() # Set script paths script_config.before_backup("C:\\scripts\\pre_backup.bat") script_config.after_backup("C:\\scripts\\post_backup.bat") # Convert to server object for API transmission server_payload = script_config.to_server_object() ``` -------------------------------- ### GET /notifications/list Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.asynchronous.core.notifications.md Retrieves an asynchronous iterator of changes from the CTERA portal. ```APIDOC ## GET /notifications/list ### Description Lists changes from the notification service and returns an asynchronous iterator for processing. ### Method GET ### Endpoint /notifications/list ### Parameters #### Query Parameters - **cloudfolders** (list) - Optional - List of Cloud Drive folders. - **cursor** (str) - Optional - Starting cursor. - **max_results** (int) - Optional - Limit max results (default 2000). ### Response #### Success Response (200) - **iterator** (CursorAsyncIterator) - An asynchronous iterator containing the change events. ``` -------------------------------- ### Initialize CTERA Portal Master Server Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.core.setup.md Initializes the master server for a CTERA Portal instance. Requires user details and domain information to establish the primary administrative account. ```python from cterasdk import Portal portal = Portal('portal.example.com', 'admin', 'password') setup = portal.setup() setup.init_master('admin_user', 'admin@example.com', 'First', 'Last', 'SecurePassword123!', 'example.com') ``` -------------------------------- ### Retrieve and Query Filers Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/UserGuides/Portal/Administration.md Demonstrates how to fetch filers from the current tenant or across all portals. Includes examples for retrieving specific attributes and filtering by device types. ```python filers = admin.devices.filers() for filer in filers: print(filer.name) filers = admin.devices.filers(['owner', 'deviceConnectionStatus']) filers = admin.devices.filers(['deviceReportedStatus.status.device.runningFirmware']) admin.portals.browse_global_admin() filers = admin.devices.filers(allPortals = True) filers = admin.devices.filers(allPortals = True, deviceTypes = ['C200', 'C400']) ``` -------------------------------- ### GET /edge/network/proxy Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.edge.md Retrieves the current proxy configuration settings for the edge device. ```APIDOC ## GET /edge/network/proxy ### Description Fetches the current proxy configuration including host, port, and authentication status. ### Method GET ### Endpoint /edge/network/proxy ### Parameters None ### Response #### Success Response (200) - **enabled** (boolean) - Whether the proxy is currently enabled. - **host** (string) - Proxy server address. - **port** (integer) - Proxy server port. #### Response Example { "enabled": true, "host": "proxy.example.com", "port": 8080 } ``` -------------------------------- ### Python - Configure Backup Schedules Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/UserGuides/Portal/Administration.md Illustrates how to configure backup schedules using BackupScheduleBuilder. This includes setting up periodic backups at specified intervals (e.g., every 6 hours or 30 minutes) and scheduling backups for specific times on weekdays. ```python """Schedule backup to run periodically""" backup_schedule = common_types.BackupScheduleBuilder.interval(hours=6) # periodically, every 6 hours backup_schedule = common_types.BackupScheduleBuilder.interval(hours=0, minutes=30) # periodically, every 30 minutes """Schedule backup for a specific time""" time_range = common_types.TimeRange().start('07:00:00').days(common_enum.DayOfWeek.Weekdays).build() # 7am, on weekdays backup_schedule = common_types.BackupScheduleBuilder.window(time_range) ``` -------------------------------- ### GET /templates Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.core.md Lists all available templates configured within the CTERA system. ```APIDOC ## GET /templates ### Description Retrieves a list of all templates defined in the system. ### Method GET ### Endpoint /templates ### Parameters None ### Request Example {} ### Response #### Success Response (200) - **templates** (array) - A list of template objects. #### Response Example { "templates": [ {"name": "default_template", "id": 1}, {"name": "backup_policy", "id": 2} ] } ``` -------------------------------- ### Share Files and Folders with Collaborators Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/UserGuides/Portal/Files.md Demonstrates how to create collaborator objects for local users and groups, configure their access levels and expiration dates, and apply them to a file or folder share. ```python 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() user.files.share('Codebase', [alice_rcpt, engineers_rcpt]) ``` -------------------------------- ### GET /syslog/configuration Source: https://github.com/ctera/ctera-python-sdk/blob/master/docs/source/api/cterasdk.core.md Retrieves the current syslog configuration settings from the CTERA system. ```APIDOC ## GET /syslog/configuration ### Description Retrieves the current syslog configuration settings. ### Method GET ### Endpoint /syslog/configuration ### Parameters None ### Request Example {} ### Response #### Success Response (200) - **configuration** (object) - The current syslog settings object. #### Response Example { "enabled": true, "server": "syslog.example.com", "port": 514 } ```