Swimlane Samba Share
34 min
the swimlane samba share connector enables automated file management on samba network shares, streamlining operations through the swimlane platform the swimlane samba share connector allows users to seamlessly manage files on samba network shares directly from the swimlane turbine platform this connector provides a suite of actions such as creating, deleting, listing, and moving directories and files, as well as uploading and retrieving file contents by integrating with swimlane samba share, users can automate file management tasks, enhance their security operations with streamlined access to file data, and respond to incidents more efficiently by leveraging file operations within their automated workflows this connector integrates with swimlane samba share and extends its infrastructure capabilities with this connector, you can connect to a samba shared network drive, create a directory, delete a directory, delete a file, list all files in a specified directory, list all shared directories, rename or move a file, and retrieve contents of a file asset setup or prerequisites to effectively utilize the swimlane samba share connector, ensure you have the following prerequisites swimlane samba share api authentication with the following parameters username the user account name used for authentication password the corresponding password for the user account ip the ip address of the samba server remote name the netbios name of the remote machine capabilities create a directory delete a directory delete a file list all directories list all files in a directory rename or move a file retrieve contents of a file upload a file configurations swimlane samba share api authentication swimlane samba share api authentication configuration parameters parameter description type required username username of account in which samba server is hosted string required password password of account in which samba server is hosted string required local netbios machine name the local netbios machine name that will identify where this connection is originating from string optional remote name the netbios machine name of the remote server string required domain the network domain string optional use ntlm v2 indicates whether pysmb should be ntlmv1 or ntlmv2 authentication algorithm for authentication boolean optional sign options determines whether smb messages will be signed default is sign when required if sign when required (value=2), smb messages will only be signed when remote server requires signing if sign when supported (value=1), smb messages will be signed when remote server supports signing but not requires signing if sign never (value=0), smb messages will never be signed regardless of remote server’s configurations number optional is direct tcp controls whether the netbios over tcp/ip (is direct tcp=false) or the newer direct hosting of smb over tcp/ip (is direct tcp=true) will be used for the communication boolean optional ip ip address of host string required port defaults to 139 if you are using direct tcp mode (is direct tcp=true when creating this smbconnection instance), use 445 number optional sock family in python 3 x, use none as we can infer the socket family from the provided ip in python 2 x, it must be either socket af inet or socket af inet6 string optional timeout timeout number optional verify ssl verify ssl certificate boolean optional http proxy a proxy to route requests through string optional actions create a directory creates a new directory on the specified path within the swimlane samba share service using provided 'service name' and 'path' input argument name type required description service name string required contains the name of the shared folder path string required the path of the new folder (relative to) the shared folder timeout number optional parameter for create a directory output parameter type description status code number http status code of the response reason string response reason phrase message string response message example \[ { "status code" 200, "response headers" {}, "reason" "ok", "json body" { "message" "directory created" } } ] delete a directory removes an empty directory from the specified path on the samba service, requiring 'service name' and 'path' as inputs input argument name type required description service name string required contains the name of the shared folder path string required the path of the to be deleted folder (relative to) the shared folder timeout number optional parameter for delete a directory output parameter type description status code number http status code of the response reason string response reason phrase message string response message example \[ { "status code" 200, "response headers" {}, "reason" "ok", "json body" { "message" "directory deleted" } } ] delete a file removes specified files from a samba share using patterns and wildcards, with inputs for service name and file path input argument name type required description service name string required contains the name of the shared folder path file pattern string required the pathname of the file(s) to be deleted, relative to the service name wildcards may be used in th filename component of the path delete matching folders boolean optional parameter for delete a file timeout number optional parameter for delete a file output parameter type description status code number http status code of the response reason string response reason phrase message string response message example \[ { "status code" 200, "response headers" {}, "reason" "ok", "json body" { "message" "file deleted" } } ] list all directories retrieves a comprehensive list of all shared directories from the specified samba server input argument name type required description timeout number optional parameter for list all directories output parameter type description status code number http status code of the response reason string response reason phrase shared dirs array output field shared dirs example \[ { "status code" 200, "response headers" {}, "reason" "ok", "json body" { "shared dirs" \[] } } ] list all files in directory retrieve all files and folders within a specified directory on swimlane samba share using the provided service name and path input argument name type required description service name string required the name of the shared folder for the path path string required path relative to the service name where we are interested to learn about its files/sub folders pattern string optional the filter to apply to the results before returning to the client search number optional integer value made up from a bitwise or of smb file attribute xxx bits timeout number optional parameter for list all files in directory output parameter type description status code number http status code of the response reason string response reason phrase files array output field files example \[ { "status code" 200, "response headers" {}, "reason" "ok", "json body" { "files" \[] } } ] rename or move a file renames or moves a file/folder in swimlane samba share, requiring service name, old path, and new path input argument name type required description service name string required contains the name of the shared folder old path string required referring to the old path of the renamed resources (relative to) the shared folder new path string required referring to the new path of the renamed resources (relative to) the shared folder timeout number optional parameter for rename or move a file output parameter type description status code number http status code of the response reason string response reason phrase message string response message example \[ { "status code" 200, "response headers" {}, "reason" "ok", "json body" { "message" "file was renamed or moved" } } ] retrieve contents of a file retrieve the contents of a specified file from a samba share using the provided service name and path input argument name type required description service name string required the name of the shared folder for the path path string required path of the file on the remote server timeout number optional parameter for retrieve contents of a file output parameter type description status code number http status code of the response reason string response reason phrase file contents string response content example \[ { "status code" 200, "response headers" {}, "reason" "ok", "json body" { "file contents" "hello world\n" } } ] upload a file uploads a specified file to a samba network storage directory, requiring samba share dir, files, and file path input argument name type required description samba share dir string required contains the name of the shared folder files object required a swimlane file attachment object file name string required name of the resource file string required parameter for upload a file file path string required the pathname of the file to be uploaded, relative to the service name wildcards may be used in th filename component of the path if your path/filename contains non english characters, you must pass in an unicode string output parameter type description message string response message example \[ { "message" "file uploaded" } ] notes to access pysmb api documentation for the connector check here https //pysmb readthedocs io/en/latest/api/smb smbconnection html