Skip to main content
Version: 8 - Apfelstrudel

ConnectorTypeSMB

class connector_types.connector_type_smb.ConnectorTypeSMB

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

This connector type uses the SMB protocol to copy a single file from a remote host to cloudomation or to copy a single file from cloudomation to a remote host. Alternatively, you can use this connector to list the contents of a folder of a remote host.

Input Schema

  • hostname

    The remote host name to connect to.

    Type: string

  • port

    Type: anyOf

  • username

    The user name to use.

    Type: string

  • password

    The password to use to authenticate.

    Type: string

  • my_name

    The own NetBIOS name to use.

    Type: string

    Default: Cloudomation

  • remote_name

    The remote NetBIOS name to use.

    Type: string

  • domain

    The domain name to use.

    Type: string

  • action

    The action to perform.

    Type: anyOf

  • connect_timeout

    How long to wait for the SMB connection to be established.

    Type: integer

    Default: 60

  • copy_timeout

    How long to wait for the copy to finish.

    Type: integer

    Default: 60

  • is_direct_tcp

    False: use legacy NetBIOS communication or True: use SMB communication.

    Type: boolean

    Default: True

  • use_ntlm_v2

    False use NTLMv1 or True use NTLMv2 for authentication.

    Type: boolean

    Default: True

  • src

    The path of the source file to copy. Use the format "cloudomation:<path>" to copy a file from cloudomation. Must be set for action copy.

    Type: anyOf

  • dst

    The path of the destination file. Use the format "cloudomation:<path>" to copy a file to cloudomation. Must be set for action copy.

    Type: anyOf

  • path

    The path for which to list the content. Must be set for action list.

    Type: anyOf

  • pattern

    A pattern to limit the files returned by the action list.

    Type: anyOf

Output Schema

  • result

    The contents of the directory. Only set when using the list action.

    Type: array

Constants

ssl_context_inputs = ['check_hostname', 'client_cert', 'client_key', 'server_ca']

Example

Copying a file

import flow_api

def handler(system: flow_api.System, this: flow_api.Execution, inputs: dict):
this.connect(
connector_type='SMB',
hostname='my-smb-host',
username='myself',
password='***',
src='share-name\\path\\to\\file.txt',
dst='cloudomation:file.txt',
)

return this.success('all done')

Listing the contents of a directory

import flow_api

def handler(system: flow_api.System, this: flow_api.Execution, inputs: dict):
listing = this.connect(
connector_type='SMB',
hostname='my-smb-host',
username='myself',
password='***',
action='list',
path='share-name\\path\\to\\list',
).get('output_value')['listing']

return this.success('all done')