Skip to content

Commit 2fae296

Browse files
author
chenshengzhen
committed
add raysyncweb transfer
1 parent d1a7840 commit 2fae296

File tree

1 file changed

+56
-5
lines changed

1 file changed

+56
-5
lines changed

render/sync/rayvision_sync/core/upload_and_download.md

Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ UPLOAD.upload_asset(r"D:\test\upload.json")
267267
local_path (str): Download file locally save path,
268268
default Window system is "USERPROFILE" environment variable address splicing "renderfarm_sdk",
269269
Linux system is "HOME" environment variable address splicing "renderfarm_sdk".
270-
engine_type (str, optional): set engine type, support "aspera" and "raysync", Default "aspera".
270+
engine_type (str, optional): set engine type, support "aspera" and "raysyncweb", Default "aspera".
271271
server_ip (str, optional): transmit server host,
272272
if not set, it is obtained from the default transport profile.
273273
server_port (str, optional): transmit server port,
@@ -321,7 +321,7 @@ download.auto_download([18164087], download_filename_format="false")
321321
local_path (str): Download file locally save path,
322322
default Window system is "USERPROFILE" environment variable address splicing "renderfarm_sdk",
323323
Linux system is "HOME" environment variable address splicing "renderfarm_sdk".
324-
engine_type (str, optional): set engine type, support "aspera" and "raysync", Default "aspera".
324+
engine_type (str, optional): set engine type, support "aspera" and "raysyncweb", Default "aspera".
325325
server_ip (str, optional): transmit server host,
326326
if not set, it is obtained from the default transport profile.
327327
server_port (str, optional): transmit server port,
@@ -375,7 +375,7 @@ download.auto_download_after_task_completed([18164087], download_filename_format
375375
server_path (str or list): The user customizes the file structure to be downloaded from
376376
the output server, and all file structures are downloaded by default,
377377
example: "18164087_test/l_layer".
378-
engine_type (str, optional): set engine type, support "aspera" and "raysync", Default "aspera".
378+
engine_type (str, optional): set engine type, support "aspera" and "raysyncweb", Default "aspera".
379379
server_ip (str, optional): transmit server host,
380380
if not set, it is obtained from the default transport profile.
381381
server_port (str, optional): transmit server port,
@@ -434,7 +434,7 @@ network_mode: Control network transmission mode parameters
434434
2: udp mode to transmit
435435

436436
```
437-
# Take download as an example::
437+
# Take download as an example:
438438
download.auto_download([49240085], network_mode=2)
439439
```
440440

@@ -500,4 +500,55 @@ download.auto_download([49240085], network_mode=2)
500500
download.auto_download_after_task_completed([49228557], server_ip="45.251.92.16", server_port="12121")
501501
```
502502

503-
503+
504+
##### 3. select raysyncweb engine create a transfer task
505+
```python
506+
def start_transfer(self, server_ip, server_port, local_path, server_path, storage_id,
507+
task_type=None, task_id=None, file_type="normal",
508+
downstorage="output", max_speed=None, max_timeout=18000, network_mode=1):
509+
"""Download and update on the start.
510+
511+
Args:
512+
server_ip (str): IP address of the raysyncweb transmission server.
513+
server_port (str or int): The transfer service port of the raysyncweb.
514+
local_path (str): if task_type is 'upload', the type of local_path is the local file path;
515+
if task_type is 'download', the type of local_path is the local dir path;
516+
if task_type is 'upload-list', the type of local_path is 'upload.json' file path.
517+
task_type (str): task_type is "download" or "upload" or "upload-list"
518+
server_path (str): if task_type is 'upload', the type of local_path is the local dir path;
519+
if task_type is 'download', the type of local_path is the local file path;
520+
if task_type is 'upload-list', the type of local_path is ''.
521+
task_id (str or int): if file_type="json" task_id is not None; else task_id is None.
522+
if file_type="normal" task_id is default None
523+
downstorage (str): Select the storage to download; default "output", optional "input" or "output".
524+
max_speed (int): default is 1GB/S.
525+
max_timeout(int): Maximum time for querying task status, default is 18000s
526+
network_mode(int): Transport Protocol Type, default is 1
527+
0 is "default";
528+
1 is "tcp-only";
529+
2 is "udp-only"
530+
531+
Returns (int): 0 or 100,101,102,500.....
532+
0: sucess
533+
100,101,102,500.....: failed
534+
"""
535+
```
536+
fro example:
537+
538+
```python
539+
from rayvision_sync.rayvision_raysync.transfer_raysync import RayvisionTransferRaysync
540+
541+
#Instantiating an object
542+
trans = RayvisionTransferRaysync(task_domain, user_id, user_name, raysync_key, platform, logger)
543+
#Creating a Transport Task
544+
response_code = trans.start_transfer(server_ip, server_port, local_path,
545+
server_path, storage_id, task_type="download",
546+
)
547+
# 0 is success, else failed
548+
549+
#Querying all Task Status
550+
response = trans.get_task_list_status()
551+
552+
#Querying one Task Status
553+
response = trans.get_task_status(task_id)
554+
```

0 commit comments

Comments
 (0)