- General Client
- Mission Database
- TM/TC Processing
- Archive
- Link Management
- Object Storage
- File Transfer
- Time Correlation (TCO)
- Timeline
- Examples
Model¶
- class yamcs.client.FileTransferOption(proto)¶
Bases:
object
- property values¶
List of possible values for the option
- class yamcs.client.RemoteFileListing(proto)¶
Bases:
object
Represents a list of files from a remote.
- property files: List[RemoteFile]¶
List of files
- class yamcs.client.FileTransferService(proto, service_client: FileTransferServiceClient)¶
Bases:
object
- property capabilities: FileTransferCapabilities¶
Transfer capabilities
- create_filelist_subscription(on_data: Optional[Callable[[RemoteFileListing], None]] = None, timeout: float = 60) → FileListSubscription¶
Create a new filelist subscription.
- Parameters:
on_data – Function that gets called with
RemoteFileListing
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:
- create_transfer_subscription(on_data: Optional[Callable[[Transfer], None]] = None, timeout: float = 60) → TransferSubscription¶
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:
- download(bucket_name: str, remote_path: str, object_name: Optional[str] = None, source_entity: Optional[str] = None, destination_entity: Optional[str] = None, options: Optional[Mapping[str, Any]] = None) → Transfer¶
Downloads a file from the source to a bucket.
- 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)
options – File transfer 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 local_entities: List[EntityInfo]¶
List of local entities
- property remote_entities: List[EntityInfo]¶
List of remote entities
- run_file_action(file: str, action: str, message: Optional[Mapping[str, Any]] = None) → Dict[str, Any]¶
Run an action on a remote file.
Available actions depend on the specific file transfer implementation that is in use use.
New in version 1.9.6.
- Parameters:
file – Remote file identifier
action – Action identifier
message – Action message
- Returns:
Action result (if the action returns anything)
- 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, options: Optional[Mapping[str, Any]] = None) → Transfer¶
Uploads a file located in a bucket to a remote destination path.
- 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)
options – file transfer options
- class yamcs.client.Transfer(proto, service_client)¶
Bases:
object
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.
- cancel()¶
Cancel this transfer
- is_complete() → bool¶
Returns whether this transfer is complete. A transfer can be completed, yet still failed.
- pause()¶
Pause this transfer
- resume()¶
Resume this transfer