Implementing min-free-disk

This commit is contained in:
Harshavardhana
2015-10-17 19:17:33 -07:00
parent 18a6d7ea5d
commit 5b2fa33bdb
20 changed files with 710 additions and 630 deletions

View File

@@ -71,11 +71,7 @@ const (
AuthorizationHeaderMalformed
MalformedPOSTRequest
BucketNotEmpty
)
// Error codes, non exhaustive list - standard HTTP errors
const (
NotAcceptable = iota + 31
RootPathFull
)
// APIError code to Error structure map
@@ -205,11 +201,6 @@ var errorCodeResponse = map[int]APIError{
Description: "The specified method is not allowed against this resource.",
HTTPStatusCode: http.StatusMethodNotAllowed,
},
NotAcceptable: {
Code: "NotAcceptable",
Description: "The requested resource is only capable of generating content not acceptable according to the Accept headers sent in the request.",
HTTPStatusCode: http.StatusNotAcceptable,
},
InvalidPart: {
Code: "InvalidPart",
Description: "One or more of the specified parts could not be found.",
@@ -235,6 +226,11 @@ var errorCodeResponse = map[int]APIError{
Description: "The bucket you tried to delete is not empty.",
HTTPStatusCode: http.StatusConflict,
},
RootPathFull: {
Code: "RootPathFull",
Description: "Root path has reached its minimum free disk threshold. Please clear few objects to proceed.",
HTTPStatusCode: http.StatusInternalServerError,
},
}
// errorCodeError provides errorCode to Error. It returns empty if the code provided is unknown