Generalize replication target management so that remote targets for a bucket can be managed with ARNs. `mc admin bucket remote` command will be used to manage targets.
Showing the changes to cmd/api-errors.go (1 of 15 files). Show all
Unified · Split
| @@ -108,6 +108,11 @@ const ( · 107 unmodified lines | |||
| 108 | ErrReplicationConfigurationNotFoundError | 108 | ErrReplicationConfigurationNotFoundError |
| 109 | ErrReplicationDestinationNotFoundError | 109 | ErrReplicationDestinationNotFoundError |
| 110 | ErrReplicationTargetNotFoundError | 110 | ErrReplicationTargetNotFoundError |
| 111 | ErrBucketRemoteIdenticalToSource | ||
| 112 | ErrBucketRemoteAlreadyExists | ||
| 113 | ErrBucketRemoteArnTypeInvalid | ||
| 114 | ErrBucketRemoteArnInvalid | ||
| 115 | ErrBucketRemoteRemoveDisallowed | ||
| 111 | ErrReplicationTargetNotVersionedError | 116 | ErrReplicationTargetNotVersionedError |
| 112 | ErrReplicationNeedsVersioningError | 117 | ErrReplicationNeedsVersioningError |
| 113 | ErrReplicationBucketNeedsVersioningError | 118 | ErrReplicationBucketNeedsVersioningError |
| @@ -826,14 +831,39 @@ var errorCodes = errorCodeMap{ · 712 unmodified lines | |||
| 826 | HTTPStatusCode: http.StatusNotFound, | 831 | HTTPStatusCode: http.StatusNotFound, |
| 827 | }, | 832 | }, |
| 828 | ErrReplicationTargetNotFoundError: { | 833 | ErrReplicationTargetNotFoundError: { |
| 829 | Code: "ReplicationTargetNotFoundError", | 834 | Code: "XminioAdminReplicationTargetNotFoundError", |
| 830 | Description: "The replication target does not exist", | 835 | Description: "The replication target does not exist", |
| 831 | HTTPStatusCode: http.StatusNotFound, | 836 | HTTPStatusCode: http.StatusNotFound, |
| 832 | }, | 837 | }, |
| 838 | ErrBucketRemoteIdenticalToSource: { | ||
| 839 | Code: "XminioAdminRemoteIdenticalToSource", | ||
| 840 | Description: "The remote target cannot be identical to source", | ||
| 841 | HTTPStatusCode: http.StatusBadRequest, | ||
| 842 | }, | ||
| 843 | ErrBucketRemoteAlreadyExists: { | ||
| 844 | Code: "XminioAdminBucketRemoteAlreadyExists", | ||
| 845 | Description: "The remote target already exists", | ||
| 846 | HTTPStatusCode: http.StatusBadRequest, | ||
| 847 | }, | ||
| 848 | ErrBucketRemoteRemoveDisallowed: { | ||
| 849 | Code: "XMinioAdminRemoteRemoveDisallowed", | ||
| 850 | Description: "Replication configuration exists with this ARN.", | ||
| 851 | HTTPStatusCode: http.StatusBadRequest, | ||
| 852 | }, | ||
| 853 | ErrBucketRemoteArnTypeInvalid: { | ||
| 854 | Code: "XMinioAdminRemoteARNTypeInvalid", | ||
| 855 | Description: "The bucket remote ARN type is not valid", | ||
| 856 | HTTPStatusCode: http.StatusBadRequest, | ||
| 857 | }, | ||
| 858 | ErrBucketRemoteArnInvalid: { | ||
| 859 | Code: "XMinioAdminRemoteArnInvalid", | ||
| 860 | Description: "The bucket remote ARN does not have correct format", | ||
| 861 | HTTPStatusCode: http.StatusBadRequest, | ||
| 862 | }, | ||
| 833 | ErrReplicationTargetNotVersionedError: { | 863 | ErrReplicationTargetNotVersionedError: { |
| 834 | Code: "ReplicationTargetNotVersionedError", | 864 | Code: "ReplicationTargetNotVersionedError", |
| 835 | Description: "The replication target does not have versioning enabled", | 865 | Description: "The replication target does not have versioning enabled", |
| 836 | HTTPStatusCode: http.StatusNotFound, | 866 | HTTPStatusCode: http.StatusBadRequest, |
| 837 | }, | 867 | }, |
| 838 | ErrReplicationNeedsVersioningError: { | 868 | ErrReplicationNeedsVersioningError: { |
| 839 | Code: "InvalidRequest", | 869 | Code: "InvalidRequest", |
| @@ -1879,8 +1909,16 @@ func toAPIErrorCode(ctx context.Context, err error) (apiErr APIErrorCode) { · 1039 unmodified lines | |||
| 1879 | apiErr = ErrReplicationConfigurationNotFoundError | 1909 | apiErr = ErrReplicationConfigurationNotFoundError |
| 1880 | case BucketReplicationDestinationNotFound: | 1910 | case BucketReplicationDestinationNotFound: |
| 1881 | apiErr = ErrReplicationDestinationNotFoundError | 1911 | apiErr = ErrReplicationDestinationNotFoundError |
| 1882 | case BucketReplicationTargetNotFound: | 1912 | case BucketRemoteTargetNotFound: |
| 1883 | apiErr = ErrReplicationTargetNotFoundError | 1913 | apiErr = ErrReplicationTargetNotFoundError |
| 1914 | case BucketRemoteAlreadyExists: | ||
| 1915 | apiErr = ErrBucketRemoteAlreadyExists | ||
| 1916 | case BucketRemoteArnTypeInvalid: | ||
| 1917 | apiErr = ErrBucketRemoteArnTypeInvalid | ||
| 1918 | case BucketRemoteArnInvalid: | ||
| 1919 | apiErr = ErrBucketRemoteArnInvalid | ||
| 1920 | case BucketRemoteRemoveDisallowed: | ||
| 1921 | apiErr = ErrBucketRemoteRemoveDisallowed | ||
| 1884 | case BucketReplicationTargetNotVersioned: | 1922 | case BucketReplicationTargetNotVersioned: |
| 1885 | apiErr = ErrReplicationTargetNotVersionedError | 1923 | apiErr = ErrReplicationTargetNotVersionedError |
| 1886 | case BucketQuotaExceeded: | 1924 | case BucketQuotaExceeded: |