Top

faspmanager module

A library for performing Aspera FASP transfers.

Use faspmanager by instantiating a subclass of BaseTransferOrder and starting a faspmanager session. With the session, you may control and monitor the transfer.

Example:

import faspmanager as fm

order = fm.FileUpload(
    source_paths='myfile.txt',
    dest_user='remote_user',
    dest_host='127.0.0.1',
    dest_pass='password'
)

with fm.session(order=order) as session:
    session.start()
    session.set_rate(target_kbps=100000)
    result = session.finish()
    print(result.ok())

Functions

def session(

order, ascp_path=None, port=0, listener=None)

Returns a faspmanager session instance matching the given transfer order.

Args:
order: An instance of a BaseTransferOrder subclass specifying the transfer.

Optional Keyword Args:
ascp_path: Path to the ASPERA ascp executable the session should use.
listener: A one argument function callback to asynchronously receive transfer updates.
port: The port on which to listen for an ascp management connection. This generally isn't of interest to API users.

Returns: An appropriate Session instance.

Raises: A runtime error if the given order is not a subclass of BaseTransferOrder.

Classes

class BaseTransferOrder

Base class of a specification for an Aspera FASP transfer.

Ancestors (in MRO)

Static methods

def ascp_opts(

self)

Returns the options to pass to ascp when performing the transfer.

class CipherType

Ancestors (in MRO)

Class variables

var AES_128

var AES_192

var AES_256

class FileChecksumType

Ancestors (in MRO)

Class variables

var MD5

var NONE

var SHA1

var SHA_256

var SHA_384

var SHA_512

class FileDownload

Specification for a file download.

Ancestors (in MRO)

Static methods

def __init__(

self, source_paths, source_user, source_host, dest_paths=None, source_pass=None, source_identity=None, options=None)

Creates a FileDownload order.

Args:
source_paths: A string path or list of string paths of source files to download.
source_user: The remote user.
source_host: The source hostname.

Optional Keyword Args:
dest_paths: A string path or list of string paths to which to transfer the source files. These must pairwise match the given source path(s).
source_pass: The destination user password to be used for authentication. Given as an alternative to dest_identity.
source_identity: The name of the private key file to be used for authentication. Given as an alternative to dest_pass.
options:
An instance of TransferOptions providing additional specification.

Raises:
A faspmanager.AuthenticationError if neither source_pass nor source_identity is given.

A faspmanager.InvalidPathError if dest_paths is given and does not match source_paths.

def ascp_opts(

self)

Returns the options to pass to ascp when performing the transfer.

Instance variables

var dest_paths

var options

var source_host

var source_identity

var source_pass

var source_paths

var source_user

class FileManifestFormat

Ancestors (in MRO)

Class variables

var NONE

var TEXT

class FileState

Ancestors (in MRO)

Class variables

var FAILED

var FINISHED

var SKIPPED

var TRANSFERRING

class FileUpload

Specification for a file upload.

Ancestors (in MRO)

Static methods

def __init__(

self, source_paths, dest_user, dest_host, dest_paths=None, dest_pass=None, dest_identity=None, options=None)

Creates a FileUpload order.

Args:
source_paths: A string path or list of string paths of source files to upload.
dest_user: The destination user on the remote host.
dest_host: The destination hostname.

Optional Keyword Args:
dest_paths: A string path or list of string paths to which to transfer the source files. These must pairwise match the given source path(s).
dest_pass: The destination user's password to be used for authentication. Given as an alternative to dest_identity.
dest_identity: The name of the private key file to be used for authentication. Given as an alternative to dest_pass.
options: An instance of TransferOptions providing additional specification.

Raises:
A faspmanager.AuthenticationError if neither dest_pass nor dest_identity is given.

A faspmanager.InvalidPathError if dest_paths is given and does not match source_paths.

def ascp_opts(

self)

Returns the options to pass to ascp when performing the transfer.

Instance variables

var dest_host

var dest_identity

var dest_pass

var dest_paths

var dest_user

var options

var source_paths

