Skip to content

Releases: ctera/ctera-python-sdk

2.19.10

05 Apr 15:32
0e3291b

Choose a tag to compare

Support generating reports from the CTERA SDK

2.19.9

28 Mar 20:24
4f20cb3

Choose a tag to compare

Support permanent deletion of deleted folders (already in the Trash Can)

2.19.8

25 Mar 23:34
4f9d6e9

Choose a tag to compare

Support read ahead of notifications

2.19.7

25 Mar 23:29

Choose a tag to compare

Support read-ahead of notifications

2.19.6

19 Mar 03:10
e8f819e

Choose a tag to compare

Update docs and event type (#222)

Co-authored-by: Saimon Michelson <saimon.michelson@gmail.com>

2.19.5

19 Mar 02:59
62eaa45

Choose a tag to compare

Add remaining docs (#221)

2.19.4

18 Mar 19:27
5333d9a

Choose a tag to compare

Support Push Notification Service for Metadata Connector

2.19.3

01 Mar 05:20
ac50aad

Choose a tag to compare

Support deleting cloud drive folders permanently.

"""Standard deletion"""
admin.cloudfs.drives.delete('folder-name', core_types.UserAccount('username', 'domain.local'))

"""Permanent deletion"""
admin.cloudfs.drives.delete('folder-name', core_types.UserAccount('username', 'domain.local'), permanently=True)

2.19.2

01 Mar 04:08
fe8f6dc

Choose a tag to compare

Starting this version, the CTERA SDK uses an asynchronous HTTP library.

Getting Started

Starting this version, the Gateway object was renamed to Edge. Additionally, instantiating an Edge object automatically enables https. Additionally, this release requires the use of a Context Manager or invoking the logout command to properly shutdown the session.

with Edge('192.168.0.1') as edge:  # this is a context manager
    try:
        edge.login('admin', 'your-password')
    except CTERAException as error:
        print(error)
        
with GlobalAdmin('corp.gfs.ctera.me') as admin:
    try:
        admin.login('admin', 'your-password')
    except CTERAException as error:
        print(error)

Alternatively, you can use:

edge = Edge('192.168.0.1')
try:
    edge.login('admin', 'password1!')
except CTERAException as error:
    print(error)
edge.logout()

Settings

Next, this version introduces a different way of modifying the SDK settings.

import cterasdk.settings  # unnecessary if you use: (from cterasdk import *)

"""Disable SSL Verification"""
cterasdk.settings.sessions.management.ssl = False  # replaced: config['http'].ssl = 'Trust'

"""Whether the Edge Filer should verify the Portal's SSL certificate
- False: do not verify
- True: verify
- 'prompt' (str): Prompt the user
"""
cterasdk.settings.sessions.management.edge.services.ssl = 'prompt'  

"""Change the default downloads directory"""
cterasdk.settings.downloads.location = '~/Downloads'

The following commands are no longer needed to ignore certificate errors:

import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

Core Methods

If you invoked the core methods directly (e.g., get, put, execute, add, delete) and not through the SDK modules, notice the following changes:

edge.api.get('/config/device') # instead of edge.get('/config/device')
edge.api.put('/config/device/location', 'The Moon')
edge.api.execute('/config/cloudsync', 'evictFolder')

Get Multi

If you used the get_multi command to retrieve information from the Edge Filer (this section isn’t applicable to the Portal), you may need to add a forward slash.

edge.get_multi('', ['status', 'config'])  # this will not work anymore
edge.get_multi('/', ['status', 'config'])  # use this instead

Built-in Types and Enum

Starting this version the portal_types and portal_enum modules were renamed to core_types and core_enum. And the gateway_types and gateway_enum were renamed to edge_types and edge_enum.

from cterasdk import core_types, core_enum, edge_types, edge_enum  # this will work

Exceptions

The exceptions module was renamed from exception to exceptions

from cterasdk.exceptions import ... # not cterasdk.exception

Creating Directories

Instead of invoking the mkdir function with the recurse attribute, there are two methods. One for creating a single directory and one for creating a full path.

user.files.mkdir('My Files/docs')  # Single folder
user.files.makedirs('My Files/path/to/folder')  # Create path

Transcribe

The transcribe module was deprecated.

from cterasdk import config
config.transcript['disabled'] = False  # will no longer work

For the rest of the changes, please refer to the online documentation: https://ctera-python-sdk.readthedocs.io/en/latest/

2.19.1

01 Mar 03:55

Choose a tag to compare

Starting this version, the CTERA SDK uses an asynchronous HTTP library.

Getting Started

Starting this version, the Gateway object was renamed to Edge. Additionally, instantiating an Edge object automatically enables https. Additionally, this release requires the use of a Context Manager or invoking the logout command to properly shutdown the session.

with Edge('192.168.0.1') as edge:  # this is a context manager
    try:
        edge.login('admin', 'your-password')
    except CTERAException as error:
        print(error)
        
with GlobalAdmin('corp.gfs.ctera.me') as admin:
    try:
        admin.login('admin', 'your-password')
    except CTERAException as error:
        print(error)

Alternatively, you can use:

edge = Edge('192.168.0.1')
try:
    edge.login('admin', 'password1!')
except CTERAException as error:
    print(error)
edge.logout()

Settings

Next, this version introduces a different way of modifying the SDK settings.

import cterasdk.settings  # unnecessary if you use: (from cterasdk import *)

"""Disable SSL Verification"""
cterasdk.settings.sessions.management.ssl = False  # replaced: config['http'].ssl = 'Trust'

"""Whether the Edge Filer should verify the Portal's SSL certificate
- False: do not verify
- True: verify
- 'prompt' (str): Prompt the user
"""
cterasdk.settings.sessions.management.edge.services.ssl = 'prompt'  

"""Change the default downloads directory"""
cterasdk.settings.downloads.location = '~/Downloads'

The following commands are no longer needed to ignore certificate errors:

import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

Core Methods

If you invoked the core methods directly (e.g., get, put, execute, add, delete) and not through the SDK modules, notice the following changes:

edge.api.get('/config/device') # instead of edge.get('/config/device')
edge.api.put('/config/device/location', 'The Moon')
edge.api.execute('/config/cloudsync', 'evictFolder')

Get Multi

If you used the get_multi command to retrieve information from the Edge Filer (this section isn’t applicable to the Portal), you may need to add a forward slash.

edge.get_multi('', ['status', 'config'])  # this will not work anymore
edge.get_multi('/', ['status', 'config'])  # use this instead

Built-in Types and Enum

Starting this version the portal_types and portal_enum modules were renamed to core_types and core_enum. And the gateway_types and gateway_enum were renamed to edge_types and edge_enum.

from cterasdk import core_types, core_enum, edge_types, edge_enum  # this will work

Exceptions

The exceptions module was renamed from exception to exceptions

from cterasdk.exceptions import ... # not cterasdk.exception

Creating Directories

Instead of invoking the mkdir function with the recurse attribute, there are two methods. One for creating a single directory and one for creating a full path.

user.files.mkdir('My Files/docs')  # Single folder
user.files.makedirs('My Files/path/to/folder')  # Create path

Transcribe

The transcribe module was deprecated.

from cterasdk import config
config.transcript['disabled'] = False  # will no longer work

For the rest of the changes, please refer to the online documentation: https://ctera-python-sdk.readthedocs.io/en/latest/