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 sigle file from cloudomation to 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 |
---|---|---|---|
execution_id | int | The ID of the connection execution | |
listing | list | [] | The contents of the directory. Only set when using the list action. |
log | list | [] | |
message | str | The ended message for the connection. If the connection ended with an error, the message will contain information about what went wrong | |
status | str | The ended status for the connection. Either "success" or "error". |
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 ()
log (message)
one_of_inputs (options)
run ()
Example
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')