- 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.
Showing the changes to cmd/api-errors.go (1 of 43 files). Show all
Unified · Split
| @@ -41,8 +41,8 @@ type APIErrorResponse struct { · 40 unmodified lines | ||
| 41 | 41 | Key string |
| 42 | 42 | BucketName string |
| 43 | 43 | 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"` | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | // APIErrorCode type of error status. |
| @@ -158,6 +158,7 @@ const ( · 109 unmodified lines | ||
| 158 | 158 | ErrReadQuorum |
| 159 | 159 | ErrWriteQuorum |
| 160 | 160 | ErrStorageFull |
| 161 | + ErrRequestBodyParse | |
| 161 | 162 | ErrObjectExistsAsDirectory |
| 162 | 163 | ErrPolicyNesting |
| 163 | 164 | ErrInvalidObjectName |
| @@ -174,6 +175,7 @@ const ( · 10 unmodified lines | ||
| 174 | 175 | // Please open a https://github.com/minio/minio/issues before adding |
| 175 | 176 | // new error codes here. |
| 176 | 177 | |
| 178 | + ErrMalformedJSON | |
| 177 | 179 | ErrAdminInvalidAccessKey |
| 178 | 180 | ErrAdminInvalidSecretKey |
| 179 | 181 | ErrAdminConfigNoQuorum |
| @@ -183,6 +185,11 @@ const ( · 3 unmodified lines | ||
| 183 | 185 | ErrInsecureClientRequest |
| 184 | 186 | ErrObjectTampered |
| 185 | 187 | ErrHealNotImplemented |
| 188 | + ErrHealNoSuchProcess | |
| 189 | + ErrHealInvalidClientToken | |
| 190 | + ErrHealMissingBucket | |
| 191 | + ErrHealAlreadyRunning | |
| 192 | + ErrHealOverlappingPaths | |
| 186 | 193 | ) |
| 187 | 194 | |
| 188 | 195 | // error code to APIError structure, these fields carry respective |
| @@ -673,6 +680,11 @@ var errorCodeResponse = map[APIErrorCode]APIError{ · 484 unmodified lines | ||
| 673 | 680 | Description: "Storage backend has reached its minimum free disk threshold. Please delete a few objects to proceed.", |
| 674 | 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 | 688 | ErrObjectExistsAsDirectory: { |
| 677 | 689 | Code: "XMinioObjectExistsAsDirectory", |
| 678 | 690 | Description: "Object name already exists as a directory.", |
| @@ -708,6 +720,11 @@ var errorCodeResponse = map[APIErrorCode]APIError{ · 29 unmodified lines | ||
| 708 | 720 | Description: "Server not initialized, please try again.", |
| 709 | 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 | 728 | ErrAdminInvalidAccessKey: { |
| 712 | 729 | Code: "XMinioAdminInvalidAccessKey", |
| 713 | 730 | Description: "The access key is invalid.", |
| @@ -764,11 +781,6 @@ var errorCodeResponse = map[APIErrorCode]APIError{ · 50 unmodified lines | ||
| 764 | 781 | Description: errObjectTampered.Error(), |
| 765 | 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 | 784 | ErrMaximumExpires: { |
| 773 | 785 | Code: "AuthorizationQueryParametersError", |
| 774 | 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 | 794 | Description: "Invalid Request", |
| 783 | 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 | 828 | // Add your error structure here. |
| 787 | 829 | } |