Add new admin API to return Accounting Usage (#8689)

This commit is contained in:
Anis Elleuch
2020-02-05 03:20:39 +01:00
committed by GitHub
parent 301c50b721
commit 52bdbcd046
8 changed files with 264 additions and 0 deletions

View File

@@ -32,6 +32,11 @@ func (actionSet ActionSet) Add(action Action) {
actionSet[action] = struct{}{}
}
// IsEmpty - returns if the current action set is empty
func (actionSet ActionSet) IsEmpty() bool {
return len(actionSet) == 0
}
// Match - matches object name with anyone of action pattern in action set.
func (actionSet ActionSet) Match(action Action) bool {
for r := range actionSet {

View File

@@ -31,6 +31,8 @@ const (
// StorageInfoAdminAction - allow listing server info
StorageInfoAdminAction = "admin:StorageInfo"
// AccountingUsageInfoAdminAction - allow listing accounting usage info
AccountingUsageInfoAdminAction = "admin:AccountingUsageInfo"
// DataUsageInfoAdminAction - allow listing data usage info
DataUsageInfoAdminAction = "admin:DataUsageInfo"
// PerfInfoAdminAction - allow listing performance info