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
-
hostnameThe remote host name to connect to.
Type:
string -
portType:
anyOfOptions: -
usernameThe user name to use.
Type:
string -
passwordThe password to use to authenticate.
Type:
string -
my_nameThe own NetBIOS name to use.
Type:
stringDefault:
Cloudomation -
remote_nameThe remote NetBIOS name to use.
Type:
string -
domainThe domain name to use.
Type:
string -
actionThe action to perform.
Type:
anyOfOptions: -
connect_timeoutHow long to wait for the SMB connection to be established.
Type:
integerDefault:
60 -
copy_timeoutHow long to wait for the copy to finish.
Type:
integerDefault:
60 -
is_direct_tcpFalse: use legacy NetBIOS communication orTrue: use SMB communication.Type:
booleanDefault:
True -
use_ntlm_v2Falseuse NTLMv1 orTrueuse NTLMv2 for authentication.Type:
booleanDefault:
True -
srcThe path of the source file to copy. Use the format "cloudomation:<path>" to copy a file from Cloudomation Engine. Must be set for action
copy.Type:
anyOfOptions: -
dstThe path of the destination file. Use the format "cloudomation:<path>" to copy a file to Cloudomation Engine. Must be set for action
copy.Type:
anyOfOptions: -
pathThe path for which to list the content. Must be set for action
list.Type:
anyOfOptions: -
patternA pattern to limit the files returned by the action
list.Type:
anyOfOptions:
Output Schema
-
resultThe contents of the directory. Only set when using the
listaction.Type:
arrayItems:
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')