class HttpFallbackOptions

Options for HTTP transfers when FASP's UDP connection fails.

Ancestors (in MRO)

Static methods

def __init__(

self, encode_all_as_jpeg=None, http_port=None, https_key_filename=None, https_cert_filename=None, http_proxy_address_host=None, http_proxy_address_port=None)

Creates an HttpFallbackOptions object.

Optional Keyword Args:
encode_all_as_jpeg: Encode all HTTP transfers as JPEG files.
http_port: The port for HTTP fallback transfers.
https_key_filename: The HTTPS transfer's key filename.
https_cert_filename: The HTTPS certificate's filename.
https_proxy_address_host: The proxy server address used by HTTP fallback.
https_proxy_address_port: The proxy server port used by HTTP fallback.

def build_ascp_options(

self)

Instance variables

var encode_all_as_jpeg

var http_port

var http_proxy_address_host

var http_proxy_address_port

var https_cert_filename

var https_key_filename

class OverwritePolicy

Ancestors (in MRO)

Class variables

var ALWAYS

var DIFF

var DIFF_AND_OLDER

var NEVER

var OLDER

class PersistentDownload

Specification for a persistent download.

A persistent transfer's files are not specified up front; they are given while the transfer session is ongoing. This is useful for dynamically created content, where starting many faspmanager Sessions incurs unnecessary resource overhead.

Ancestors (in MRO)

Static methods

def __init__(

self, source_user, source_host, source_pass=None, source_identity=None, options=None)

Creates a PersistentDownload order.

Args:
source_user: The source user on the remote host.
source_host: The destination hostname.

Optional Keyword Args:
source_pass: The source user's password to be used for authentication. Given as an alternative to dest_identity.
source_identity: The name of the private key file to be used for authentication. Given as an alternative to dest_pass.
options: An instance of TransferOptions providing additional specification.

Raises:
A faspmanager.AuthenticationError if neither source_pass nor source_identity is given.

def ascp_opts(

self)

Returns the options to pass to ascp when performing the transfer.

Instance variables

var options

var source_host

var source_identity

var source_pass

var source_user

class PersistentSession

A persistent Session.

Persistent sessions take transfer sources via add_source after session startup instead of upfront as part of the transfer order. More sources can be added via add_source until finish is called, at which point the session completes all remaining transfers then terminates.

Example:

import faspmanager as fm

order = fm.PersistentUpload(
    dest_user='remote_user',
    dest_host='127.0.0.1',
    dest_pass='password',
)

with fm.session(order=order) as session:
    session.start()
    session.add_source(source_path='file1.txt', dest_path='file1.txt')
    session.add_source(source_path='file2.txt', dest_path='file2.txt')
    result = session.finish()
    print(result.ok())

Ancestors (in MRO)

Static methods

def __init__(

self, order, ascp_path=None, listener=None, port=None)

Inheritance: Session.__init__

Initialize self. See help(type(self)) for accurate signature.

def add_source(

self, source_path, dest_path, start_offset=None, end_offset=None)

Starts a transfer of the given file to the given destination.

Args:
source_path: The source file location on the remote host (if the session is a download) or local host (if the session is an upload). dest_path: The destination file location on the local host (if the session is a download) or remote host (if the session is an upload)

Optional Keyword Args:
start_offset: The offset of the first source byte included in the transfer. end_offset: The offset of the first source byte discluded from the transfer.

Raises: A SessionStateError if the session has not been started or if the session has been terminated with a call to finish() or close().

A socket.error if communication with the underlying transfer process fails.

Notes: start_offset and/or end_offset may be given to transfer only a portion of the source file.

Like with static transfers, dest_path is applied relative to the destination root path. This path is either given as a transfer option or defaults to the destination user's home directory.

def cancel(

self)

Attempts to cancel the session, including all constituent files.

Returns:
True if the session is running and successfully communicates with the underlying FASP transfer. False if the session has already concluded.

Raises:
A SessionStateError if the session has not been started.

A socket.error if communication with the underlying transfer process fails.

