RayvisionTransfer Class

Transfer Module.

Execute the cmd command to make the last asset and download assets.

class rayvision_sync.transfer.RayvisionTransfer(api, config_bid, input_bid, domain, platform, local_os, user_id, automatic_line, output_bid=None, manage_task=None, transports_json='', transmitter_exe='', internet_provider='')

基类:object

Transfer including upload files and download files.

create_cmd(cmd_params, db_ini_path=None, engine_type='aspera', server_ip=None, server_port=None, main_user_id=None, main_input_bid=None, bid=None, network_mode=0)

Splice a cmd command.

参数:
  • cmd_params (list) --

    Parameters required by the cmd command. Examples:

    [
        transmit_type, # Transmission type
        local_path, # Local file path
        output_file_name, # File path uploaded to the server
        max_speed, # Maximum transfer speed of upload
        'true', # Whether to save the path
        'output_bid', # Transfer id
    ]
    

  • db_ini_path (str) -- Database path.

  • engine_type (str, optional) -- set engine type, support "aspera" and "raysyncproxy", Default "aspera".

  • server_ip (str, optional) -- transmit server host, if not set, it is obtained from the default transport profile.

  • server_port (str, optional) -- transmit server port, if not set, it is obtained from the default transport profile.

  • main_user_id (str) -- Main account user id.

  • main_input_bid (str) -- Main account input bid.

  • bid (str) -- Storage id.

  • network_mode (int) -- network mode: 0: auto selected, default; 1: tcp; 2: udp;

返回:

Cmd command.

返回类型:

str

init_transmitter()

Gets the path of the transfer software.

参数:

current_dir -- transfer base directory.

Returns: transfer software absolute path.

parse_service_transfe_line(internet_provider=None)
parse_transports_json(transports_json=None, domain=None, platform=None)

Analyze transports.json,obtain transfer server info.

Extract the transmission configuration information of the corresponding platform in transports.json.

参数:
  • transports_json (str, optional) -- Path to transfer configuration files.

  • domain (str, optional) -- Domain name.

  • platform (str, optional) -- Platform number.

返回:

Transfer configuration information
.e.g:
{

"engine_type":"aspera", "server_name":"HKCT", "server_ip":"render-client.raysync.cn", "server_port":"10221"

}

返回类型:

dict