1
0
mirror of https://github.com/minio/docs.git synced 2025-04-25 17:22:39 +03:00
docs/source/reference/minio-mc/mc-event-add.rst
Daryl White 8f9a1ff466
Updates mc event rm for mismatched event error (#1344)
- Cleans up `mc event` command flags with optional/required labels. 
- Drive by fix for an `mc idp` command with an `end-before` include
error.

Closes #1263
2024-10-08 13:07:04 -04:00

6.5 KiB

mc event add

minio

Table of Contents

mc event add

Syntax

The mc event add command adds event notification triggers to a bucket.

MinIO automatically sends triggered events to the configured notification target <minio-bucket-notifications>.

EXAMPLE

The following command creates a new event notification trigger for all PUT and DELETE operations for the mydata bucket on the myminio MinIO deployment:

mc event add --event "put,delete" myminio/mydata arn:aws:sqs::primary:target

The specified ARN corresponds to a configured bucket notification target <minio-bucket-notifications> on the myminio deployment.

SYNTAX

The command has the following syntax:

mc [GLOBALFLAGS] event add \
                 [--event "string"]  \
                 [--ignore-existing] \
                 [--prefix "string"] \
                 [--suffix "string"] \
                 ALIAS               \
                 ARN

Parameters

ALIAS

The MinIO alias <alias> and bucket to which the command adds the new event notification. For example:

mc event add play/mybucket

ARN

The Amazon Resource Name (ARN) <IAM/latest/UserGuide/reference-arns> of the notification target.

The MinIO server outputs an ARN for each configured notification target at server startup. See Bucket Notifications <minio-bucket-notifications> for more information.

--event

The event(s) for which MinIO generates bucket notifications.

Supports the following values:

  • put
  • get
  • delete

Specify multiple value using a comma , delimiter. Do not add any whitespace between values.

If not specified, defaults to put,delete,get.

See mc-event-supported-events for a detailed list of S3 events associated to each of the supported values.

ignore-existing, p

Directs MinIO to ignore the specified event triggers if a matching trigger already exists.

--prefix

The bucket prefix in which the specified ~mc event add --event can trigger a bucket notification.

For example, given a ~mc event add ALIAS of play/mybucket and a ~mc event add --prefix of photos, only events in play/mybucket/photos trigger bucket notifications.

Omit to trigger the event for all prefixes and objects in the bucket.

--suffix

The bucket suffix in which the specified ~mc event add --event can trigger a bucket notification.

For example, given a ~mc event add ALIAS of play/mybucket and a ~mc event add --suffix of .jpg, only events in play/mybucket/*.jpg trigger bucket notifications.

Omit to trigger the event for all objects regardless of suffix.

Global Flags

Examples

Add an Event Notification to a Bucket

Example

The following command adds a new event notification trigger for all S3 PUT, GET, and DELETE operations on a bucket. The command assumes the MinIO deployment has at least one configured bucket notification target <minio-bucket-notifications>:

mc event add myminio/mydata arn:minio:sqs::primary:webhook

Syntax

mc event add ALIAS ARN
  • Replace ALIAS with the alias <alias> of the MinIO deployment and the bucket on which to add the bucket notification event. For example:

    myminio/mydata

  • Replace ARN with the notification target ARN <mc event add ARN>.

Behavior

Supported Bucket Events

The following table lists the supported mc event add values and their corresponding S3 events <minio-bucket-notifications-event-types>:

Supported Value Corresponding S3 Events
put
s3:ObjectCreated:CompleteMultipartUpload
s3:ObjectCreated:Copy
s3:ObjectCreated:DeleteTagging
s3:ObjectCreated:Post
s3:ObjectCreated:Put
s3:ObjectCreated:PutLegalHold
s3:ObjectCreated:PutRetention
s3:ObjectCreated:PutTagging
get
s3:ObjectAccessed:Head
s3:ObjectAccessed:Get
s3:ObjectAccessed:GetRetention
s3:ObjectAccessed:GetLegalHold
delete
s3:ObjectRemoved:Delete
s3:ObjectRemoved:DeleteMarkerCreated
replica
s3:Replication:OperationCompletedReplication
s3:Replication:OperationFailedReplication
s3:Replication:OperationMissedThreshold
s3:Replication:OperationNotTracked
s3:Replication:OperationReplicatedAfterThreshold
ilm
s3:ObjectTransition:Failed
s3:ObjectTransition:Complete
s3:ObjectRestore:Post
s3:ObjectRestore:Completed
scanner
s3:Scanner:ManyVersions
s3:Scanner:BigPrefix

For more complete documentation on the listed S3 events, see S3 Supported Event Types <NotificationHowTo.html#notification-how-to-event-types-and-destinations>.

S3 Compatibility