Close
    logoCloudomation Docs

    TaskSMB

    class tasks.task_smb.TaskSMB

    Copy a file from a SMB (CIFS, Samba) remote host to cloudomation or vice-versa.

    This task uses the SMB protocol to copy a single file from a remote host to cloudomation or to copy a sigle file from cloudomation to a remote host.

    Inputs

    NameTypeDefaultDescription
    connect_timeoutNumber60How long to wait for the SSH connection to be established
    copy_timeoutint60How long to wait for the copy to finish
    domainString``The domain name to use
    dstStringThe path of the destination file. Use the format "cloudomation:[path]" to copy a file to cloudomation
    hostnameStringThe remote host name to connect to
    is_direct_tcpboolTrueFalse: use legacy NetBIOS communication or True: use SMB communication
    my_nameStringCloudomationThe own NetBIOS name to use
    passwordStringThe password to use to authenticate
    portNumber445The port number to connect to
    remote_nameStringThe remote NetBIOS name to use
    srcStringThe path of the source file to copy. Use the format "cloudomation:[path]" to copy a file from cloudomation
    use_ntlm_v2boolTrueFalse use NTLMv1 or True use NTLMv2 for authentication
    usernameStringThe user name to use

    Outputs

    NameTypeDefaultDescription
    loglist[]
    execution_idintThe ID of the task execution
    messagestrThe ended message for the task. If the task ended with an error, the message will contain information about what went wrong
    statusstrThe ended status for the task. Either "success" or "error".

    Constants

    input_list = ['connect_timeout', 'copy_timeout', 'domain', 'dst', 'hostname', 'is_direct_tcp', 'my_name', 'password', 'port', 'remote_name', 'src', 'use_ntlm_v2', 'username']output_list = ['log']version = 1

    Methods

    get_file (smb_connection, src, dst)
    load_file (file_name)
    put_file (smb_connection, src, dst)
    run ()
    store_file (file_name, file_content_b64)

    Example

    import flow_api
    def handler(system: flow_api.System, this: flow_api.Execution):
    this.task(
    'SMB',
    hostname='my-smb-host',
    username='myself',
    password='***',
    src='share-name/path/to/file.txt',
    dst='cloudomation:file.txt',
    )
    return this.success('all done')
    Previous
    TaskSCP
    Next
    TaskSMTP