mc event add
The mc event add
command adds event notification triggers to a bucket.
AIStor automatically sends triggered events to the configured notification target.
Syntax
Parameters
ALIAS
Required
The AIStor alias and bucket to which the command adds the new event notification. For example:
mc event add play/mybucket
ARN
Required
The Amazon Resource Name (ARN) of the notification target.
The Object Store outputs an ARN for each configured notification target at server startup. See Bucket Notifications for more information.
--event
Optional
The event(s) for which AIStor 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 Supported Bucket Events for a detailed list of S3 events associated to each of the supported values.
--ignore-existing
Alias: -p
Optional
Directs AIStor to ignore the specified event triggers if a matching trigger already exists.
--prefix
Optional
The bucket prefix in which the specified --event
can trigger a bucket notification.
For example, given a ALIAS
of play/mybucket
and a --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
Optional
The bucket suffix in which the specified --event
can trigger a bucket notification.
For example, given a ALIAS
of play/mybucket
and a --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
This command supports any of the global flags.
Examples
Add an Event Notification to a Bucket
The following command adds a new event notification trigger for all S3 PUT
, GET
, and DELETE
operations on a bucket.
The command assumes the AIStor deployment has at least one configured bucket notification target:
mc event add myminio/mydata arn:minio:sqs::primary:webhook
Behavior
Supported Bucket Events
The following table lists the supported mc event add
values and their
corresponding S3 events:
For more complete documentation on the listed S3 events, see S3 Supported Event Types.
S3 Compatibility
The mc
commandline tool is built for compatibility with the AWS S3 API and is tested with AIStor and AWS S3 for expected functionality and behavior.
AIStor 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.