Implement mgmt REST APIs for heal subcommands (#3533)

The heal APIs supported in this change are,
- listing of objects to be healed.
- healing a bucket.
- healing an object.
This commit is contained in:
Krishnan Parthasarathi
2017-01-17 23:32:58 +05:30
committed by Harshavardhana
parent 98a6a2bcab
commit c194b9f5f1
17 changed files with 1482 additions and 103 deletions
+17 -1
View File
@@ -1,5 +1,5 @@
/*
* Minio Cloud Storage, (C) 2016 Minio, Inc.
* Minio Cloud Storage, (C) 2016, 2017 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -59,6 +59,21 @@ type BucketInfo struct {
Created time.Time
}
type healStatus int
const (
canHeal healStatus = iota // Object can be healed
corrupted // Object can't be healed
quorumUnavailable // Object can't be healed until read quorum is available
)
// HealInfo - represents healing related information of an object.
type HealInfo struct {
Status healStatus
MissingDataCount int
MissingPartityCount int
}
// ObjectInfo - represents object metadata.
type ObjectInfo struct {
// Name of the bucket.
@@ -89,6 +104,7 @@ type ObjectInfo struct {
// User-Defined metadata
UserDefined map[string]string
HealInfo *HealInfo `xml:"HealInfo,omitempty"`
}
// ListPartsInfo - represents list of all parts.