| 
									
										
										
										
											2017-03-17 03:21:58 +08:00
										 |  |  | /* | 
					
						
							|  |  |  |  * Minio Cloud Storage, (C) 2017 Minio, Inc. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Licensed under the Apache License, Version 2.0 (the "License"); | 
					
						
							|  |  |  |  * you may not use this file except in compliance with the License. | 
					
						
							|  |  |  |  * You may obtain a copy of the License at | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *     http://www.apache.org/licenses/LICENSE-2.0
 | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Unless required by applicable law or agreed to in writing, software | 
					
						
							|  |  |  |  * distributed under the License is distributed on an "AS IS" BASIS, | 
					
						
							|  |  |  |  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
					
						
							|  |  |  |  * See the License for the specific language governing permissions and | 
					
						
							|  |  |  |  * limitations under the License. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | package cmd | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-22 13:30:34 +08:00
										 |  |  | import ( | 
					
						
							| 
									
										
										
										
											2018-03-15 09:36:54 +08:00
										 |  |  | 	"context" | 
					
						
							| 
									
										
										
										
											2018-01-13 12:34:52 +08:00
										 |  |  | 	"time" | 
					
						
							| 
									
										
										
										
											2017-11-23 04:12:10 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-06 06:04:40 +08:00
										 |  |  | 	"github.com/minio/minio/cmd/logger" | 
					
						
							| 
									
										
										
										
											2017-10-22 13:30:34 +08:00
										 |  |  | 	"github.com/minio/minio/pkg/hash" | 
					
						
							| 
									
										
										
										
											2018-01-23 06:54:55 +08:00
										 |  |  | 	"github.com/minio/minio/pkg/madmin" | 
					
						
							| 
									
										
										
										
											2018-04-25 06:53:30 +08:00
										 |  |  | 	"github.com/minio/minio/pkg/policy" | 
					
						
							| 
									
										
										
										
											2017-10-22 13:30:34 +08:00
										 |  |  | ) | 
					
						
							| 
									
										
										
										
											2017-10-10 07:41:35 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-06 09:58:09 +08:00
										 |  |  | // GatewayUnsupported list of unsupported call stubs for gateway.
 | 
					
						
							|  |  |  | type GatewayUnsupported struct{} | 
					
						
							| 
									
										
										
										
											2017-10-10 07:41:35 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-23 04:12:10 +08:00
										 |  |  | // ListMultipartUploads lists all multipart uploads.
 | 
					
						
							| 
									
										
										
										
											2018-03-15 09:36:54 +08:00
										 |  |  | func (a GatewayUnsupported) ListMultipartUploads(ctx context.Context, bucket string, prefix string, keyMarker string, uploadIDMarker string, delimiter string, maxUploads int) (lmi ListMultipartsInfo, err error) { | 
					
						
							| 
									
										
										
										
											2018-04-06 06:04:40 +08:00
										 |  |  | 	logger.LogIf(ctx, NotImplemented{}) | 
					
						
							|  |  |  | 	return lmi, NotImplemented{} | 
					
						
							| 
									
										
										
										
											2017-11-23 04:12:10 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // NewMultipartUpload upload object in multiple parts
 | 
					
						
							| 
									
										
										
										
											2018-03-15 09:36:54 +08:00
										 |  |  | func (a GatewayUnsupported) NewMultipartUpload(ctx context.Context, bucket string, object string, metadata map[string]string) (uploadID string, err error) { | 
					
						
							| 
									
										
										
										
											2018-04-06 06:04:40 +08:00
										 |  |  | 	logger.LogIf(ctx, NotImplemented{}) | 
					
						
							|  |  |  | 	return "", NotImplemented{} | 
					
						
							| 
									
										
										
										
											2017-11-23 04:12:10 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-23 06:54:55 +08:00
										 |  |  | // CopyObjectPart copy part of object to uploadID for another object
 | 
					
						
							| 
									
										
										
										
											2018-03-15 09:36:54 +08:00
										 |  |  | func (a GatewayUnsupported) CopyObjectPart(ctx context.Context, srcBucket, srcObject, destBucket, destObject, uploadID string, partID int, startOffset, length int64, srcInfo ObjectInfo) (pi PartInfo, err error) { | 
					
						
							| 
									
										
										
										
											2018-04-06 06:04:40 +08:00
										 |  |  | 	logger.LogIf(ctx, NotImplemented{}) | 
					
						
							|  |  |  | 	return pi, NotImplemented{} | 
					
						
							| 
									
										
										
										
											2017-12-06 09:58:09 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-23 04:12:10 +08:00
										 |  |  | // PutObjectPart puts a part of object in bucket
 | 
					
						
							| 
									
										
										
										
											2018-03-15 09:36:54 +08:00
										 |  |  | func (a GatewayUnsupported) PutObjectPart(ctx context.Context, bucket string, object string, uploadID string, partID int, data *hash.Reader) (pi PartInfo, err error) { | 
					
						
							| 
									
										
										
										
											2018-04-06 06:04:40 +08:00
										 |  |  | 	logger.LogIf(ctx, NotImplemented{}) | 
					
						
							|  |  |  | 	return pi, NotImplemented{} | 
					
						
							| 
									
										
										
										
											2017-11-23 04:12:10 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // ListObjectParts returns all object parts for specified object in specified bucket
 | 
					
						
							| 
									
										
										
										
											2018-03-15 09:36:54 +08:00
										 |  |  | func (a GatewayUnsupported) ListObjectParts(ctx context.Context, bucket string, object string, uploadID string, partNumberMarker int, maxParts int) (lpi ListPartsInfo, err error) { | 
					
						
							| 
									
										
										
										
											2018-04-06 06:04:40 +08:00
										 |  |  | 	logger.LogIf(ctx, NotImplemented{}) | 
					
						
							|  |  |  | 	return lpi, NotImplemented{} | 
					
						
							| 
									
										
										
										
											2017-11-23 04:12:10 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // AbortMultipartUpload aborts a ongoing multipart upload
 | 
					
						
							| 
									
										
										
										
											2018-03-15 09:36:54 +08:00
										 |  |  | func (a GatewayUnsupported) AbortMultipartUpload(ctx context.Context, bucket string, object string, uploadID string) error { | 
					
						
							| 
									
										
										
										
											2018-04-06 06:04:40 +08:00
										 |  |  | 	logger.LogIf(ctx, NotImplemented{}) | 
					
						
							|  |  |  | 	return NotImplemented{} | 
					
						
							| 
									
										
										
										
											2017-11-23 04:12:10 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // CompleteMultipartUpload completes ongoing multipart upload and finalizes object
 | 
					
						
							| 
									
										
										
										
											2018-03-15 09:36:54 +08:00
										 |  |  | func (a GatewayUnsupported) CompleteMultipartUpload(ctx context.Context, bucket string, object string, uploadID string, uploadedParts []CompletePart) (oi ObjectInfo, err error) { | 
					
						
							| 
									
										
										
										
											2018-04-06 06:04:40 +08:00
										 |  |  | 	logger.LogIf(ctx, NotImplemented{}) | 
					
						
							|  |  |  | 	return oi, NotImplemented{} | 
					
						
							| 
									
										
										
										
											2017-11-23 04:12:10 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-10 07:19:30 +08:00
										 |  |  | // SetBucketPolicy sets policy on bucket
 | 
					
						
							| 
									
										
										
										
											2018-04-25 06:53:30 +08:00
										 |  |  | func (a GatewayUnsupported) SetBucketPolicy(ctx context.Context, bucket string, bucketPolicy *policy.Policy) error { | 
					
						
							| 
									
										
										
										
											2018-04-06 06:04:40 +08:00
										 |  |  | 	logger.LogIf(ctx, NotImplemented{}) | 
					
						
							|  |  |  | 	return NotImplemented{} | 
					
						
							| 
									
										
										
										
											2017-11-23 04:12:10 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-10 07:19:30 +08:00
										 |  |  | // GetBucketPolicy will get policy on bucket
 | 
					
						
							| 
									
										
										
										
											2018-04-25 06:53:30 +08:00
										 |  |  | func (a GatewayUnsupported) GetBucketPolicy(ctx context.Context, bucket string) (bucketPolicy *policy.Policy, err error) { | 
					
						
							| 
									
										
										
										
											2018-04-06 06:04:40 +08:00
										 |  |  | 	logger.LogIf(ctx, NotImplemented{}) | 
					
						
							| 
									
										
										
										
											2018-04-25 06:53:30 +08:00
										 |  |  | 	return nil, NotImplemented{} | 
					
						
							| 
									
										
										
										
											2017-11-23 04:12:10 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-10 07:19:30 +08:00
										 |  |  | // DeleteBucketPolicy deletes all policies on bucket
 | 
					
						
							| 
									
										
										
										
											2018-03-15 09:36:54 +08:00
										 |  |  | func (a GatewayUnsupported) DeleteBucketPolicy(ctx context.Context, bucket string) error { | 
					
						
							| 
									
										
										
										
											2018-04-06 06:04:40 +08:00
										 |  |  | 	logger.LogIf(ctx, NotImplemented{}) | 
					
						
							|  |  |  | 	return NotImplemented{} | 
					
						
							| 
									
										
										
										
											2017-11-26 03:58:29 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-10 01:25:41 +08:00
										 |  |  | // ReloadFormat - Not implemented stub.
 | 
					
						
							|  |  |  | func (a GatewayUnsupported) ReloadFormat(ctx context.Context, dryRun bool) error { | 
					
						
							|  |  |  | 	return NotImplemented{} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-16 09:45:57 +08:00
										 |  |  | // HealFormat - Not implemented stub
 | 
					
						
							| 
									
										
										
										
											2018-03-15 09:36:54 +08:00
										 |  |  | func (a GatewayUnsupported) HealFormat(ctx context.Context, dryRun bool) (madmin.HealResultItem, error) { | 
					
						
							| 
									
										
										
										
											2018-04-06 06:04:40 +08:00
										 |  |  | 	logger.LogIf(ctx, NotImplemented{}) | 
					
						
							|  |  |  | 	return madmin.HealResultItem{}, NotImplemented{} | 
					
						
							| 
									
										
										
										
											2018-02-16 09:45:57 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-06 09:58:09 +08:00
										 |  |  | // HealBucket - Not implemented stub
 | 
					
						
							| 
									
										
										
										
											2018-03-15 09:36:54 +08:00
										 |  |  | func (a GatewayUnsupported) HealBucket(ctx context.Context, bucket string, dryRun bool) ([]madmin.HealResultItem, error) { | 
					
						
							| 
									
										
										
										
											2018-04-06 06:04:40 +08:00
										 |  |  | 	logger.LogIf(ctx, NotImplemented{}) | 
					
						
							|  |  |  | 	return nil, NotImplemented{} | 
					
						
							| 
									
										
										
										
											2017-03-17 03:21:58 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-06 09:58:09 +08:00
										 |  |  | // ListBucketsHeal - Not implemented stub
 | 
					
						
							| 
									
										
										
										
											2018-03-15 09:36:54 +08:00
										 |  |  | func (a GatewayUnsupported) ListBucketsHeal(ctx context.Context) (buckets []BucketInfo, err error) { | 
					
						
							| 
									
										
										
										
											2018-04-06 06:04:40 +08:00
										 |  |  | 	logger.LogIf(ctx, NotImplemented{}) | 
					
						
							|  |  |  | 	return nil, NotImplemented{} | 
					
						
							| 
									
										
										
										
											2017-03-17 03:21:58 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-06 09:58:09 +08:00
										 |  |  | // HealObject - Not implemented stub
 | 
					
						
							| 
									
										
										
										
											2018-03-15 09:36:54 +08:00
										 |  |  | func (a GatewayUnsupported) HealObject(ctx context.Context, bucket, object string, dryRun bool) (h madmin.HealResultItem, e error) { | 
					
						
							| 
									
										
										
										
											2018-04-06 06:04:40 +08:00
										 |  |  | 	logger.LogIf(ctx, NotImplemented{}) | 
					
						
							|  |  |  | 	return h, NotImplemented{} | 
					
						
							| 
									
										
										
										
											2017-03-17 03:21:58 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-06 09:58:09 +08:00
										 |  |  | // ListObjectsV2 - Not implemented stub
 | 
					
						
							| 
									
										
										
										
											2018-03-15 09:36:54 +08:00
										 |  |  | func (a GatewayUnsupported) ListObjectsV2(ctx context.Context, bucket, prefix, continuationToken, delimiter string, maxKeys int, fetchOwner bool, startAfter string) (result ListObjectsV2Info, err error) { | 
					
						
							| 
									
										
										
										
											2018-04-06 06:04:40 +08:00
										 |  |  | 	logger.LogIf(ctx, NotImplemented{}) | 
					
						
							|  |  |  | 	return result, NotImplemented{} | 
					
						
							| 
									
										
										
										
											2017-11-23 04:12:10 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-06 09:58:09 +08:00
										 |  |  | // ListObjectsHeal - Not implemented stub
 | 
					
						
							| 
									
										
										
										
											2018-03-15 09:36:54 +08:00
										 |  |  | func (a GatewayUnsupported) ListObjectsHeal(ctx context.Context, bucket, prefix, marker, delimiter string, maxKeys int) (loi ListObjectsInfo, e error) { | 
					
						
							| 
									
										
										
										
											2018-04-06 06:04:40 +08:00
										 |  |  | 	logger.LogIf(ctx, NotImplemented{}) | 
					
						
							|  |  |  | 	return loi, NotImplemented{} | 
					
						
							| 
									
										
										
										
											2017-03-17 03:21:58 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-23 04:12:10 +08:00
										 |  |  | // CopyObject copies a blob from source container to destination container.
 | 
					
						
							| 
									
										
										
										
											2018-03-15 09:36:54 +08:00
										 |  |  | func (a GatewayUnsupported) CopyObject(ctx context.Context, srcBucket string, srcObject string, destBucket string, destObject string, | 
					
						
							| 
									
										
										
										
											2018-02-21 16:48:47 +08:00
										 |  |  | 	srcInfo ObjectInfo) (objInfo ObjectInfo, err error) { | 
					
						
							| 
									
										
										
										
											2018-04-06 06:04:40 +08:00
										 |  |  | 	logger.LogIf(ctx, NotImplemented{}) | 
					
						
							|  |  |  | 	return objInfo, NotImplemented{} | 
					
						
							| 
									
										
										
										
											2017-11-23 04:12:10 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2018-01-13 12:34:52 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | // Locking operations
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // ListLocks lists namespace locks held in object layer
 | 
					
						
							| 
									
										
										
										
											2018-03-15 09:36:54 +08:00
										 |  |  | func (a GatewayUnsupported) ListLocks(ctx context.Context, bucket, prefix string, duration time.Duration) ([]VolumeLockInfo, error) { | 
					
						
							| 
									
										
										
										
											2018-04-06 06:04:40 +08:00
										 |  |  | 	logger.LogIf(ctx, NotImplemented{}) | 
					
						
							|  |  |  | 	return []VolumeLockInfo{}, NotImplemented{} | 
					
						
							| 
									
										
										
										
											2018-01-13 12:34:52 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // ClearLocks clears namespace locks held in object layer
 | 
					
						
							| 
									
										
										
										
											2018-03-15 09:36:54 +08:00
										 |  |  | func (a GatewayUnsupported) ClearLocks(ctx context.Context, info []VolumeLockInfo) error { | 
					
						
							| 
									
										
										
										
											2018-04-06 06:04:40 +08:00
										 |  |  | 	logger.LogIf(ctx, NotImplemented{}) | 
					
						
							|  |  |  | 	return NotImplemented{} | 
					
						
							| 
									
										
										
										
											2018-01-13 12:34:52 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2018-02-10 07:19:30 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | // RefreshBucketPolicy refreshes cache policy with what's on disk.
 | 
					
						
							| 
									
										
										
										
											2018-03-15 09:36:54 +08:00
										 |  |  | func (a GatewayUnsupported) RefreshBucketPolicy(ctx context.Context, bucket string) error { | 
					
						
							| 
									
										
										
										
											2018-04-06 06:04:40 +08:00
										 |  |  | 	logger.LogIf(ctx, NotImplemented{}) | 
					
						
							|  |  |  | 	return NotImplemented{} | 
					
						
							| 
									
										
										
										
											2018-02-10 07:19:30 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // IsNotificationSupported returns whether bucket notification is applicable for this layer.
 | 
					
						
							|  |  |  | func (a GatewayUnsupported) IsNotificationSupported() bool { | 
					
						
							|  |  |  | 	return false | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // IsEncryptionSupported returns whether server side encryption is applicable for this layer.
 | 
					
						
							|  |  |  | func (a GatewayUnsupported) IsEncryptionSupported() bool { | 
					
						
							|  |  |  | 	return false | 
					
						
							|  |  |  | } |