feat: Add ListBucketsWithMetadata extension API (#13219)

This commit is contained in:
Harshavardhana
2021-09-16 09:52:41 -07:00
committed by GitHub
parent 78dc08bdc2
commit 45bcf73185
5 changed files with 105 additions and 7 deletions

View File

@@ -24,6 +24,7 @@ import (
humanize "github.com/dustin/go-humanize"
"github.com/minio/madmin-go"
"github.com/minio/minio-go/v7/pkg/tags"
"github.com/minio/minio/internal/bucket/replication"
"github.com/minio/minio/internal/hash"
)
@@ -70,6 +71,30 @@ var ObjectsHistogramIntervals = []objectHistogramInterval{
{"GREATER_THAN_512_MB", humanize.MiByte * 512, math.MaxInt64},
}
// BucketUsageInfo represents per bucket usage statistics
type BucketUsageInfo struct {
Size uint64
ObjectsCount uint64
ObjectSizesHistogram StringMap
}
// BucketQuotaConfig holds bucket quota restrictions
type BucketQuotaConfig struct {
Quota uint64
Type madmin.QuotaType
}
// BucketDetailsInfo provides information about features currently
// turned-on per bucket.
type BucketDetailsInfo struct {
Versioning bool
VersioningSuspended bool
Locking bool
Replication bool
Tagging *tags.Tags `xml:",omitempty"`
Quota *BucketQuotaConfig `xml:",omitempty"`
}
// BucketInfo - represents bucket metadata.
type BucketInfo struct {
// Name of the bucket.
@@ -77,6 +102,16 @@ type BucketInfo struct {
// Date and time when the bucket was created.
Created time.Time
// Usage size of the bucket not reflective of
// actual usage atomically, but an ever increasing
// value.
Usage *BucketUsageInfo `xml:",omitempty"`
// Provides information about various bucket features
// enabled such as versioning, object locking, tagging
// quota, replication config etc.
Details *BucketDetailsInfo `xml:",omitempty"`
}
// ObjectInfo - represents object metadata.