Skip to main content
Version: 11 - TBD

ConnectorTypeSMB

class connector_types.connector_type_smb.ConnectorTypeSMB

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

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

Input Schema

  • schema_version

    Type: string

  • authentication

    Type: anyOf

  • host

    The remote hostname or IP address.

    Type: string

  • port

    Type: anyOf

  • mode

    Type: anyOf

  • 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

  • connect_timeout

    A timeout for connecting to a peer in seconds.

    Type: integer

    Default: 30

  • total_timeout

    Total timeout for the request in seconds.

    Type: integer

    Default: 30

  • 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

Output Schema

Example

Copying a file

import flow_api

def handler(system: flow_api.System, this: flow_api.Execution, inputs: dict):
this.connect(
connector_type='SMB',
authentication={
'authentication_method': 'username_password',
'username': '...',
'password': '...',
},
host='...',
remote_name='...',
domain='...',
mode={
'mode_name': 'copy_file_from_engine',
'source_file_name': 'report.pdf',
'destination_file_name': 'share-name\\reports\\report.pdf',
},
)
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',
authentication={
'authentication_method': 'username_password',
'username': '...',
'password': '...',
},
host='...',
port={
'port_mode': 'port_number',
'port_number': 445,
},
mode={
'mode_name': 'list_files',
'path': 'share-name\\path\\to\\list',
'pattern': '*.csv',
},
).get('output_value')['listing']
return this.success('all done')