Upload all files from the attachments header to a defined SFTP directory.
The following configuration fields are available:
Note: if the directory does not exist, it will create it at the risk of possibly overwriting any files that may have the same name.
Input metadata:
Notes:
- Uploaded file name will get filename of income file if new
Filename
doesn’t providedFilename
will be added at the beggining of attachment name if income message contains multiple attachments:[SpecifiedFilename]_[NameOfExistedFile]
- File will be overwritten in case when file with specified name already exists in directory
Given a filename and a URL to an attachment stored in the platform, transfers the contents of the attachment to the SFTP server. The component returns a summary of the written file.
The following configuration fields are available:
Behavior When File Already Exists: The expected behavior of the component when trying to write to a file that already exists
Note: If the filename provided contains directories that do not exist, those directories will be created.
/home/myuser/somefolder/some.file
) and relative (e.g. ./somefolder/some.file
) paths are supported. Tilde (~
) expansion is not supported.{
"type": "object",
"required": true,
"properties": {
"filename": {
"title": "File Name and Path",
"type": "string",
"required": true
},
"attachmentUrl": {
"title": "Attachment URL",
"type": "string",
"required": true
},
"encoding": {
"title": "Encoding (defaults to null)",
"type": "string",
"required": false
},
"fileMod": {
"title": "File Mode (i.e. read/write permissions) (defaults to 0o666 (rwx))",
"type": "string",
"required": false
}
}
}
{
"type": "object",
"properties": {
"type": "object",
"properties": {
"type": {
"title": "Type",
"type": "string",
"required": true
},
"name": {
"title": "File Name",
"type": "string",
"required": true
},
"size": {
"title": "File Size",
"type": "number",
"required": true
},
"modifyTime": {
"title": "modifyTime",
"type": "string",
"required": true
},
"accessTime": {
"title": "accessTime",
"type": "string",
"required": true
},
"directory": {
"title": "directory",
"type": "string",
"required": true
},
"path": {
"title": "path",
"type": "string",
"required": true
},
"attachment_url": {
"title": "File Size",
"type": "number",
"required": true
}
}
}
}
Action to delete file by provided full file path.
{
"type": "object",
"properties": {
"path": {
"title": "Full Path",
"type": "string",
"required": true
}
}
}
{
"type": "object",
"properties": {
"id": {
"title": "Full Path",
"type": "string",
"required": true
}
}
}
Finds a file by name in the provided directory and uploads (streams) to the attachment storage (a.k.a. steward). After the upload, the READ-URL of the file will be used to generate a message with content like below:
{
"id": "0c196dca-4187-4b49-bf90-5cfe9030955b",
"attachments": {
"1.txt": {
"url": "http://steward-service.platform.svc.cluster.local:8200/files/99999-6613-410a-9da8-c5f6d529b683",
"size": 7
}
},
"body": {
"type": "-",
"name": "1.txt",
"size": 7,
"modifyTime": "2019-12-02T13:05:42.000Z",
"accessTime": "2019-12-04T14:14:54.000Z",
"rights": {
"user": "rw",
"group": "r",
"other": "r"
},
"owner": 1002,
"group": 1002,
"attachment_url": "http://steward-service.platform.svc.cluster.local:8200/files/99999-6613-410a-9da8-c5f6d529b683",
"directory": "/www/olhav",
"path": "/www/olhav/1.txt"
}
}
The next component may read from url
in attachments
for a memory-efficient way to read/parse data.
Default No
. In case No
is selected - an error will be thrown when no objects were found,
If Yes
is selected - an empty object will be returned instead of throwing an error.
Default No
. In case No
is selected - an error will be thrown when object id is missing in metadata, if Yes
is selected - an empty object will be returned instead of throwing an error.
{
"type": "object",
"properties": {
"path": {
"title": "Path and File Name",
"type": "string"
}
}
}
{
"type": "object",
"properties": {
"type": {
"title": "Type",
"type": "string",
"required": true
},
"name": {
"title": "File Name",
"type": "string",
"required": true
},
"size": {
"title": "File Size",
"type": "number",
"required": true
},
"modifyTime": {
"title": "modifyTime",
"type": "string",
"required": true
},
"accessTime": {
"title": "accessTime",
"type": "string",
"required": true
},
"directory": {
"title": "directory",
"type": "string",
"required": true
},
"path": {
"title": "path",
"type": "string",
"required": true
},
"attachment_url": {
"title": "File Size",
"type": "number",
"required": true
}
}
}
Note:
type
field represents type of the file. You can find additional information about Unix file types below.
Finds a file by criterias in the provided directory and uploads (streams) to the attachment storage (a.k.a. steward). After the upload, the READ-URL of the file will be used to generate a message with content like below:
{
"id": "0c196dca-4187-4b49-bf90-5cfe9030955b",
"attachments": {
"1.txt": {
"url": "http://steward-service.platform.svc.cluster.local:8200/files/99999-6613-410a-9da8-c5f6d529b683",
"size": 7
}
},
"body": {
"type": "-",
"name": "1.txt",
"size": 7,
"modifyTime": "2019-12-02T13:05:42.000Z",
"accessTime": "2019-12-04T14:14:54.000Z",
"rights": {
"user": "rw",
"group": "r",
"other": "r"
},
"owner": 1002,
"group": 1002,
"attachment_url": "http://steward-service.platform.svc.cluster.local:8200/files/99999-6613-410a-9da8-c5f6d529b683",
"directory": "/www/test",
"path": "/www/test/1.txt"
}
}
The next component may read from url
in attachments
for a memory-efficient way to read/parse data.
Fetch All
- fetch all objects in one message in form of array, Emit Individually
- emit each fetched object as separate message.
Not required field, number of search terms. Determines the number of search terms that the entity must match. Need to be an integer value from 1 to 99. If this field is empty, action emits all entities with selected type.
Not required field. If Yes
- all files will be downloaded to the attachments and action will return files metadata as JSON object. If No
- No files will be downloaded to the attachments and action returns files metadata in JSON object
Directory Path - required field, Path of lookup directory.
Max Size - Maximum number of objects to fetch. Default 250
, maximum value is 250
.
Metadata is depending on the input field Number of search terms
.
If Number of search terms
is empty, metadata does not exist.
If Number of search terms
= 1, metadata has only one search term.
If Number of search terms
> 1, metadata has a number of search term equal Number of search terms
and a number of criteria link equal ‘Number of search terms
- 1’.
Each search term has 3 fields:
Allowed Values
section:Allowed Values
section:You can use wildcard in the condition value for the like
operator. See micromatch documentation.
Between search terms, there is Criteria Link. You need to select the one criteria from Allowed Values
section:
And
Criteria Link has precedence over Or
. If you configure 3 search Terms:
searchTerm1 and SearchTerm2 or SearchTerm3
, it will be executed as
(searchTerm1 and SearchTerm2) or SearchTerm3
For example, if you want to find all files where field name
starts from 123
or field size
grater than 10000
:
Schema of output metadata depends on Behaviour configuration:
{
"type": "object",
"properties": {
"results": {
"type": "array",
"properties": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"name": {
"type": "string"
},
"size": {
"type": "number"
},
"modifyTime": {
"type": "number"
},
"accessTime": {
"type": "number"
},
"rights": {
"type": "object",
"properties": {
"user": {
"type": "string"
},
"group": {
"type": "string"
},
"other": {
"type": "string"
}
}
},
"owner": {
"type": "number"
},
"group": {
"type": "number"
},
"attachment_url": {
"type": "string"
},
"directory": {
"type": "string"
},
"path": {
"type": "string"
}
}
}
}
}
}
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"name": {
"type": "string"
},
"size": {
"type": "number"
},
"modifyTime": {
"type": "number"
},
"accessTime": {
"type": "number"
},
"rights": {
"type": "object",
"properties": {
"user": {
"type": "string"
},
"group": {
"type": "string"
},
"other": {
"type": "string"
}
}
},
"owner": {
"type": "number"
},
"group": {
"type": "number"
},
"attachment_url": {
"type": "string"
},
"directory": {
"type": "string"
},
"path": {
"type": "string"
}
}
}
type
field represents type of the file. You can find additional information about Unix file types below;
Action to move file on SFTP already exists in one location on an sftp server to be moved to another location on the same SFTP server. Target location MUST exist.
{
"type": "object",
"required": true,
"properties": {
"filename": {
"title": "Current file Name and Path",
"type": "string",
"required": true
},
"newFilename": {
"title": "New file Name and Path (location must exist)",
"type": "string",
"required": true
}
}
}
{
"type": "object",
"required": true,
"properties": {
"filename": {
"title": "Current file Name and Path",
"type": "string",
"required": true
},
"newFilename": {
"title": "New file Name and Path",
"type": "string",
"required": true
}
}
}
Action does not support Fetch Page
mode (according to OIH standards)
Click here to learn more about the elastic.io iPaaS