Migration#
- CTERAMigrate.list_shares(credentials)
Log in
- Parameters:
credentials (cterasdk.edge.types.HostCredentials) – Target host credentials
""" List all shares available on a source host """
credentials = edge_types.HostCredentials('source-hostname', 'username', 'password')
edge.ctera_migrate.list_shares(credentials)
""" List all shares available on the current Edge Filer """
credentials = edge_types.HostCredentials.localhost()
edge.ctera_migrate.list_shares(credentials)
- CTERAMigrate.list_tasks(deleted=False)
List tasks
- Parameters:
deleted (bool,optional) – List deleted tasks, defaults to
False
- Returns:
List of tasks
- Return type:
""" Print all tasks, optional flag to list deleted tasks """
for task in edge.ctera_migrate.list_tasks(deleted=False):
print(task)
- CTERAMigrate.start(task)
Start a task
- Parameters:
task (cterasdk.common.object.Object) – Task object
edge.ctera_migrate.start(task)
- CTERAMigrate.stop(task)
Stop a task
- Parameters:
task (cterasdk.common.object.Object) – Task object
edge.ctera_migrate.stop(task)
- CTERAMigrate.delete(tasks)
Delete tasks
- Parameters:
tasks (list(cterasdk.common.object.Object)) – List of tasks
edge.ctera_migrate.delete(edge.ctera_migrate.list_tasks()) # delete all tasks
- CTERAMigrate.restore(tasks)
Recover tasks
- Parameters:
tasks (list(cterasdk.common.object.Object)) – List of tasks
edge.ctera_migrate.restore(edge.ctera_migrate.list_tasks(deleted=True)) # recover all deleted tasks
- CTERAMigrate.details(task)
Get task details
edge.ctera_migrate.details(task)
- CTERAMigrate.results(task)
edge.ctera_migrate.results(task)
Discovery#
- Discovery.list_tasks(deleted=False)
""" Print all discovery tasks, optional flag to list deleted tasks """
for task in edge.ctera_migrate.discovery.list_tasks(deleted=False):
print(task)
- Discovery.add(name, credentials, shares, auto_start=False, log_every_file=False, notes=None)
Create a discovery task
- Parameters:
name (str) – Task name
credentials (cterasdk.edge.types.HostCredentials) – Target host credentials
auto_start (bool,optional) – Start task after creation, defaults to
False
log_every_file (bool,optional) – Log every file, defaults to
False
notes (str,optional) – Task notes
- Returns:
Task
- Return type:
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)
- Discovery.update(task, name=None, notes=None)
Update a discovery task
- Parameters:
name (str,optional) – Task name
notes (str,optional) – Task notes
Migration#
- Migration.list_tasks(deleted=False)
""" Print all migration tasks, optional flag to list deleted tasks """
for task in edge.ctera_migrate.migration.list_tasks(deleted=False):
print(task)
- Migration.add(name, credentials, shares, auto_start=False, access_time=None, winacls=True, cloud_folder=None, create_cloud_folder_per_share=False, compute_checksum=False, exclude=None, include=None, notes=None)
Create a discovery task
- Parameters:
name (str) – Task name
credentials (cterasdk.edge.types.HostCredentials) – Target host credentials
auto_start (bool,optional) – Start task after creation, defaults to
False
access_time (bool,optional) – Copy last access time, defaults to
None
winacls (bool,optional) – Copy NTFS ACL’s, defaults to
True
cloud_folder (str,optional) – Target cloud folder, if
create_cloud_folder_per_share
was set toTrue
then this attribute serves as the cloud folder name prefixcreate_cloud_folder_per_share (bool,optional) – Create cloud folder per share, defaults to
False
compute_checksum (bool,optional) – Validate and report checksums post-migration, defaults to
False
exclude (list(str),optional) – List of patterns to exclude, defaults to
None
include (list(str),optional) – List of patterns to include, defaults to
None
notes (str,optional) – Task notes
- Returns:
Task
- Return type:
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)