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).
type: "io.kestra.plugin.minio.Trigger"
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
Access Key Id for authentication.
URL to the MinIO endpoint.
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.
MinIO region with which the SDK should communicate.
Secret Key Id for authentication.
List of execution states after which a trigger should be stopped (a.k.a. disabled).
The bucket name
The bucket key