FileTransfer#
- class ansys.speos.core.generic.file_transfer.FileTransfer(speos_client)#
Class to help performing file(s) transfer.
- Parameters:
- speos_client
ansys.speos.core.kernel.client.SpeosClient The Speos instance client.
- speos_client
- Parameters:
speos_client (ansys.speos.core.kernel.client.SpeosClient)
Overview#
Upload a file to a server. |
|
Upload several files to a server. |
|
Download a file from a server. |
|
Download several files from a server. |
|
Reserve an uri. |
|
Delete a file from a server. |
Import detail#
from ansys.speos.core.generic.file_transfer import FileTransfer
Method detail#
- FileTransfer.upload_file(file_path, reserved_file_uri='')#
Upload a file to a server.
- Parameters:
- file_path: Path
File’s path to be uploaded.
- reserved_file_uri: str, optional
Optional - In case an uri was already reserved in server for the file.
- Returns:
ansys.api.speos.file.v1.file_transfer_pb2.Upload_ResponseObject created from file_transfer.proto file, response of Upload procedure. Contains for example file uri and upload duration.
- FileTransfer.upload_folder(folder_path, main_file_name, reserved_main_file_uri='')#
Upload several files to a server.
- Parameters:
- folder_path: Path
Folder’s path containing all files to upload.
- main_file_name: str
Name of the file that will be considered as main. Other files will be dependencies of main.
- reserved_main_file_uri: str, optional
Optional - In case an uri was already reserved in server for the main file.
- Returns:
List[ansys.api.speos.file.v1.file_transfer_pb2.Upload_Response]Object created from file_transfer.proto file, response of Upload procedure. Contains for example file uri and upload duration.
- FileTransfer.download_file(file_uri, download_location)#
Download a file from a server.
- Parameters:
- file_uri: str
File’s uri on the server.
- download_location: Path
Path of download location.
- Returns:
ansys.api.speos.file.v1.file_transfer_pb2.Download_ResponseObject created from file_transfer.proto file. Contains for example file uri, file name, file size and download duration.
- FileTransfer.download_folder(main_file_uri, download_location)#
Download several files from a server.
- Parameters:
- main_file_uri
str Main file’s uri on the server - this file and all its dependencies will be downloaded.
- download_location
Path Path of download location.
- main_file_uri
- Returns:
List[ansys.api.speos.file.v1.file_transfer_pb2.Download_Response]Object created from file_transfer.proto file. Contains for example file uri, file name, file size and download duration.
- FileTransfer.delete(file_uri)#
Delete a file from a server.
- Parameters:
- file_uri: str
File’s uri on the server.