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
Name | Type | Default | Description |
---|---|---|---|
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 | The path of the destination file. Use the format "cloudomation:[path]" to copy a file to cloudomation | |
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 | |
port | Number | 445 | The port number to connect to |
remote_name | String | The remote NetBIOS name to use | |
src | String | The path of the source file to copy. Use the format "cloudomation:[path]" to copy a file from cloudomation | |
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 |
---|---|---|---|
log | list | [] | |
execution_id | int | The ID of the task execution | |
message | str | The ended message for the task. If the task ended with an error, the message will contain information about what went wrong | |
status | str | The 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 = 1Methods
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_apidef 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')