mirror of
https://github.com/minio/minio.git
synced 2025-11-09 05:34:56 -05:00
Add transition event notification (#11047)
This is a MinIO specific extension to allow monitoring of transition events.
This commit is contained in:
committed by
GitHub
parent
038bcd9079
commit
934bed47fa
@@ -55,6 +55,9 @@ const (
|
||||
ObjectRestorePostInitiated
|
||||
ObjectRestorePostCompleted
|
||||
ObjectRestorePostAll
|
||||
ObjectTransitionAll
|
||||
ObjectTransitionFailed
|
||||
ObjectTransitionComplete
|
||||
)
|
||||
|
||||
// Expand - returns expanded values of abbreviated event type.
|
||||
@@ -94,6 +97,11 @@ func (name Name) Expand() []Name {
|
||||
ObjectRestorePostInitiated,
|
||||
ObjectRestorePostCompleted,
|
||||
}
|
||||
case ObjectTransitionAll:
|
||||
return []Name{
|
||||
ObjectTransitionFailed,
|
||||
ObjectTransitionComplete,
|
||||
}
|
||||
default:
|
||||
return []Name{name}
|
||||
}
|
||||
@@ -152,6 +160,12 @@ func (name Name) String() string {
|
||||
return "s3:ObjectRestore:Post"
|
||||
case ObjectRestorePostCompleted:
|
||||
return "s3:ObjectRestore:Completed"
|
||||
case ObjectTransitionAll:
|
||||
return "s3:ObjectTransition:*"
|
||||
case ObjectTransitionFailed:
|
||||
return "s3:ObjectTransition:Failed"
|
||||
case ObjectTransitionComplete:
|
||||
return "s3:ObjectTransition:Complete"
|
||||
}
|
||||
|
||||
return ""
|
||||
@@ -254,7 +268,12 @@ func ParseName(s string) (Name, error) {
|
||||
return ObjectRestorePostInitiated, nil
|
||||
case "s3:ObjectRestore:Completed":
|
||||
return ObjectRestorePostCompleted, nil
|
||||
|
||||
case "s3:ObjectTransition:Failed":
|
||||
return ObjectTransitionFailed, nil
|
||||
case "s3:ObjectTransition:Complete":
|
||||
return ObjectTransitionComplete, nil
|
||||
case "s3:ObjectTransition:*":
|
||||
return ObjectTransitionAll, nil
|
||||
default:
|
||||
return 0, &ErrInvalidEventName{s}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user