def close(

self)

Cleans up the session's resources.

Notes:
Close does not wait for the transfer to complete before killing the associated transfer process and resources. If it is called prior to a transfer's completion, the result of the transfer is unspecified and irretrievable from faspmanager (typically, the effect is to cancel the transfer).

close may safely be called multiple times, with calls after the first having no effect.

def failed_files(

self)

Returns the names of files whose transfers failed.

Returns: A list of filename strings.

def file_stats(

self, filename=None)

Returns file statistics for the given file or for all transferred files.

Optional Keyword Args:
filename: The name of the file to retrieve information about.

Returns:
If filename is given, returns a single file statistics dict, or None if no statistics exist for the file. If filename is not given, returns a dict of such objects keyed by filename.

def finish(

self)

Blocks until transfer completion, returning the result.

Returns:
A SessionResult describing the transfer.

Raises:
A SessionStateError if the session has not been started.

Notes:
finish may be called multiple times, in which case it will return identical results.

def set_rate(

self, target_kbps)

Attempts to set the rate of the transfer.

Args:
target_kbps: The new integer target rate in kilobytes per second.

Returns:
True if the session is running and successfully communicates with the underlying FASP transfer. False if the session has already concluded.

Raises:
A SessionStateError if the session has not been started.

A socket.error if communication with the underlying transfer process fails.

def start(

self)

Starts the transfer.

Raises:
A SessionStateError if the session was previously started.

A FileNotFoundError if the configured or guessed path to an Aspera ascp executable is invalid.

A SessionStartError if the session cannot establish a TCP connection with the underlying transfer process.

def state(

self)

Returns the state of the transfer.

Returns:
A SessionState constant.

Notes:
This is equivalent to calling session.stats().get('state') on the session object.

def stats(

self)

Returns the session's transfer statistics.

Returns:
A dict of transfer statistics.

Notes:
The returned stats are session level; they do not contain information about a specific file. Call session.file_stats for file-specific information.

class PersistentUpload

Specification for a persistent upload.

A persistent transfer's files are not specified up front; they are given while the transfer session is ongoing. This is useful for dynamically created content, where starting many faspmanager Sessions incurs unnecessary resource overhead.

Ancestors (in MRO)

Static methods

def __init__(

self, dest_user, dest_host, dest_pass=None, dest_identity=None, options=None)

Creates a PersistentUpload order.

Args:
dest_user: The destination user on the remote host.
dest_host: The destination hostname.

Optional Keyword Args: dest_pass: The destination user's password to be used for authentication. Given as an alternative to dest_identity.
dest_identity: The name of the private key file to be used for authentication. Given as an alternative to dest_pass.
options: An instance of TransferOptions providing additional specification.

Raises:
A faspmanager.AuthenticationError if neither dest_pass nor dest_identity is given.

def ascp_opts(

self)

Returns the options to pass to ascp when performing the transfer.

Instance variables

var dest_host

var dest_identity

var dest_pass

var dest_user

var options

class PreserveMode

Ancestors (in MRO)

Class variables

var METAFILE

var NATIVE

var NONE

class ResumeCheck

Ancestors (in MRO)

Class variables

var FILE_ATTRIBUTES

var FULL_CHECKSUM

var OFF

var SPARSE_CHECKSUM

class Session

A class for executing Aspera FASP transfers.

Session allows you to interact with a transfer while it is ongoing, including querying statistics, updating the transfer rate, and verifying successful completion.

It manages several resources (a thread, process, and network connections) which should be cleaned up after its use by a call to Session.close. Session objects may be used as a context manager to ensure close is called.

Ancestors (in MRO)

Static methods

def __init__(

self, order, ascp_path=None, listener=None, port=None)

Initialize self. See help(type(self)) for accurate signature.

def cancel(

self)

Attempts to cancel the session, including all constituent files.

Returns:
True if the session is running and successfully communicates with the underlying FASP transfer. False if the session has already concluded.

Raises:
A SessionStateError if the session has not been started.

A socket.error if communication with the underlying transfer process fails.

