History

Move admin APIs to new path and add redesigned heal APIs (#5351)

- Changes related to moving admin APIs - admin APIs now have an endpoint under /minio/admin - admin APIs are now versioned - a new API to server the version is added at "GET /minio/admin/version" and all API operations have the path prefix /minio/admin/v1/<operation> - new service stop API added - credentials change API is moved to /minio/admin/v1/config/credential - credentials change API and configuration get/set API now require TLS so that credentials are protected - all API requests now receive JSON - heal APIs are disabled as they will be changed substantially - Heal API changes Heal API is now provided at a single endpoint with the ability for a client to start a heal sequence on all the data in the server, a single bucket, or under a prefix within a bucket. When a heal sequence is started, the server returns a unique token that needs to be used for subsequent 'status' requests to fetch heal results. On each status request from the client, the server returns heal result records that it has accumulated since the previous status request. The server accumulates upto 1000 records and pauses healing further objects until the client requests for status. If the client does not request any further records for a long time, the server aborts the heal sequence automatically. A heal result record is returned for each entity healed on the server, such as system metadata, object metadata, buckets and objects, and has information about the before and after states on each disk. A client may request to force restart a heal sequence - this causes the running heal sequence to be aborted at the next safe spot and starts a new heal sequence.

Aditya Manthramurthy committed 8 years ago

Commit a337ea41 parent f3f09ed43 files · +2375 −2280Browse files

Showing the changes to cmd/api-errors.go (1 of 43 files). Show all

Unified · Split

cmd/api-errors.go+49−7
@@ -41,8 +41,8 @@ type APIErrorResponse struct { · 40 unmodified lines
4141 Key string
4242 BucketName string
4343 Resource string
44− RequestID string `xml:"RequestId"`
45− HostID string `xml:"HostId"`
44+ RequestID string `xml:"RequestId" json:"RequestId"`
45+ HostID string `xml:"HostId" json:"HostId"`
4646 }
4747
4848 // APIErrorCode type of error status.
@@ -158,6 +158,7 @@ const ( · 109 unmodified lines
158158 ErrReadQuorum
159159 ErrWriteQuorum
160160 ErrStorageFull
161+ ErrRequestBodyParse
161162 ErrObjectExistsAsDirectory
162163 ErrPolicyNesting
163164 ErrInvalidObjectName
@@ -174,6 +175,7 @@ const ( · 10 unmodified lines
174175 // Please open a https://github.com/minio/minio/issues before adding
175176 // new error codes here.
176177
178+ ErrMalformedJSON
177179 ErrAdminInvalidAccessKey
178180 ErrAdminInvalidSecretKey
179181 ErrAdminConfigNoQuorum
@@ -183,6 +185,11 @@ const ( · 3 unmodified lines
183185 ErrInsecureClientRequest
184186 ErrObjectTampered
185187 ErrHealNotImplemented
188+ ErrHealNoSuchProcess
189+ ErrHealInvalidClientToken
190+ ErrHealMissingBucket
191+ ErrHealAlreadyRunning
192+ ErrHealOverlappingPaths
186193 )
187194
188195 // error code to APIError structure, these fields carry respective
@@ -673,6 +680,11 @@ var errorCodeResponse = map[APIErrorCode]APIError{ · 484 unmodified lines
673680 Description: "Storage backend has reached its minimum free disk threshold. Please delete a few objects to proceed.",
674681 HTTPStatusCode: http.StatusInternalServerError,
675682 },
683+ ErrRequestBodyParse: {
684+ Code: "XMinioRequestBodyParse",
685+ Description: "The request body failed to parse.",
686+ HTTPStatusCode: http.StatusBadRequest,
687+ },
676688 ErrObjectExistsAsDirectory: {
677689 Code: "XMinioObjectExistsAsDirectory",
678690 Description: "Object name already exists as a directory.",
@@ -708,6 +720,11 @@ var errorCodeResponse = map[APIErrorCode]APIError{ · 29 unmodified lines
708720 Description: "Server not initialized, please try again.",
709721 HTTPStatusCode: http.StatusServiceUnavailable,
710722 },
723+ ErrMalformedJSON: {
724+ Code: "XMinioMalformedJSON",
725+ Description: "The JSON you provided was not well-formed or did not validate against our published format.",
726+ HTTPStatusCode: http.StatusBadRequest,
727+ },
711728 ErrAdminInvalidAccessKey: {
712729 Code: "XMinioAdminInvalidAccessKey",
713730 Description: "The access key is invalid.",
@@ -764,11 +781,6 @@ var errorCodeResponse = map[APIErrorCode]APIError{ · 50 unmodified lines
764781 Description: errObjectTampered.Error(),
765782 HTTPStatusCode: http.StatusPartialContent,
766783 },
767− ErrHealNotImplemented: {
768− Code: "XMinioHealNotImplemented",
769− Description: "This server does not implement heal functionality.",
770− HTTPStatusCode: http.StatusBadRequest,
771− },
772784 ErrMaximumExpires: {
773785 Code: "AuthorizationQueryParametersError",
774786 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",
@@ -782,6 +794,36 @@ var errorCodeResponse = map[APIErrorCode]APIError{ · 7 unmodified lines
782794 Description: "Invalid Request",
783795 HTTPStatusCode: http.StatusBadRequest,
784796 },
797+ ErrHealNotImplemented: {
798+ Code: "XMinioHealNotImplemented",
799+ Description: "This server does not implement heal functionality.",
800+ HTTPStatusCode: http.StatusBadRequest,
801+ },
802+ ErrHealNoSuchProcess: {
803+ Code: "XMinioHealNoSuchProcess",
804+ Description: "No such heal process is running on the server",
805+ HTTPStatusCode: http.StatusBadRequest,
806+ },
807+ ErrHealInvalidClientToken: {
808+ Code: "XMinioHealInvalidClientToken",
809+ Description: "Client token mismatch",
810+ HTTPStatusCode: http.StatusBadRequest,
811+ },
812+ ErrHealMissingBucket: {
813+ Code: "XMinioHealMissingBucket",
814+ Description: "A heal start request with a non-empty object-prefix parameter requires a bucket to be specified.",
815+ HTTPStatusCode: http.StatusBadRequest,
816+ },
817+ ErrHealAlreadyRunning: {
818+ Code: "XMinioHealAlreadyRunning",
819+ Description: "",
820+ HTTPStatusCode: http.StatusBadRequest,
821+ },
822+ ErrHealOverlappingPaths: {
823+ Code: "XMinioHealOverlappingPaths",
824+ Description: "",
825+ HTTPStatusCode: http.StatusBadRequest,
826+ },
785827
786828 // Add your error structure here.
787829 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t