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.
Inputs
Name | Type | Default | Description |
---|---|---|---|
action | String | copy | The action to perform. Supported actions: copy and list . |
connect_timeout | Number | 60 | How long to wait for the SSH connection to be established |
copy_timeout | int | 60 | How long to wait for the copy to finish |
domain | String | `` | The domain name to use |
dst | String | None | The path of the destination file. Use the format "cloudomation:[path]" to copy a file to cloudomation. Must be set for action copy . |
hostname | String | The remote host name to connect to | |
is_direct_tcp | bool | True | False : use legacy NetBIOS communication or True : use SMB communication |
my_name | String | Cloudomation | The own NetBIOS name to use |
password | String | The password to use to authenticate | |
path | str | None | The path for which to list the content. Must be set for action list . |
pattern | str | * | A pattern to limit the files returned by the action list . |
port | Number | 445 | The port number to connect to |
remote_name | String | The remote NetBIOS name to use | |
src | String | None | 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 . |
use_ntlm_v2 | bool | True | False use NTLMv1 or True use NTLMv2 for authentication |
username | String | The user name to use |
Outputs
Name | Type | Default | Description |
---|---|---|---|
listing | list | [] | The contents of the directory. Only set when using the list action. |
log | list | [] |
Constants
input_list = ['action', 'connect_timeout', 'copy_timeout', 'domain', 'dst', 'hostname', 'is_direct_tcp', 'my_name', 'password', 'path', 'pattern', 'port', 'remote_name', 'src', 'use_ntlm_v2', 'username'] output_list = ['listing', 'log'] ssl_context_inputs = ['check_hostname', 'client_cert', 'client_key', 'server_ca'] version = 1Methods
execute
details
log
details
one_of_inputs
details
run
details
Example
Copying a file
import flow_api
def handler(system: flow_api.System, this: flow_api.Execution):
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):
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')