def close(

self)

Cleans up the session's resources.

Notes:
Close does not wait for the transfer to complete before killing the associated transfer process and resources. If it is called prior to a transfer's completion, the result of the transfer is unspecified and irretrievable from faspmanager (typically, the effect is to cancel the transfer).

close may safely be called multiple times, with calls after the first having no effect.

def failed_files(

self)

Returns the names of files whose transfers failed.

Returns: A list of filename strings.

def file_stats(

self, filename=None)

Returns file statistics for the given file or for all transferred files.

Optional Keyword Args:
filename: The name of the file to retrieve information about.

Returns:
If filename is given, returns a single file statistics dict, or None if no statistics exist for the file. If filename is not given, returns a dict of such objects keyed by filename.

def finish(

self)

Blocks until transfer completion, returning the result.

Returns:
A SessionResult describing the transfer.

Raises:
A SessionStateError if the session has not been started.

Notes:
finish may be called multiple times, in which case it will return identical results.

def set_rate(

self, target_kbps)

Attempts to set the rate of the transfer.

Args:
target_kbps: The new integer target rate in kilobytes per second.

Returns:
True if the session is running and successfully communicates with the underlying FASP transfer. False if the session has already concluded.

Raises:
A SessionStateError if the session has not been started.

A socket.error if communication with the underlying transfer process fails.

def start(

self)

Starts the transfer.

Raises:
A SessionStateError if the session was previously started.

A FileNotFoundError if the configured or guessed path to an Aspera ascp executable is invalid.

A SessionStartError if the session cannot establish a TCP connection with the underlying transfer process.

def state(

self)

Returns the state of the transfer.

Returns:
A SessionState constant.

Notes:
This is equivalent to calling session.stats().get('state') on the session object.

def stats(

self)

Returns the session's transfer statistics.

Returns:
A dict of transfer statistics.

Notes:
The returned stats are session level; they do not contain information about a specific file. Call session.file_stats for file-specific information.

Instance variables

var ascp_path

var listener

var order

var port

class SessionResult

The result of a transfer session.

Instances are returned by Session.finish and may be used to verify the success of a transfer.

Ancestors (in MRO)

Static methods

def __init__(

self, end_state, stats, failed_files)

Initialize self. See help(type(self)) for accurate signature.

def failed(

self)

Returns whether the transfer failed.

def failed_files(

self)

Returns a list of names of failed files.

def ok(

self)

Returns whether the transfer was successful.

def reason(

self)

If the session failed, returns the error description.

def stats(

self)

Returns the transfer's session statistics dict.

class SessionState

Ancestors (in MRO)

Class variables

var FAILED

var FINISHED

var NOTSTARTED

var RUNNING

class SessionStateError

Inappropriate argument value (of correct type).

Ancestors (in MRO)

  • SessionStateError
  • builtins.ValueError
  • builtins.Exception
  • builtins.BaseException
  • builtins.object

Class variables

var args

class Stream

A write-only, socket-like interface for stream-to-file transfers.

Ancestors (in MRO)

Static methods

def __init__(

self, dest_path, mgmt_conn, chunk_size)

Initialize self. See help(type(self)) for accurate signature.

def close(

self)

Closes the stream, concluding the stream-to-file transfer.

Raises:
A StreamStateError if the stream has not been opened.

A socket.error if the close message fails.

Notes: Close must be called to conclude the transfer. It may be called multiple times.

def open(

self)

Opens the stream to the destination file.

def send(

self, data)

Send a data string to the destination.

Args:
data: The byte string to send.

Raises: A StreamStateError if the stream is not open.

A socket.error if the write fails.

class StreamSession

A Session for performing stream-to-file transfers.

Call open_stream on a running StreamSession to obtain a writable socket-like stream to a destination file.

Example:

import faspmanager as fm

order = fm.StreamUpload(
    dest_user='remote_user',
    dest_host='127.0.0.1',
    dest_pass='password',
)

