Soracom Flux
Soracom Harvest Files Event Source
When you select Soracom Harvest Files as the Event Source for the Flux App, the App will be triggered when a file is uploaded (created, updated) or deleted in Soracom Harvest Files.
You can create up to 10 Soracom Harvest Files event sources per Soracom Account.
Event Source Configuration
Configure the conditions under which event messages are published to the channel from the event source.
- Enabled: The event source is enabled and can publish event messages to the channel.
- File Path (Prefix Match): Enter the file path in Harvest Files. Files with paths that match this prefix will trigger the event.
- Event Type: Event messages are sent when the selected event is detected. You can select multiple events.
- File Created: A file has been newly uploaded.
- File Updated: A file with the same name as an existing file has been uploaded.
- File Deleted: A file has been deleted.
Data Format
The data sent to a channel configured with the Soracom Harvest Files event source consists of Message and Context.
You can check the data received by the event to the Flux App in the History tab of Soracom Flux Studio. For more details, refer to View Logs.
Message
For this event source, the message is the event that occurred in Harvest Files and the path of the file that triggered the event. Here's an example:
{
"eventType": "updated",
"path": "/harvest-files-path/filename",
"contentType": "image/jpeg",
"presignedUrls": {
"get": "https://harvest-files.s3.ap-northeast-1.amazonaws.com/xxx"
}
}
Attribute | Description |
---|---|
eventType |
The type of event that occurred. Either of created , updated , or deleted . |
path |
The file path, including the file name. |
contentType |
The content type of the file. |
presignedUrls.get |
The URL to retrieve the created or updated file. This is not included when the eventType is deleted . |
The URL of presignedUrls.get
is only valid for 1 hour from the time of the event.
To reference the event source's Message in an action, input it as ${event.payload.<MESSAGE_ATTRIBUTE>}
or event.payload.<MESSAGE_ATTRIBUTE> == 1
.
Context
This contains the information about the Harvest Files event source configuration. Here's an example:
{
"eventType": "harvest_files",
"configurationId": "01J1CH2MJRVxxxxxxxxxxxxxxx"
}
The attributes are as follows:
Attribute | Description |
---|---|
eventType |
The type of event. When uploading (new, updating) or deleting a file in Soracom Harvest Files triggers the Flux App, the value is harvest_files . |
configurationId |
An ID unique to each Soracom Harvest Files event source configuration, issued by Harvest Files. |
To reference the above Context in an action, input it as ${event.context.<CONTEXT_ATTRIBUTE>}
or event.context.<CONTEXT_ATTRIBUTE> == 1
.