mc event remove

The mc event rm command removes an event notification trigger from a bucket.

The mc event remove command has equivalent functionality to mc event rm.

Syntax

The following command removes a configured event notifications for the specified bucket notification target for the mydata bucket on the myaistor MinIO AIStor deployment:

mc event rm myaistor/mydata arn:aws:sqs::primary:target

The command has the following syntax:

mc [GLOBALFLAGS] event remove        \
                 ALIAS               \
                 [ARN]               \
                 [--event "string"]  \
                 [--force]           \
                 [--prefix "string"] \
                 [--suffix "string"]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

Required

The S3 service alias and bucket from which the command removes the event notification. For example:

mc event rm myaistor/mybucket arn:minio:sqs::primary:webhook

ARN

Optional

The Amazon Resource Name (ARN) of the notification target.

To remove all event notifications from the bucket, omit the ARN and specify --force.

MinIO AIStor outputs an ARN at startup for each configured notification target. See Bucket Notifications for more information.

Retrieve the ARN by running mc event ls on the bucket.

mc event ls ALIAS/BUCKET

--event

Optional

The event type(s) specified when the event was added. The entries must match the values used when adding the event. If no event matches the list of event types, the command returns a no notification configuration matched error.

Specify multiple events using a comma to separate each event. See Supported Bucket Events for supported event types.

Defaults to put,delete,get. To remove an event that uses other event types, such as replica or ilm, specify those event types.

Retrieve the event types used by running mc event ls on the bucket. Use the following table to convert event types in the command’s output to the entry required for the mc event rm command:

Output of mv event lsEvent type to use
s3:objectAccessedget
s3:objectCreatedput
s3:objectRemoveddelete

For example, if the mc event ls returns the following:

arn:minio:sqs::mytest:webhook   s3:ObjectAccessed:*,s3:ObjectCreated:*   Filter:

Use the following command to remove the event:

mc event rm alias/bucket arn:minio:sqs::mytest:webhook --event get,put

The order of event types does not matter, only that you include the same ones that exist for the event.

--force

Optional

Removes all event notifications from the ALIAS bucket. Required when you omit the ARN. Has no effect when you specify an ARN.

--prefix

Optional

The bucket prefix in which the command removes bucket notifications.

For example, given a ALIAS of myaistor/mybucket and a --prefix of photos, the command only removes bucket notifications in myaistor/mybucket/photos.

--suffix

Optional

The bucket suffix in which the command removes bucket notifications.

For example, given a ALIAS of myaistor/mybucket and a --suffix of .jpg, the command only removes bucket notifications in myaistor/mybucket/*.jpg.

Global flags

This command supports any of the global flags.

Examples

Remove event notifications from a bucket

The following command removes all event notification triggers on a bucket. The command assumes the MinIO AIStor deployment has at least one configured bucket notification target:

mc event rm myaistor/mydata --force
  • Replace myaistor/mydata with the alias of the MinIO AIStor deployment and the bucket from which to remove the bucket notification events.

Behavior

S3 compatibility

The mc command-line tool is built for compatibility with the AWS S3 API and is tested with MinIO AIStor and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported.

While mc commands may work as documented, any such usage is at your own risk.

On this page