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
41 Key string41 Key string
42 BucketName string42 BucketName string
43 Resource string43 Resource string
44 RequestID string `xml:"RequestId"`44 RequestID string `xml:"RequestId" json:"RequestId"`
45 HostID string `xml:"HostId"`45 HostID string `xml:"HostId" json:"HostId"`
46}46}
47 47
48// APIErrorCode type of error status.48// APIErrorCode type of error status.
@@ -158,6 +158,7 @@ const ( · 109 unmodified lines
158 ErrReadQuorum158 ErrReadQuorum
159 ErrWriteQuorum159 ErrWriteQuorum
160 ErrStorageFull160 ErrStorageFull
161 ErrRequestBodyParse
161 ErrObjectExistsAsDirectory162 ErrObjectExistsAsDirectory
162 ErrPolicyNesting163 ErrPolicyNesting
163 ErrInvalidObjectName164 ErrInvalidObjectName
@@ -174,6 +175,7 @@ const ( · 10 unmodified lines
174 // Please open a https://github.com/minio/minio/issues before adding175 // Please open a https://github.com/minio/minio/issues before adding
175 // new error codes here.176 // new error codes here.
176 177
178 ErrMalformedJSON
177 ErrAdminInvalidAccessKey179 ErrAdminInvalidAccessKey
178 ErrAdminInvalidSecretKey180 ErrAdminInvalidSecretKey
179 ErrAdminConfigNoQuorum181 ErrAdminConfigNoQuorum
@@ -183,6 +185,11 @@ const ( · 3 unmodified lines
183 ErrInsecureClientRequest185 ErrInsecureClientRequest
184 ErrObjectTampered186 ErrObjectTampered
185 ErrHealNotImplemented187 ErrHealNotImplemented
188 ErrHealNoSuchProcess
189 ErrHealInvalidClientToken
190 ErrHealMissingBucket
191 ErrHealAlreadyRunning
192 ErrHealOverlappingPaths
186)193)
187 194
188// error code to APIError structure, these fields carry respective195// error code to APIError structure, these fields carry respective
@@ -673,6 +680,11 @@ var errorCodeResponse = map[APIErrorCode]APIError{ · 484 unmodified lines
673 Description: "Storage backend has reached its minimum free disk threshold. Please delete a few objects to proceed.",680 Description: "Storage backend has reached its minimum free disk threshold. Please delete a few objects to proceed.",
674 HTTPStatusCode: http.StatusInternalServerError,681 HTTPStatusCode: http.StatusInternalServerError,
675 },682 },
683 ErrRequestBodyParse: {
684 Code: "XMinioRequestBodyParse",
685 Description: "The request body failed to parse.",
686 HTTPStatusCode: http.StatusBadRequest,
687 },
676 ErrObjectExistsAsDirectory: {688 ErrObjectExistsAsDirectory: {
677 Code: "XMinioObjectExistsAsDirectory",689 Code: "XMinioObjectExistsAsDirectory",
678 Description: "Object name already exists as a directory.",690 Description: "Object name already exists as a directory.",
@@ -708,6 +720,11 @@ var errorCodeResponse = map[APIErrorCode]APIError{ · 29 unmodified lines
708 Description: "Server not initialized, please try again.",720 Description: "Server not initialized, please try again.",
709 HTTPStatusCode: http.StatusServiceUnavailable,721 HTTPStatusCode: http.StatusServiceUnavailable,
710 },722 },
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 },
711 ErrAdminInvalidAccessKey: {728 ErrAdminInvalidAccessKey: {
712 Code: "XMinioAdminInvalidAccessKey",729 Code: "XMinioAdminInvalidAccessKey",
713 Description: "The access key is invalid.",730 Description: "The access key is invalid.",
@@ -764,11 +781,6 @@ var errorCodeResponse = map[APIErrorCode]APIError{ · 50 unmodified lines
764 Description: errObjectTampered.Error(),781 Description: errObjectTampered.Error(),
765 HTTPStatusCode: http.StatusPartialContent,782 HTTPStatusCode: http.StatusPartialContent,
766 },783 },
767 ErrHealNotImplemented: {
768 Code: "XMinioHealNotImplemented",
769 Description: "This server does not implement heal functionality.",
770 HTTPStatusCode: http.StatusBadRequest,
771 },
772 ErrMaximumExpires: {784 ErrMaximumExpires: {
773 Code: "AuthorizationQueryParametersError",785 Code: "AuthorizationQueryParametersError",
774 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",786 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
782 Description: "Invalid Request",794 Description: "Invalid Request",
783 HTTPStatusCode: http.StatusBadRequest,795 HTTPStatusCode: http.StatusBadRequest,
784 },796 },
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 },
785 827
786 // Add your error structure here.828 // Add your error structure here.
787}829}

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