Trigger
type: "io.kestra.plugin.minio.Trigger"
Wait for files on a bucket.
This trigger will list every interval
a bucket. You can search for all files in a bucket or directory in from
or you can filter the files with a regExp
. The detection is atomic, internally we do a list and interact only with files listed.
Once a file is detected, we download the file on internal storage and processed with declared action
in order to move or delete the files from the bucket (to avoid double detection on new poll).
Examples
Wait for a list of files on a bucket and iterate through the files.
id: minio_listen
namespace: company.team
tasks:
- id: each
type: io.kestra.plugin.core.flow.ForEach
values: "{{ trigger.objects | jq('.[].uri') }}"
tasks:
- id: return
type: io.kestra.plugin.core.debug.Return
format: "{{ taskrun.value }}"
triggers:
- id: watch
type: io.kestra.plugin.minio.Trigger
interval: "PT5M"
accessKeyId: "<access-key>"
secretKeyId: "<secret-key>"
region: "eu-central-1"
bucket: "my-bucket"
prefix: "sub-dir"
action: MOVE
moveTo:
key: archive"
Wait for a list of files on a bucket and iterate through the files. Delete files manually after processing to prevent infinite triggering.
id: minio_listen
namespace: company.team
tasks:
- id: each
type: io.kestra.plugin.core.flow.ForEach
values: "{{ trigger.objects | jq('.[].key') }}"
tasks:
- id: return
type: io.kestra.plugin.core.debug.Return
format: "{{ taskrun.value }}"
- id: delete
type: io.kestra.plugin.minio.Delete
accessKeyId: "<access-key>"
secretKeyId: "<secret-key>"
region: "eu-central-1"
bucket: "my-bucket"
key: "{{ taskrun.value }}"
triggers:
- id: watch
type: io.kestra.plugin.minio.Trigger
interval: "PT5M"
accessKeyId: "<access-key>"
secretKeyId: "<secret-key>"
region: "eu-central-1"
bucket: "my-bucket"
prefix: "sub-dir"
action: NONE
Wait for a list of files on a bucket on an S3-compatible storage — here, Spaces Object Storage from Digital Ocean. Iterate through those files, and move it to another folder.
id: trigger_on_s3_compatible_storage
namespace: company.team
tasks:
- id: each
type: io.kestra.plugin.core.flow.ForEach
values: "{{ trigger.objects | jq('.[].uri') }}"
tasks:
- id: return
type: io.kestra.plugin.core.debug.Return
format: "{{ taskrun.value }}"
triggers:
- id: watch
type: io.kestra.plugin.minio.Trigger
interval: "PT5M"
accessKeyId: "<access-key>"
secretKeyId: "<secret-key>"
endpoint: https://<region>>.digitaloceanspaces.com
bucket: "kestra-test-bucket"
prefix: "sub-dir"
action: MOVE
moveTo:
key: archive
Properties
accessKeyId
- Type: string
- Dynamic: ✔️
- Required: ❌
Access Key Id for authentication.
action
- Type: string
- Dynamic: ❓
- Required: ❌
- Possible Values:
MOVE
DELETE
NONE
bucket
- Type: string
- Dynamic: ❓
- Required: ❌
conditions
- Type: array
- SubType: Condition
- Dynamic: ❌
- Required: ❌
List of conditions in order to limit the flow trigger.
delimiter
- Type: string
- Dynamic: ❓
- Required: ❌
endpoint
- Type: string
- Dynamic: ✔️
- Required: ❌
URL to the MinIO endpoint.
filter
- Type: string
- Dynamic: ❓
- Required: ❌
- Default:
BOTH
- Possible Values:
FILES
DIRECTORY
BOTH
interval
- Type: string
- Dynamic: ❌
- Required: ❌
- Default:
60.000000000
- Format:
duration
Interval between polling.
The interval between 2 different polls of schedule, this can avoid to overload the remote system with too many calls. For most of the triggers that depend on external systems, a minimal interval must be at least PT30S. See ISO_8601 Durations for more information of available interval values.
marker
- Type: string
- Dynamic: ❓
- Required: ❌
maxKeys
- Type: integer
- Dynamic: ❓
- Required: ❌
- Default:
1000
moveTo
- Type: Copy-CopyObject
- Dynamic: ❓
- Required: ❌
prefix
- Type: string
- Dynamic: ❓
- Required: ❌
regexp
- Type: string
- Dynamic: ❓
- Required: ❌
region
- Type: string
- Dynamic: ✔️
- Required: ❌
MinIO region with which the SDK should communicate.
secretKeyId
- Type: string
- Dynamic: ✔️
- Required: ❌
Secret Key Id for authentication.
stopAfter
- Type: array
- SubType: string
- Dynamic: ❌
- Required: ❌
List of execution states after which a trigger should be stopped (a.k.a. disabled).
Outputs
objects
- Type: array
- SubType: MinioObject
- Required: ❌
The list of objects.
Definitions
io.kestra.plugin.minio.model.MinioObject
Properties
etag
- Type: string
- Dynamic: ❓
- Required: ❓
key
- Type: string
- Dynamic: ❓
- Required: ❓
lastModified
- Type: string
- Dynamic: ❓
- Required: ❓
- Format:
date-time
owner
- Type: Owner
- Dynamic: ❓
- Required: ❓
size
- Type: integer
- Dynamic: ❓
- Required: ❓
uri
- Type: string
- Dynamic: ❓
- Required: ❓
- Format:
uri
io.kestra.plugin.minio.Copy-CopyObject
Properties
bucket
- Type: string
- Dynamic: ✔️
- Required: ❌
The bucket name
key
- Type: string
- Dynamic: ✔️
- Required: ❌
The bucket key
io.kestra.plugin.minio.model.Owner
Properties
displayName
- Type: string
- Dynamic: ❓
- Required: ❓
id
- Type: string
- Dynamic: ❓
- Required: ❓
Was this page helpful?