Releases: ctera/ctera-python-sdk
2.19
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.18.55
Support for configuring the Edge Filer's proxy.
Changes to the network module. Separated MTU and Static Routes to their own separate modules. See documentation for updates in the API.
2.18.54
Add support for ransomware protect
2.18.53
Move remote access single-sign-on code to login module, and auto authenticate ctera_migrate after single-sign-on
2.18.52
Support accessing the CTERA migration tool remotely from CTERA Portal.
Changes in this release include:
- The migration tool module was renamed from mtool to ctera_migrate
- When trying to remotely access an Edge Filer from CTERA Portal, you must use the object that's returned from calling the function remote_access. For example:
Instead of:
filer = admin.devices.device('edge-filer-name')
filer.remote_access()
filer.files.download('cloud/users/Service Account/My Files/docs/document.txt') # this will not work!
filer.mtool.list_tasks() # this will not work
Use this:
filer = admin.devices.device('edge-filer-name')
edge = filer.remote_access()
edge.files.download('cloud/users/Service Account/My Files/docs/document.txt') # this will work
edge.ctera_migrate.list_tasks() # this will work
This allows you to maintain two handles:
- A handle to remotely access the device from CTERA Portal
- A handle which is authenticated via remote_access
2.18.51
Support configuring firmware update schedule and setting the consent page through configuration templates.
2.18.50
Saimon/support collaboration on user behalf (#210)
2.18.49
Saimon/update docs for s3 (#209)
2.18.48
Saimon/add backups (#207)
2.18.47
Ronerez/s3bucket (#206)