2017-03-16 15:21:58 -04: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 01:30:34 -04:00
|
|
|
import (
|
2017-11-22 15:12:10 -05:00
|
|
|
"io"
|
2018-01-12 23:34:52 -05:00
|
|
|
"time"
|
2017-11-22 15:12:10 -05:00
|
|
|
|
|
|
|
"github.com/minio/minio-go/pkg/policy"
|
2017-11-25 14:58:29 -05:00
|
|
|
"github.com/minio/minio/pkg/errors"
|
2017-10-22 01:30:34 -04:00
|
|
|
"github.com/minio/minio/pkg/hash"
|
|
|
|
)
|
2017-10-09 19:41:35 -04:00
|
|
|
|
2017-12-05 20:58:09 -05:00
|
|
|
// GatewayUnsupported list of unsupported call stubs for gateway.
|
|
|
|
type GatewayUnsupported struct{}
|
2017-10-09 19:41:35 -04:00
|
|
|
|
2017-11-22 15:12:10 -05:00
|
|
|
// ListMultipartUploads lists all multipart uploads.
|
2017-12-05 20:58:09 -05:00
|
|
|
func (a GatewayUnsupported) ListMultipartUploads(bucket string, prefix string, keyMarker string, uploadIDMarker string, delimiter string, maxUploads int) (lmi ListMultipartsInfo, err error) {
|
2017-11-25 14:58:29 -05:00
|
|
|
return lmi, errors.Trace(NotImplemented{})
|
2017-11-22 15:12:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewMultipartUpload upload object in multiple parts
|
2017-12-05 20:58:09 -05:00
|
|
|
func (a GatewayUnsupported) NewMultipartUpload(bucket string, object string, metadata map[string]string) (uploadID string, err error) {
|
2017-11-25 14:58:29 -05:00
|
|
|
return "", errors.Trace(NotImplemented{})
|
2017-11-22 15:12:10 -05:00
|
|
|
}
|
|
|
|
|
2017-12-05 20:58:09 -05:00
|
|
|
// CopyObjectPart copy part of object to other bucket and object
|
2018-01-12 23:34:52 -05:00
|
|
|
func (a GatewayUnsupported) CopyObjectPart(srcBucket string, srcObject string, destBucket string, destObject string, uploadID string, partID int, startOffset int64, length int64, metadata map[string]string, srcEtag string) (pi PartInfo, err error) {
|
2017-12-05 20:58:09 -05:00
|
|
|
return pi, errors.Trace(NotImplemented{})
|
|
|
|
}
|
|
|
|
|
2017-11-22 15:12:10 -05:00
|
|
|
// PutObjectPart puts a part of object in bucket
|
2017-12-05 20:58:09 -05:00
|
|
|
func (a GatewayUnsupported) PutObjectPart(bucket string, object string, uploadID string, partID int, data *hash.Reader) (pi PartInfo, err error) {
|
2017-11-25 14:58:29 -05:00
|
|
|
return pi, errors.Trace(NotImplemented{})
|
2017-11-22 15:12:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// ListObjectParts returns all object parts for specified object in specified bucket
|
2017-12-05 20:58:09 -05:00
|
|
|
func (a GatewayUnsupported) ListObjectParts(bucket string, object string, uploadID string, partNumberMarker int, maxParts int) (lpi ListPartsInfo, err error) {
|
2017-11-25 14:58:29 -05:00
|
|
|
return lpi, errors.Trace(NotImplemented{})
|
2017-11-22 15:12:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// AbortMultipartUpload aborts a ongoing multipart upload
|
2017-12-05 20:58:09 -05:00
|
|
|
func (a GatewayUnsupported) AbortMultipartUpload(bucket string, object string, uploadID string) error {
|
2017-11-25 14:58:29 -05:00
|
|
|
return errors.Trace(NotImplemented{})
|
2017-11-22 15:12:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// CompleteMultipartUpload completes ongoing multipart upload and finalizes object
|
2017-12-05 20:58:09 -05:00
|
|
|
func (a GatewayUnsupported) CompleteMultipartUpload(bucket string, object string, uploadID string, uploadedParts []CompletePart) (oi ObjectInfo, err error) {
|
2017-11-25 14:58:29 -05:00
|
|
|
return oi, errors.Trace(NotImplemented{})
|
2017-11-22 15:12:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetBucketPolicies sets policy on bucket
|
2017-12-05 20:58:09 -05:00
|
|
|
func (a GatewayUnsupported) SetBucketPolicies(bucket string, policyInfo policy.BucketAccessPolicy) error {
|
2017-11-25 14:58:29 -05:00
|
|
|
return errors.Trace(NotImplemented{})
|
2017-11-22 15:12:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetBucketPolicies will get policy on bucket
|
2017-12-05 20:58:09 -05:00
|
|
|
func (a GatewayUnsupported) GetBucketPolicies(bucket string) (bal policy.BucketAccessPolicy, err error) {
|
2017-11-25 14:58:29 -05:00
|
|
|
return bal, errors.Trace(NotImplemented{})
|
2017-11-22 15:12:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// DeleteBucketPolicies deletes all policies on bucket
|
2017-12-05 20:58:09 -05:00
|
|
|
func (a GatewayUnsupported) DeleteBucketPolicies(bucket string) error {
|
2017-11-25 14:58:29 -05:00
|
|
|
return errors.Trace(NotImplemented{})
|
|
|
|
}
|
|
|
|
|
2017-12-05 20:58:09 -05:00
|
|
|
// HealBucket - Not implemented stub
|
|
|
|
func (a GatewayUnsupported) HealBucket(bucket string) error {
|
2017-11-25 14:58:29 -05:00
|
|
|
return errors.Trace(NotImplemented{})
|
2017-03-16 15:21:58 -04:00
|
|
|
}
|
|
|
|
|
2017-12-05 20:58:09 -05:00
|
|
|
// ListBucketsHeal - Not implemented stub
|
|
|
|
func (a GatewayUnsupported) ListBucketsHeal() (buckets []BucketInfo, err error) {
|
2017-11-25 14:58:29 -05:00
|
|
|
return nil, errors.Trace(NotImplemented{})
|
2017-03-16 15:21:58 -04:00
|
|
|
}
|
|
|
|
|
2017-12-05 20:58:09 -05:00
|
|
|
// HealObject - Not implemented stub
|
|
|
|
func (a GatewayUnsupported) HealObject(bucket, object string) (int, int, error) {
|
2017-11-25 14:58:29 -05:00
|
|
|
return 0, 0, errors.Trace(NotImplemented{})
|
2017-03-16 15:21:58 -04:00
|
|
|
}
|
|
|
|
|
2017-12-05 20:58:09 -05:00
|
|
|
// ListObjectsV2 - Not implemented stub
|
|
|
|
func (a GatewayUnsupported) ListObjectsV2(bucket, prefix, continuationToken, delimiter string, maxKeys int, fetchOwner bool, startAfter string) (result ListObjectsV2Info, err error) {
|
2017-11-25 14:58:29 -05:00
|
|
|
return result, errors.Trace(NotImplemented{})
|
2017-11-22 15:12:10 -05:00
|
|
|
}
|
|
|
|
|
2017-12-05 20:58:09 -05:00
|
|
|
// ListObjectsHeal - Not implemented stub
|
|
|
|
func (a GatewayUnsupported) ListObjectsHeal(bucket, prefix, marker, delimiter string, maxKeys int) (loi ListObjectsInfo, e error) {
|
2017-11-25 14:58:29 -05:00
|
|
|
return loi, errors.Trace(NotImplemented{})
|
2017-03-16 15:21:58 -04:00
|
|
|
}
|
|
|
|
|
2017-10-13 06:56:16 -04:00
|
|
|
// AnonListObjects - List objects anonymously
|
2017-12-05 20:58:09 -05:00
|
|
|
func (a GatewayUnsupported) AnonListObjects(bucket string, prefix string, marker string, delimiter string,
|
2017-10-13 06:56:16 -04:00
|
|
|
maxKeys int) (loi ListObjectsInfo, err error) {
|
2017-11-25 14:58:29 -05:00
|
|
|
return loi, errors.Trace(NotImplemented{})
|
2017-10-13 06:56:16 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// AnonListObjectsV2 - List objects in V2 mode, anonymously
|
2017-12-05 20:58:09 -05:00
|
|
|
func (a GatewayUnsupported) AnonListObjectsV2(bucket, prefix, continuationToken, delimiter string, maxKeys int,
|
2017-10-13 06:56:16 -04:00
|
|
|
fetchOwner bool, startAfter string) (loi ListObjectsV2Info, err error) {
|
2017-11-25 14:58:29 -05:00
|
|
|
return loi, errors.Trace(NotImplemented{})
|
2017-10-13 06:56:16 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// AnonGetBucketInfo - Get bucket metadata anonymously.
|
2017-12-05 20:58:09 -05:00
|
|
|
func (a GatewayUnsupported) AnonGetBucketInfo(bucket string) (bi BucketInfo, err error) {
|
2017-11-25 14:58:29 -05:00
|
|
|
return bi, errors.Trace(NotImplemented{})
|
2017-10-13 06:56:16 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// AnonPutObject creates a new object anonymously with the incoming data,
|
2017-12-05 20:58:09 -05:00
|
|
|
func (a GatewayUnsupported) AnonPutObject(bucket, object string, data *hash.Reader,
|
2017-10-22 01:30:34 -04:00
|
|
|
metadata map[string]string) (ObjectInfo, error) {
|
2017-11-25 14:58:29 -05:00
|
|
|
return ObjectInfo{}, errors.Trace(NotImplemented{})
|
2017-10-13 06:56:16 -04:00
|
|
|
}
|
2017-11-22 15:12:10 -05:00
|
|
|
|
|
|
|
// AnonGetObject downloads object anonymously.
|
2018-01-12 23:34:52 -05:00
|
|
|
func (a GatewayUnsupported) AnonGetObject(bucket, object string, startOffset int64, length int64, writer io.Writer, etag string) (err error) {
|
2017-11-25 14:58:29 -05:00
|
|
|
return errors.Trace(NotImplemented{})
|
2017-11-22 15:12:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// AnonGetObjectInfo returns stat information about an object anonymously.
|
2017-12-05 20:58:09 -05:00
|
|
|
func (a GatewayUnsupported) AnonGetObjectInfo(bucket, object string) (objInfo ObjectInfo, err error) {
|
2017-11-25 14:58:29 -05:00
|
|
|
return objInfo, errors.Trace(NotImplemented{})
|
2017-11-22 15:12:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// CopyObject copies a blob from source container to destination container.
|
2017-12-05 20:58:09 -05:00
|
|
|
func (a GatewayUnsupported) CopyObject(srcBucket string, srcObject string, destBucket string, destObject string,
|
2018-01-12 23:34:52 -05:00
|
|
|
metadata map[string]string, srcEtag string) (objInfo ObjectInfo, err error) {
|
2017-11-25 14:58:29 -05:00
|
|
|
return objInfo, errors.Trace(NotImplemented{})
|
2017-11-22 15:12:10 -05:00
|
|
|
}
|
2018-01-12 23:34:52 -05:00
|
|
|
|
|
|
|
// Locking operations
|
|
|
|
|
|
|
|
// ListLocks lists namespace locks held in object layer
|
|
|
|
func (a GatewayUnsupported) ListLocks(bucket, prefix string, duration time.Duration) ([]VolumeLockInfo, error) {
|
|
|
|
return []VolumeLockInfo{}, errors.Trace(NotImplemented{})
|
|
|
|
}
|
|
|
|
|
|
|
|
// ClearLocks clears namespace locks held in object layer
|
|
|
|
func (a GatewayUnsupported) ClearLocks([]VolumeLockInfo) error {
|
|
|
|
return errors.Trace(NotImplemented{})
|
|
|
|
}
|