mirror of
https://github.com/minio/minio.git
synced 2025-04-04 11:50:36 -04:00
Update error response when heal is not implemented (#5383)
This commit is contained in:
parent
1b721d76b1
commit
8e4eb591c1
@ -448,6 +448,12 @@ func (adminAPI adminAPIHandlers) ListUploadsHealHandler(w http.ResponseWriter, r
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if this setup has an erasure coded backend.
|
||||||
|
if !globalIsXL {
|
||||||
|
writeErrorResponse(w, ErrHealNotImplemented, r.URL)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Validate query params.
|
// Validate query params.
|
||||||
vars := r.URL.Query()
|
vars := r.URL.Query()
|
||||||
bucket := vars.Get(string(mgmtBucket))
|
bucket := vars.Get(string(mgmtBucket))
|
||||||
@ -531,6 +537,12 @@ func (adminAPI adminAPIHandlers) ListObjectsHealHandler(w http.ResponseWriter, r
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if this setup has an erasure coded backend.
|
||||||
|
if !globalIsXL {
|
||||||
|
writeErrorResponse(w, ErrHealNotImplemented, r.URL)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Validate query params.
|
// Validate query params.
|
||||||
vars := r.URL.Query()
|
vars := r.URL.Query()
|
||||||
bucket, prefix, marker, delimiter, maxKey, adminAPIErr := extractListObjectsHealQuery(vars)
|
bucket, prefix, marker, delimiter, maxKey, adminAPIErr := extractListObjectsHealQuery(vars)
|
||||||
@ -567,6 +579,12 @@ func (adminAPI adminAPIHandlers) ListBucketsHealHandler(w http.ResponseWriter, r
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if this setup has an erasure coded backend.
|
||||||
|
if !globalIsXL {
|
||||||
|
writeErrorResponse(w, ErrHealNotImplemented, r.URL)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Get the list buckets to be healed.
|
// Get the list buckets to be healed.
|
||||||
bucketsInfo, err := objLayer.ListBucketsHeal()
|
bucketsInfo, err := objLayer.ListBucketsHeal()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -598,6 +616,12 @@ func (adminAPI adminAPIHandlers) HealBucketHandler(w http.ResponseWriter, r *htt
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if this setup has an erasure coded backend.
|
||||||
|
if !globalIsXL {
|
||||||
|
writeErrorResponse(w, ErrHealNotImplemented, r.URL)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Validate bucket name and check if it exists.
|
// Validate bucket name and check if it exists.
|
||||||
vars := r.URL.Query()
|
vars := r.URL.Query()
|
||||||
bucket := vars.Get(string(mgmtBucket))
|
bucket := vars.Get(string(mgmtBucket))
|
||||||
@ -687,6 +711,12 @@ func (adminAPI adminAPIHandlers) HealObjectHandler(w http.ResponseWriter, r *htt
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if this setup has an erasure coded backend.
|
||||||
|
if !globalIsXL {
|
||||||
|
writeErrorResponse(w, ErrHealNotImplemented, r.URL)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
vars := r.URL.Query()
|
vars := r.URL.Query()
|
||||||
bucket := vars.Get(string(mgmtBucket))
|
bucket := vars.Get(string(mgmtBucket))
|
||||||
object := vars.Get(string(mgmtObject))
|
object := vars.Get(string(mgmtObject))
|
||||||
@ -745,6 +775,12 @@ func (adminAPI adminAPIHandlers) HealUploadHandler(w http.ResponseWriter, r *htt
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if this setup has an erasure coded backend.
|
||||||
|
if !globalIsXL {
|
||||||
|
writeErrorResponse(w, ErrHealNotImplemented, r.URL)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
vars := r.URL.Query()
|
vars := r.URL.Query()
|
||||||
bucket := vars.Get(string(mgmtBucket))
|
bucket := vars.Get(string(mgmtBucket))
|
||||||
object := vars.Get(string(mgmtObject))
|
object := vars.Get(string(mgmtObject))
|
||||||
@ -824,7 +860,7 @@ func (adminAPI adminAPIHandlers) HealFormatHandler(w http.ResponseWriter, r *htt
|
|||||||
// heal-format is only applicable to single node XL and
|
// heal-format is only applicable to single node XL and
|
||||||
// distributed XL setup.
|
// distributed XL setup.
|
||||||
if !globalIsXL {
|
if !globalIsXL {
|
||||||
writeErrorResponse(w, ErrNotImplemented, r.URL)
|
writeErrorResponse(w, ErrHealNotImplemented, r.URL)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,6 +181,7 @@ const (
|
|||||||
ErrAdminCredentialsMismatch
|
ErrAdminCredentialsMismatch
|
||||||
ErrInsecureClientRequest
|
ErrInsecureClientRequest
|
||||||
ErrObjectTampered
|
ErrObjectTampered
|
||||||
|
ErrHealNotImplemented
|
||||||
)
|
)
|
||||||
|
|
||||||
// error code to APIError structure, these fields carry respective
|
// error code to APIError structure, these fields carry respective
|
||||||
@ -756,6 +757,11 @@ var errorCodeResponse = map[APIErrorCode]APIError{
|
|||||||
Description: errObjectTampered.Error(),
|
Description: errObjectTampered.Error(),
|
||||||
HTTPStatusCode: http.StatusPartialContent,
|
HTTPStatusCode: http.StatusPartialContent,
|
||||||
},
|
},
|
||||||
|
ErrHealNotImplemented: {
|
||||||
|
Code: "XMinioHealNotImplemented",
|
||||||
|
Description: "This server does not implement heal functionality.",
|
||||||
|
HTTPStatusCode: http.StatusBadRequest,
|
||||||
|
},
|
||||||
ErrMaximumExpires: {
|
ErrMaximumExpires: {
|
||||||
Code: "AuthorizationQueryParametersError",
|
Code: "AuthorizationQueryParametersError",
|
||||||
Description: "X-Amz-Expires must be less than a week (in seconds); that is, the given X-Amz-Expires must be less than 604800 seconds",
|
Description: "X-Amz-Expires must be less than a week (in seconds); that is, the given X-Amz-Expires must be less than 604800 seconds",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user