/  Python Yamcs Client  /  File Transfer  /  Model

Model

class yamcs.filetransfer.model.EntityInfo(proto)
property id: str

Entity ID

property name: str

Name of the entity

class yamcs.filetransfer.model.FileTransferCapabilities(proto)
property download: bool
property filelist: bool
property has_transfer_type: bool
property remote_path: bool
property upload: bool
class yamcs.filetransfer.model.FileTransferOption(proto)
property allow_custom_option: bool

Whether using different values from the pre-set ones is allowed

property associated_text: str

Text associated with the option

property default: Any

Default value for the option

property description: str

Description for the option

property name: str

Name of the option

property type: str

Type of the option

property values

List of possible values for the option

class yamcs.filetransfer.model.RemoteFile(proto)

Represents a file on a remote entity.

property display_name: Optional[str]

Optionally, a preferred displayed name of the file.

property is_directory: bool

Whether the file is a directory

property modified: Optional[datetime]

Latest modification time of the file

property name: str

Identifying name of the file

property size: int

File size in bytes

class yamcs.filetransfer.model.RemoteFileListing(proto)

Represents a list of files from a remote.

property destination: str

Remote destination of the file list

property files: List[RemoteFile]

List of files

property list_time: datetime

Time the file list was made

property remote_path: str

Remote directory of the file list

class yamcs.filetransfer.model.Service(proto, service_client)
cancel_transfer(id: str)

Cancel a transfer

property capabilities: FileTransferCapabilities

Transfer capabilities

create_filelist_subscription(on_data: Optional[Callable[[RemoteFileListing], None]] = None, timeout: float = 60)

Create a new filelist subscription.

Parameters:
  • on_data – Function that gets called with Transfer updates.

  • timeout – The amount of seconds to wait for the request to complete.

Returns:

Future that can be used to manage the background websocket subscription

Return type:

yamcs.filetransfer.client.FileListSubscription

create_transfer_subscription(on_data: Optional[Callable[[Transfer], None]] = None, timeout: float = 60)

Create a new transfer subscription.

Parameters:
  • on_data – Function that gets called with Transfer updates.

  • timeout – The amount of seconds to wait for the request to complete.

Returns:

Future that can be used to manage the background websocket subscription

Return type:

yamcs.filetransfer.client.TransferSubscription

download(bucket_name: str, remote_path: str, object_name: Optional[str] = None, source_entity: Optional[str] = None, destination_entity: Optional[str] = None, overwrite: bool = True, parents: bool = True, reliable: bool = False, options: Optional[Mapping[str, Any]] = None) Transfer

Downloads a file from the source to a bucket.

Warning

Prefer the use of options instead of the deprecated params overwrite, parents and reliable.

Parameters:
  • bucket_name – Name of the bucket to receive the file.

  • object_name – Name of the file received in the bucket.

  • remote_path – Name of the file to be downloaded from the source.

  • source_entity – Use a specific source entity. (useful in case of multiples)

  • destination_entity – Use a specific destination entity. (useful in case of multiples)

  • overwrite

    Replace file if it already exists.

    Deprecated since version 1.8.6: Use options instead (option name: overwrite)

  • parents

    Create the remote path if it does not yet exist.

    Deprecated since version 1.8.6: Use options instead (option name: createPath)

  • reliable

    Enable reliable transfers.

    Deprecated since version 1.8.6: Use options instead (option name: reliable)

  • options – File transfer options dict (may overwrite overwrite, parents or reliable parameters if set in these options).

fetch_filelist(remote_path: str, source_entity: Optional[str] = None, destination_entity: Optional[str] = None, options: Optional[Mapping[str, Any]] = None)

Sends a request to fetch the directory listing from the remote (destination).

Parameters:
  • remote_path – path on the remote destination to get the file list

  • source_entity – source entity requesting the file list

  • destination_entity – destination entity from which the file list is needed

  • options – option dictionary

get_filelist(remote_path: str, source_entity: Optional[str] = None, destination_entity: Optional[str] = None, options: Optional[Mapping[str, Any]] = None) RemoteFileListing

Returns the latest directory listing for the given destination.

Parameters:
  • remote_path – path on the remote destination to get the file list

  • source_entity – source entity requesting the file list

  • destination_entity – destination entity from which the file list is needed

  • options – option dictionary

property instance: str

Instance of the service

property local_entities: List[EntityInfo]

List of local entities

property name: str

Name of this service.

pause_transfer(id: str)

Pauses a transfer

property remote_entities: List[EntityInfo]

List of remote entities

resume_transfer(id: str)

Resume a transfer

property transfer_options: List[FileTransferOption]

List of possible transfer options

upload(bucket_name: str, object_name: str, remote_path: str, source_entity: Optional[str] = None, destination_entity: Optional[str] = None, overwrite: bool = True, parents: bool = True, reliable: bool = False, options: Optional[Mapping[str, Any]] = None) Transfer

Uploads a file located in a bucket to a remote destination path.

Warning

Prefer the use of options instead of the deprecated params overwrite, parents and reliable.

Parameters:
  • bucket_name – Name of the bucket containing the source object.

  • object_name – Name of the source object.

  • remote_path – Remote destination.

  • source_entity – Use a specific source entity. (useful in case of multiples)

  • destination_entity – Use a specific destination entity. (useful in case of multiples)

  • overwrite

    Replace file if it already exists.

    Deprecated since version 1.8.6: Use options instead (option name: overwrite)

  • parents

    Create the remote path if it does not yet exist.

    Deprecated since version 1.8.6: Use options instead (option name: createPath)

  • reliable

    Enable reliable transfers.

    Deprecated since version 1.8.6: Use options instead (option name: reliable)

  • options – file transfer options dict (may overwrite “overwrite”, “parents” or “reliable” parameters if set in these options).

class yamcs.filetransfer.model.Transfer(proto, service_client)

Represents a file transfer.

await_complete(timeout: Optional[float] = None)

Wait for the transfer to be completed.

Parameters:

timeout – The amount of seconds to wait.

property bucket: str
cancel()

Cancel this transfer

property error: Optional[str]

Error message in case the transfer failed.

property id: str

Yamcs-local transfer identifier.

is_complete() bool

Returns whether this transfer is complete. A transfer can be completed, yet still failed.

is_success() bool

Returns true if this transfer was completed successfully.

property object_name: str
pause()

Pause this transfer

property reliable: bool

True if this is a Class 2 CFDP transfer.

property remote_path: str
resume()

Resume this transfer

property size: int

Total bytes to transfer.

property state: Optional[str]

Current transfer state.

property time: Optional[datetime]

Time when the transfer was started.

property transferred_size: int

Total bytes already transferred.