with fm.session(order=order) as session:
    session.start()
    stream = session.open_stream(dest_path="destination.txt")
    data = open("some_file.txt").read()
    stream.send(data)
    stream.close()
    result = session.finish()
    print(result.ok())

Ancestors (in MRO)

Static methods

def __init__(

self, order, chunk_size, ascp_path=None, listener=None, port=None)

Initialize self. See help(type(self)) for accurate signature.

def cancel(

self)

Attempts to cancel the session, including all constituent files.

Returns:
True if the session is running and successfully communicates with the underlying FASP transfer. False if the session has already concluded.

Raises:
A SessionStateError if the session has not been started.

A socket.error if communication with the underlying transfer process fails.

def close(

self)

Cleans up the session's resources.

Notes:
Close does not wait for the transfer to complete before killing the associated transfer process and resources. If it is called prior to a transfer's completion, the result of the transfer is unspecified and irretrievable from faspmanager (typically, the effect is to cancel the transfer).

close may safely be called multiple times, with calls after the first having no effect.

def failed_files(

self)

Returns the names of files whose transfers failed.

Returns: A list of filename strings.

def file_stats(

self, filename=None)

Returns file statistics for the given file or for all transferred files.

Optional Keyword Args:
filename: The name of the file to retrieve information about.

Returns:
If filename is given, returns a single file statistics dict, or None if no statistics exist for the file. If filename is not given, returns a dict of such objects keyed by filename.

def finish(

self)

Blocks until transfer completion, returning the result.

Returns:
A SessionResult describing the transfer.

Raises:
A SessionStateError if the session has not been started.

Notes:
finish may be called multiple times, in which case it will return identical results.

def open_stream(

self, dest_path)

Creates a file on the remote host and returns a writable stream to it.

Args:
dest_path: The name of the destination file to be created. This file is what the returned stream writes to.

Returns: A Stream object.

Raises: A SessionStateError if the session has not been started or if the session has been terminated with a call to finish() or close().

Notes: Like with static transfers, dest_path is applied relative to the destination root path. This path is either given as a transfer option or defaults to the destination user's home directory.

def set_rate(

self, target_kbps)

Attempts to set the rate of the transfer.

Args:
target_kbps: The new integer target rate in kilobytes per second.

Returns:
True if the session is running and successfully communicates with the underlying FASP transfer. False if the session has already concluded.

Raises:
A SessionStateError if the session has not been started.

A socket.error if communication with the underlying transfer process fails.

def start(

self)

Starts the transfer.

Raises:
A SessionStateError if the session was previously started.

A FileNotFoundError if the configured or guessed path to an Aspera ascp executable is invalid.

A SessionStartError if the session cannot establish a TCP connection with the underlying transfer process.

def state(

self)

Returns the state of the transfer.

Returns:
A SessionState constant.

Notes:
This is equivalent to calling session.stats().get('state') on the session object.

def stats(

self)

Returns the session's transfer statistics.

Returns:
A dict of transfer statistics.

Notes:
The returned stats are session level; they do not contain information about a specific file. Call session.file_stats for file-specific information.

Instance variables

var ascp_path

Inheritance: Session.ascp_path

class StreamStateError

Inappropriate argument value (of correct type).

Ancestors (in MRO)

  • StreamStateError
  • builtins.ValueError
  • builtins.Exception
  • builtins.BaseException
  • builtins.object

Class variables

var args

class StreamUpload

Specification for a stream-to-file upload.

Ancestors (in MRO)

Static methods

def __init__(

self, dest_user, dest_host, dest_pass=None, dest_identity=None, options=None)

Creates a StreamUpload order.

Args:
dest_user: The destination user on the remote host.
dest_host: The destination hostname.

Optional Keyword Args: dest_pass: The destination user's password to be used for authentication. Given as an alternative to dest_identity.
dest_identity: The name of the private key file to be used for authentication. Given as an alternative to dest_pass.
options: An instance of TransferOptions providing additional specification.

Raises:
A faspmanager.AuthenticationError if neither dest_pass nor dest_identity is given.

def ascp_opts(

self)

Returns the options to pass to ascp when performing the transfer.

Instance variables

var dest_host

var dest_identity

var dest_pass

var dest_user

var options

class SymlinkPolicy

Ancestors (in MRO)

Class variables

var COPY

var COPY_FORCE

var FOLLOW

var SKIP

class TransferEvent

Describes the progress of a transfer.

Instance Variables:
event_type: One of the faspmanager.TransferEventTypes.
session_stats: The updated session stats.
file_stats(OPTIONAL): The stats for the file this event concerns. Will be None if the event contains no file-specific information (i.e. an INIT, SESSION ERROR, ARGSTOP event).

Ancestors (in MRO)

Static methods

def __init__(

self, event_type, session_stats, file_stats=None)

Initialize self. See help(type(self)) for accurate signature.

Instance variables

var event_type

var file_stats

var session_stats

class TransferEventType

Ancestors (in MRO)

Class variables

var ARGSTOP

var DONE

var ERROR

var FILEERROR

var INIT

var SESSION

var SKIP

var STATS

var STOP

class TransferOptions

Provides configuration details for an Aspera FASP transfer.

These are optional transfer parameters, including the target rate, network ports to use, whether to overwrite destination files, etc.

Each is specified below, along with the expected type.

Options:

alternate_config_filename: Aspera configuration filename. (str)
apply_local_docroot: Apply the local docroot. Default: False (True or False)
auto_detect_capacity: Automatically detect bandwidth capacity. Default: False. (True or False)
check_ssh_fingerprint: Pass a required server SSH host key fingerprint. (str)
chunk_size: The write size for a stream-to-file transfer. (int)
cipher: The cipher type to use. (a faspmanager.CipherType constant)
content_protection_passphrase: Specifying this option turns on content protection. With content protection uploaded files are left encrypted on the destination and downloads are decrypted as they as downloaded. (str)
cookie: An arbitrary field used for application-specific requirements.
create_dirs: Create target directory (True or False).
datagram_size: Manually set the MTU (int).
delete_before_transfer: Delete extraneous files from the destination before the transfer (True or False).
destination_root: The destination root directory for transfers. Destination paths are interpreted relative to this directory. Default: destination user's home directory (str)
encryption: Turn encryption on or off. Default: on. (True or False)
exclude_newer_than: Exclude files modified more recently than the given time, where time is usually seconds since 1970-01-01 00:00:00, depending on the source file system (int).
exclude_older_than: Exclude files modified longer ago than the given time, where time is usually seconds since 1970-01-01 00:00:00, depending on the source file system (int).
exclude_patterns: Patterns used to exclude files from the transfer. Two special symbols are accepted as part of a pattern: * to match any character zero or more times, and ? to match any character exactly once. (list of str)
extra_options: Extra command line options to pass directly to Aspera ascp. (list)
file_checksum: Dictates whether the checksum of each transferred file is reported and, if so, what type of checksum is reported. (A FileChecksumType constant)
file_manifest_format: The format of the file manifest. (A FileManifestFormat constant)
file_manifest_path: Path to a directory on the client machine where the manifest file is to be written. If the path is invalid the manifest file will not be generated. (str)
http_fallback_options: Options for http transfers when FASP's UDP connection fails. (an instance of HttpFallbackOptions)
ignore_host_key: Whether to ignore a request to accept a host key when connecting to a remote host. (True or False)
local_log_dir: The directory to write the transfer log files to on the local host. (str)
min_rate_kbps: The minimum transfer rate in kbps. (int)
move_after_transfer_path: Names of source files to remove after transfer success (str).
multi_session_threshold: overwrite_policy: Policy to determine when to overwrite destination files. (A OverwritePolicy constant)
partial_file_suffix: Default suffix is ".partial". (string)
policy: The transfer policy. (A TransferPolicy constant)
pre_post_command_path: Path to file containing commands to run before and after the transfer. (str)
precalculate_job_size: Calculate the aggregate size of all files before starting the session.
Default: False(True or False)
preserve_access_time: Preserve the access time of source files, setting the access time of
destination files to match. (True or False)
preserve_acls: Preserve access control lists on the remote host when transferring files between different types of file systems. (A PreserveMode constant)
preserve_creation_time: Set the file creation time at the destination to that at the source. (True or False)
preserve_dates: Preserve file date attributes. (True or False)
preserve_file_owner_gid: Preserve file owner GID. (True or False)
preserve_file_owner_uid: Preserve file owner UID. (True or False)
preserve_modification_time: Set the file modification time at the destination to that of the
source. (True or False)
preserve_source_access_time: Set the file last-access time at the destination to that of the source. (True or False)
preserve_xattrs: Preserve extended attributes on the remote host when transferring files between different types of file systems. (A PreserveMode constant)
read_size: Read block size in bytes. (int)
remote_log_dir: Specify a directory to write the log file in for the remote host, instead of using the default directory. (str)
remote_preserve_acls: Preserve access control lists on the remote host when transferring files between different types of file systems. (A PreserveMode
constant)
remote_preserve_xattrs: Preserve extended attributes on the remote host when transferring files between different types of file systems. (a PreserveMode
constant)
remove_empty_directories: Remove empty source directories after transferring. (True or False)
remove_empty_source_dir: Remove the source directory argument itself. (True or False)
remove_files_after_transfer: Remove source files after transferring. (True or False)
resume_check: Resume policy for partially transferred files. (a ResumeCheck constant)
retransmission_request_max_size: Adjust the maximum size in bytes of a retransmission request (max 1440). (int)
retry_timeout: Informs any monitoring applications how long you intend to retry. Note that the fasp manager library itself does not implement retry; you must do this. (int)
save_before_overwrite: If a transfer would result in an existing file being overwritten, move that file to filename.yyyy.mm.dd.hh.mm.ss.index in the same directory (where index is set to 1 at the beginning of each new second and incremented for each file saved in this manner during the same second). File attributes are maintained in the renamed file. (True or False)
skip_dir_traversal_dups: Do not check for duplicate files. Default: false
skip_special_files: Skip special files. (True or False)
source_base: Specify the prefix to be stripped off from each source object. The remaining portion of the source path is kept intact at the destination. If the target directory does not exist, this option must be used along with TransferOptions.create_dirs. (string)
source_prefix: Add prefix to the beginning of each source path. This can be either a conventional path or a URI. However, it can only be a URI if there is no root defined. (str)
symlink_policy: How symbolic links are handled. (a faspmanager.SymlinkPolicy constant)
target_rate_kbps: The target transfer rate in kbps. This value is interpreted as a percentage of detected bandwidth when autoDetectCapacity is true. Default: 10000 (Or 100% when autoDetectCapacity is turned on). (int)
tcp_port: The TCP port used for transfer initialization. Default: 22 (int)
token: Security token. (str)
udp_port: The UDP port used for transferring data. Default: 33001 (int)
write_size: Write block size in bytes. (int)

Ancestors (in MRO)

Class variables

var DEFAULT_CHUNK_SIZE

var DEFAULT_DESTINATION_ROOT

var DEFAULT_POLICY

Static methods

def __init__(

self, **kwargs)

Creates a TransferOptions object.

Args:
kwargs: The transfer option key-value pairs. Each must specify a valid transfer option.

Raises:
A ValueError if any option is not recognized.

Example:

import faspmanager as fm

options = fm.TransferOptions(
    target_rate_kbps=100000,
    policy=fm.TransferPolicy.FAIR,
    local_log_dir='/var/mylogs'
    preserve_dates=True,
    create_dirs=True,
    http_fallback_options=fm.HttpFallbackOptions(
        http_port: 3300,
        https_key_filename: 'mykeyfile'
    )
)

def defaults(

)

Returns a dict of default transfer options.

def valid_options(

)

Returns a list of the valid option names.

Instance variables

var opts

class TransferPolicy

Ancestors (in MRO)

Class variables

var FAIR

var FIXED

var HIGH

var LOW