2015-06-26 11:10:47 +02:00
|
|
|
/*
|
2019-04-09 20:39:42 +02:00
|
|
|
* MinIO Cloud Storage, (C) 2016, 2017 MinIO, Inc.
|
2015-06-26 11:10:47 +02:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2016-08-19 01:23:42 +02:00
|
|
|
package cmd
|
2015-06-26 11:10:47 +02:00
|
|
|
|
2018-02-16 02:45:57 +01:00
|
|
|
import (
|
2018-02-24 00:07:21 +01:00
|
|
|
"io"
|
2018-02-16 02:45:57 +01:00
|
|
|
"time"
|
|
|
|
|
2018-02-24 00:07:21 +01:00
|
|
|
"github.com/minio/minio/pkg/hash"
|
2018-02-16 02:45:57 +01:00
|
|
|
"github.com/minio/minio/pkg/madmin"
|
|
|
|
)
|
2015-07-04 06:02:31 +02:00
|
|
|
|
2016-10-05 21:48:07 +02:00
|
|
|
// BackendType - represents different backend types.
|
|
|
|
type BackendType int
|
|
|
|
|
|
|
|
// Enum for different backend types.
|
|
|
|
const (
|
|
|
|
Unknown BackendType = iota
|
|
|
|
// Filesystem backend.
|
2018-08-24 08:35:37 +02:00
|
|
|
BackendFS
|
|
|
|
// Multi disk BackendErasure (single, distributed) backend.
|
|
|
|
BackendErasure
|
2019-11-02 00:58:11 +01:00
|
|
|
// Gateway backend.
|
|
|
|
BackendGateway
|
2016-10-05 21:48:07 +02:00
|
|
|
// Add your own backend.
|
|
|
|
)
|
|
|
|
|
2016-05-26 23:13:10 +02:00
|
|
|
// StorageInfo - represents total capacity of underlying storage.
|
|
|
|
type StorageInfo struct {
|
2019-10-23 06:01:14 +02:00
|
|
|
Used []uint64 // Used total used per disk.
|
2018-05-23 12:11:29 +02:00
|
|
|
|
2019-10-23 06:01:14 +02:00
|
|
|
Total []uint64 // Total disk space per disk.
|
2019-04-05 06:21:50 +02:00
|
|
|
|
2019-10-23 06:01:14 +02:00
|
|
|
Available []uint64 // Total disk space available per disk.
|
|
|
|
|
|
|
|
MountPaths []string // Disk mountpoints
|
2019-04-05 06:21:50 +02:00
|
|
|
|
2016-10-05 21:48:07 +02:00
|
|
|
// Backend type.
|
|
|
|
Backend struct {
|
2019-11-02 00:58:11 +01:00
|
|
|
// Represents various backend types, currently on FS, Erasure and Gateway
|
2016-10-05 21:48:07 +02:00
|
|
|
Type BackendType
|
|
|
|
|
2019-11-02 00:58:11 +01:00
|
|
|
// Following fields are only meaningful if BackendType is Gateway.
|
|
|
|
GatewayOnline bool
|
|
|
|
|
2017-02-10 08:26:44 +01:00
|
|
|
// Following fields are only meaningful if BackendType is Erasure.
|
2019-10-23 06:01:14 +02:00
|
|
|
OnlineDisks madmin.BackendDisks // Online disks during server startup.
|
|
|
|
OfflineDisks madmin.BackendDisks // Offline disks during server startup.
|
|
|
|
StandardSCData int // Data disks for currently configured Standard storage class.
|
|
|
|
StandardSCParity int // Parity disks for currently configured Standard storage class.
|
|
|
|
RRSCData int // Data disks for currently configured Reduced Redundancy storage class.
|
|
|
|
RRSCParity int // Parity disks for currently configured Reduced Redundancy storage class.
|
2018-02-16 02:45:57 +01:00
|
|
|
|
|
|
|
// List of all disk status, this is only meaningful if BackendType is Erasure.
|
|
|
|
Sets [][]madmin.DriveInfo
|
2016-10-05 21:48:07 +02:00
|
|
|
}
|
2016-05-26 23:13:10 +02:00
|
|
|
}
|
|
|
|
|
2019-12-12 15:02:37 +01:00
|
|
|
// objectHistogramInterval is an interval that will be
|
|
|
|
// used to report the histogram of objects data sizes
|
|
|
|
type objectHistogramInterval struct {
|
|
|
|
name string
|
|
|
|
start, end int64
|
|
|
|
}
|
|
|
|
|
|
|
|
// ObjectsHistogramIntervals is the list of all intervals
|
|
|
|
// of object sizes to be included in objects histogram.
|
|
|
|
var ObjectsHistogramIntervals = []objectHistogramInterval{
|
|
|
|
{"LESS_THAN_1024_B", -1, 1024 - 1},
|
|
|
|
{"BETWEEN_1024_B_AND_1_MB", 1024, 1024*1024 - 1},
|
|
|
|
{"BETWEEN_1_MB_AND_10_MB", 1024 * 1024, 1024*1024*10 - 1},
|
|
|
|
{"BETWEEN_10_MB_AND_64_MB", 1024 * 1024 * 10, 1024*1024*64 - 1},
|
|
|
|
{"BETWEEN_64_MB_AND_128_MB", 1024 * 1024 * 64, 1024*1024*128 - 1},
|
|
|
|
{"BETWEEN_128_MB_AND_512_MB", 1024 * 1024 * 128, 1024*1024*512 - 1},
|
|
|
|
{"GREATER_THAN_512_MB", 1024 * 1024 * 512, -1},
|
|
|
|
}
|
|
|
|
|
|
|
|
// DataUsageInfo represents data usage stats of the underlying Object API
|
|
|
|
type DataUsageInfo struct {
|
|
|
|
// The timestamp of when the data usage info is generated
|
|
|
|
LastUpdate time.Time `json:"lastUpdate"`
|
|
|
|
|
|
|
|
ObjectsCount uint64 `json:"objectsCount"`
|
|
|
|
// Objects total size
|
|
|
|
ObjectsTotalSize uint64 `json:"objectsTotalSize"`
|
|
|
|
ObjectsSizesHistogram map[string]uint64 `json:"objectsSizesHistogram"`
|
|
|
|
|
|
|
|
BucketsCount uint64 `json:"bucketsCount"`
|
|
|
|
BucketsSizes map[string]uint64 `json:"bucketsSizes"`
|
|
|
|
}
|
|
|
|
|
2016-06-09 15:24:11 +02:00
|
|
|
// BucketInfo - represents bucket metadata.
|
objectAPI: Fix object API interface, remove unnecessary structs.
ObjectAPI changes.
```
ListObjects(bucket, prefix, marker, delimiter string, maxKeys int) (ListObjectsInfo, *probe.Error)
ListMultipartUploads(bucket, objectPrefix, keyMarker, uploadIDMarker, delimiter string, maxUploads int) (ListMultipartsInfo, *probe.Error)
ListObjectParts(bucket, object, uploadID string, partNumberMarker, maxParts int) (ListPartsInfo, *probe.Error)
CompleteMultipartUpload(bucket string, object string, uploadID string, parts []completePart) (ObjectInfo, *probe.Error)
```
2016-04-03 10:34:20 +02:00
|
|
|
type BucketInfo struct {
|
2016-06-09 15:24:11 +02:00
|
|
|
// Name of the bucket.
|
|
|
|
Name string
|
|
|
|
|
|
|
|
// Date and time when the bucket was created.
|
objectAPI: Fix object API interface, remove unnecessary structs.
ObjectAPI changes.
```
ListObjects(bucket, prefix, marker, delimiter string, maxKeys int) (ListObjectsInfo, *probe.Error)
ListMultipartUploads(bucket, objectPrefix, keyMarker, uploadIDMarker, delimiter string, maxUploads int) (ListMultipartsInfo, *probe.Error)
ListObjectParts(bucket, object, uploadID string, partNumberMarker, maxParts int) (ListPartsInfo, *probe.Error)
CompleteMultipartUpload(bucket string, object string, uploadID string, parts []completePart) (ObjectInfo, *probe.Error)
```
2016-04-03 10:34:20 +02:00
|
|
|
Created time.Time
|
2017-01-17 19:02:58 +01:00
|
|
|
}
|
|
|
|
|
2016-06-09 15:24:11 +02:00
|
|
|
// ObjectInfo - represents object metadata.
|
objectAPI: Fix object API interface, remove unnecessary structs.
ObjectAPI changes.
```
ListObjects(bucket, prefix, marker, delimiter string, maxKeys int) (ListObjectsInfo, *probe.Error)
ListMultipartUploads(bucket, objectPrefix, keyMarker, uploadIDMarker, delimiter string, maxUploads int) (ListMultipartsInfo, *probe.Error)
ListObjectParts(bucket, object, uploadID string, partNumberMarker, maxParts int) (ListPartsInfo, *probe.Error)
CompleteMultipartUpload(bucket string, object string, uploadID string, parts []completePart) (ObjectInfo, *probe.Error)
```
2016-04-03 10:34:20 +02:00
|
|
|
type ObjectInfo struct {
|
2016-06-09 15:24:11 +02:00
|
|
|
// Name of the bucket.
|
|
|
|
Bucket string
|
|
|
|
|
|
|
|
// Name of the object.
|
|
|
|
Name string
|
|
|
|
|
|
|
|
// Date and time when the object was last modified.
|
|
|
|
ModTime time.Time
|
|
|
|
|
|
|
|
// Total object size.
|
|
|
|
Size int64
|
|
|
|
|
|
|
|
// IsDir indicates if the object is prefix.
|
|
|
|
IsDir bool
|
|
|
|
|
2017-05-14 21:05:51 +02:00
|
|
|
// Hex encoded unique entity tag of the object.
|
|
|
|
ETag string
|
2016-06-09 15:24:11 +02:00
|
|
|
|
|
|
|
// A standard MIME type describing the format of the object.
|
|
|
|
ContentType string
|
|
|
|
|
|
|
|
// Specifies what content encodings have been applied to the object and thus
|
|
|
|
// what decoding mechanisms must be applied to obtain the object referenced
|
|
|
|
// by the Content-Type header field.
|
2016-05-20 02:10:08 +02:00
|
|
|
ContentEncoding string
|
2016-07-12 21:45:17 +02:00
|
|
|
|
2019-02-28 20:01:25 +01:00
|
|
|
// Date and time at which the object is no longer able to be cached
|
|
|
|
Expires time.Time
|
|
|
|
|
2018-04-05 19:56:28 +02:00
|
|
|
// Specify object storage class
|
|
|
|
StorageClass string
|
|
|
|
|
2016-07-12 21:45:17 +02:00
|
|
|
// User-Defined metadata
|
2018-01-22 23:54:55 +01:00
|
|
|
UserDefined map[string]string
|
2018-02-24 00:07:21 +01:00
|
|
|
|
2018-03-01 20:37:57 +01:00
|
|
|
// List of individual parts, maximum size of upto 10,000
|
2019-01-05 23:16:43 +01:00
|
|
|
Parts []ObjectPartInfo `json:"-"`
|
2018-03-01 20:37:57 +01:00
|
|
|
|
2018-02-24 00:07:21 +01:00
|
|
|
// Implements writer and reader used by CopyObject API
|
|
|
|
Writer io.WriteCloser `json:"-"`
|
|
|
|
Reader *hash.Reader `json:"-"`
|
2018-11-15 02:36:41 +01:00
|
|
|
PutObjReader *PutObjReader `json:"-"`
|
|
|
|
|
2018-02-24 00:07:21 +01:00
|
|
|
metadataOnly bool
|
2018-10-15 20:07:36 +02:00
|
|
|
|
2018-03-28 23:14:06 +02:00
|
|
|
// Date and time when the object was last accessed.
|
|
|
|
AccTime time.Time
|
2018-10-15 20:07:36 +02:00
|
|
|
|
|
|
|
// backendType indicates which backend filled this structure
|
|
|
|
backendType BackendType
|
2015-07-04 06:02:31 +02:00
|
|
|
}
|
|
|
|
|
2016-06-09 15:24:11 +02:00
|
|
|
// ListPartsInfo - represents list of all parts.
|
objectAPI: Fix object API interface, remove unnecessary structs.
ObjectAPI changes.
```
ListObjects(bucket, prefix, marker, delimiter string, maxKeys int) (ListObjectsInfo, *probe.Error)
ListMultipartUploads(bucket, objectPrefix, keyMarker, uploadIDMarker, delimiter string, maxUploads int) (ListMultipartsInfo, *probe.Error)
ListObjectParts(bucket, object, uploadID string, partNumberMarker, maxParts int) (ListPartsInfo, *probe.Error)
CompleteMultipartUpload(bucket string, object string, uploadID string, parts []completePart) (ObjectInfo, *probe.Error)
```
2016-04-03 10:34:20 +02:00
|
|
|
type ListPartsInfo struct {
|
2016-06-09 15:24:11 +02:00
|
|
|
// Name of the bucket.
|
|
|
|
Bucket string
|
|
|
|
|
|
|
|
// Name of the object.
|
|
|
|
Object string
|
|
|
|
|
|
|
|
// Upload ID identifying the multipart upload whose parts are being listed.
|
|
|
|
UploadID string
|
|
|
|
|
|
|
|
// The class of storage used to store the object.
|
|
|
|
StorageClass string
|
|
|
|
|
|
|
|
// Part number after which listing begins.
|
|
|
|
PartNumberMarker int
|
|
|
|
|
|
|
|
// When a list is truncated, this element specifies the last part in the list,
|
|
|
|
// as well as the value to use for the part-number-marker request parameter
|
|
|
|
// in a subsequent request.
|
2015-07-04 06:02:31 +02:00
|
|
|
NextPartNumberMarker int
|
|
|
|
|
2016-06-09 15:24:11 +02:00
|
|
|
// Maximum number of parts that were allowed in the response.
|
|
|
|
MaxParts int
|
|
|
|
|
|
|
|
// Indicates whether the returned list of parts is truncated.
|
|
|
|
IsTruncated bool
|
|
|
|
|
|
|
|
// List of all parts.
|
2017-01-31 18:38:34 +01:00
|
|
|
Parts []PartInfo
|
2016-06-09 15:24:11 +02:00
|
|
|
|
2018-03-01 20:37:57 +01:00
|
|
|
// Any metadata set during InitMultipartUpload, including encryption headers.
|
|
|
|
UserDefined map[string]string
|
|
|
|
|
2016-06-09 15:24:11 +02:00
|
|
|
EncodingType string // Not supported yet.
|
2015-07-04 06:02:31 +02:00
|
|
|
}
|
|
|
|
|
2019-11-20 02:42:27 +01:00
|
|
|
// Lookup - returns if uploadID is valid
|
|
|
|
func (lm ListMultipartsInfo) Lookup(uploadID string) bool {
|
|
|
|
for _, upload := range lm.Uploads {
|
|
|
|
if upload.UploadID == uploadID {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2016-06-09 15:24:11 +02:00
|
|
|
// ListMultipartsInfo - represnets bucket resources for incomplete multipart uploads.
|
objectAPI: Fix object API interface, remove unnecessary structs.
ObjectAPI changes.
```
ListObjects(bucket, prefix, marker, delimiter string, maxKeys int) (ListObjectsInfo, *probe.Error)
ListMultipartUploads(bucket, objectPrefix, keyMarker, uploadIDMarker, delimiter string, maxUploads int) (ListMultipartsInfo, *probe.Error)
ListObjectParts(bucket, object, uploadID string, partNumberMarker, maxParts int) (ListPartsInfo, *probe.Error)
CompleteMultipartUpload(bucket string, object string, uploadID string, parts []completePart) (ObjectInfo, *probe.Error)
```
2016-04-03 10:34:20 +02:00
|
|
|
type ListMultipartsInfo struct {
|
2016-06-09 15:24:11 +02:00
|
|
|
// Together with upload-id-marker, this parameter specifies the multipart upload
|
|
|
|
// after which listing should begin.
|
|
|
|
KeyMarker string
|
|
|
|
|
|
|
|
// Together with key-marker, specifies the multipart upload after which listing
|
|
|
|
// should begin. If key-marker is not specified, the upload-id-marker parameter
|
|
|
|
// is ignored.
|
|
|
|
UploadIDMarker string
|
|
|
|
|
|
|
|
// When a list is truncated, this element specifies the value that should be
|
|
|
|
// used for the key-marker request parameter in a subsequent request.
|
|
|
|
NextKeyMarker string
|
|
|
|
|
|
|
|
// When a list is truncated, this element specifies the value that should be
|
|
|
|
// used for the upload-id-marker request parameter in a subsequent request.
|
2015-07-04 06:02:31 +02:00
|
|
|
NextUploadIDMarker string
|
2016-06-09 15:24:11 +02:00
|
|
|
|
|
|
|
// Maximum number of multipart uploads that could have been included in the
|
|
|
|
// response.
|
|
|
|
MaxUploads int
|
|
|
|
|
|
|
|
// Indicates whether the returned list of multipart uploads is truncated. A
|
|
|
|
// value of true indicates that the list was truncated. The list can be truncated
|
|
|
|
// if the number of multipart uploads exceeds the limit allowed or specified
|
|
|
|
// by max uploads.
|
|
|
|
IsTruncated bool
|
|
|
|
|
|
|
|
// List of all pending uploads.
|
2017-11-14 09:25:10 +01:00
|
|
|
Uploads []MultipartInfo
|
2016-06-09 15:24:11 +02:00
|
|
|
|
|
|
|
// When a prefix is provided in the request, The result contains only keys
|
|
|
|
// starting with the specified prefix.
|
|
|
|
Prefix string
|
|
|
|
|
|
|
|
// A character used to truncate the object prefixes.
|
|
|
|
// NOTE: only supported delimiter is '/'.
|
|
|
|
Delimiter string
|
|
|
|
|
|
|
|
// CommonPrefixes contains all (if there are any) keys between Prefix and the
|
|
|
|
// next occurrence of the string specified by delimiter.
|
|
|
|
CommonPrefixes []string
|
|
|
|
|
|
|
|
EncodingType string // Not supported yet.
|
2015-07-04 06:02:31 +02:00
|
|
|
}
|
|
|
|
|
objectAPI: Fix object API interface, remove unnecessary structs.
ObjectAPI changes.
```
ListObjects(bucket, prefix, marker, delimiter string, maxKeys int) (ListObjectsInfo, *probe.Error)
ListMultipartUploads(bucket, objectPrefix, keyMarker, uploadIDMarker, delimiter string, maxUploads int) (ListMultipartsInfo, *probe.Error)
ListObjectParts(bucket, object, uploadID string, partNumberMarker, maxParts int) (ListPartsInfo, *probe.Error)
CompleteMultipartUpload(bucket string, object string, uploadID string, parts []completePart) (ObjectInfo, *probe.Error)
```
2016-04-03 10:34:20 +02:00
|
|
|
// ListObjectsInfo - container for list objects.
|
|
|
|
type ListObjectsInfo struct {
|
2016-06-09 15:24:11 +02:00
|
|
|
// Indicates whether the returned list objects response is truncated. A
|
|
|
|
// value of true indicates that the list was truncated. The list can be truncated
|
|
|
|
// if the number of objects exceeds the limit allowed or specified
|
|
|
|
// by max keys.
|
2016-01-20 02:49:48 +01:00
|
|
|
IsTruncated bool
|
2016-06-09 15:24:11 +02:00
|
|
|
|
2019-10-28 21:18:12 +01:00
|
|
|
// When response is truncated (the IsTruncated element value in the response is true),
|
|
|
|
// you can use the key name in this field as marker in the subsequent
|
2016-06-09 15:24:11 +02:00
|
|
|
// request to get next set of objects.
|
|
|
|
//
|
2019-10-28 21:18:12 +01:00
|
|
|
// NOTE: AWS S3 returns NextMarker only if you have delimiter request parameter specified,
|
|
|
|
// MinIO always returns NextMarker.
|
2016-06-09 15:24:11 +02:00
|
|
|
NextMarker string
|
|
|
|
|
|
|
|
// List of objects info for this request.
|
|
|
|
Objects []ObjectInfo
|
|
|
|
|
|
|
|
// List of prefixes for this request.
|
|
|
|
Prefixes []string
|
2016-01-20 02:49:48 +01:00
|
|
|
}
|
|
|
|
|
2017-04-27 20:26:00 +02:00
|
|
|
// ListObjectsV2Info - container for list objects version 2.
|
|
|
|
type ListObjectsV2Info struct {
|
|
|
|
// Indicates whether the returned list objects response is truncated. A
|
|
|
|
// value of true indicates that the list was truncated. The list can be truncated
|
|
|
|
// if the number of objects exceeds the limit allowed or specified
|
|
|
|
// by max keys.
|
|
|
|
IsTruncated bool
|
|
|
|
|
|
|
|
// When response is truncated (the IsTruncated element value in the response
|
|
|
|
// is true), you can use the key name in this field as marker in the subsequent
|
|
|
|
// request to get next set of objects.
|
|
|
|
//
|
|
|
|
// NOTE: This element is returned only if you have delimiter request parameter
|
|
|
|
// specified.
|
|
|
|
ContinuationToken string
|
|
|
|
NextContinuationToken string
|
|
|
|
|
|
|
|
// List of objects info for this request.
|
|
|
|
Objects []ObjectInfo
|
|
|
|
|
|
|
|
// List of prefixes for this request.
|
|
|
|
Prefixes []string
|
|
|
|
}
|
|
|
|
|
2017-01-31 18:38:34 +01:00
|
|
|
// PartInfo - represents individual part metadata.
|
|
|
|
type PartInfo struct {
|
2016-06-09 15:24:11 +02:00
|
|
|
// Part number that identifies the part. This is a positive integer between
|
|
|
|
// 1 and 10,000.
|
|
|
|
PartNumber int
|
|
|
|
|
|
|
|
// Date and time at which the part was uploaded.
|
objectAPI: Fix object API interface, remove unnecessary structs.
ObjectAPI changes.
```
ListObjects(bucket, prefix, marker, delimiter string, maxKeys int) (ListObjectsInfo, *probe.Error)
ListMultipartUploads(bucket, objectPrefix, keyMarker, uploadIDMarker, delimiter string, maxUploads int) (ListMultipartsInfo, *probe.Error)
ListObjectParts(bucket, object, uploadID string, partNumberMarker, maxParts int) (ListPartsInfo, *probe.Error)
CompleteMultipartUpload(bucket string, object string, uploadID string, parts []completePart) (ObjectInfo, *probe.Error)
```
2016-04-03 10:34:20 +02:00
|
|
|
LastModified time.Time
|
2016-06-09 15:24:11 +02:00
|
|
|
|
|
|
|
// Entity tag returned when the part was initially uploaded.
|
|
|
|
ETag string
|
|
|
|
|
|
|
|
// Size in bytes of the part.
|
|
|
|
Size int64
|
2018-09-28 05:36:17 +02:00
|
|
|
|
|
|
|
// Decompressed Size.
|
|
|
|
ActualSize int64
|
objectAPI: Fix object API interface, remove unnecessary structs.
ObjectAPI changes.
```
ListObjects(bucket, prefix, marker, delimiter string, maxKeys int) (ListObjectsInfo, *probe.Error)
ListMultipartUploads(bucket, objectPrefix, keyMarker, uploadIDMarker, delimiter string, maxUploads int) (ListMultipartsInfo, *probe.Error)
ListObjectParts(bucket, object, uploadID string, partNumberMarker, maxParts int) (ListPartsInfo, *probe.Error)
CompleteMultipartUpload(bucket string, object string, uploadID string, parts []completePart) (ObjectInfo, *probe.Error)
```
2016-04-03 10:34:20 +02:00
|
|
|
}
|
|
|
|
|
2017-11-14 09:25:10 +01:00
|
|
|
// MultipartInfo - represents metadata in progress multipart upload.
|
|
|
|
type MultipartInfo struct {
|
2016-06-09 15:24:11 +02:00
|
|
|
// Object name for which the multipart upload was initiated.
|
|
|
|
Object string
|
|
|
|
|
|
|
|
// Unique identifier for this multipart upload.
|
|
|
|
UploadID string
|
|
|
|
|
|
|
|
// Date and time at which the multipart upload was initiated.
|
|
|
|
Initiated time.Time
|
|
|
|
|
|
|
|
StorageClass string // Not supported yet.
|
objectAPI: Fix object API interface, remove unnecessary structs.
ObjectAPI changes.
```
ListObjects(bucket, prefix, marker, delimiter string, maxKeys int) (ListObjectsInfo, *probe.Error)
ListMultipartUploads(bucket, objectPrefix, keyMarker, uploadIDMarker, delimiter string, maxUploads int) (ListMultipartsInfo, *probe.Error)
ListObjectParts(bucket, object, uploadID string, partNumberMarker, maxParts int) (ListPartsInfo, *probe.Error)
CompleteMultipartUpload(bucket string, object string, uploadID string, parts []completePart) (ObjectInfo, *probe.Error)
```
2016-04-03 10:34:20 +02:00
|
|
|
}
|
|
|
|
|
2017-11-14 09:25:10 +01:00
|
|
|
// CompletePart - represents the part that was completed, this is sent by the client
|
|
|
|
// during CompleteMultipartUpload request.
|
|
|
|
type CompletePart struct {
|
2016-06-09 15:24:11 +02:00
|
|
|
// Part number identifying the part. This is a positive integer between 1 and
|
|
|
|
// 10,000
|
2015-10-16 20:26:01 +02:00
|
|
|
PartNumber int
|
2016-06-09 15:24:11 +02:00
|
|
|
|
|
|
|
// Entity tag returned when the part was uploaded.
|
|
|
|
ETag string
|
2015-10-16 20:26:01 +02:00
|
|
|
}
|
|
|
|
|
2017-11-14 09:25:10 +01:00
|
|
|
// CompletedParts - is a collection satisfying sort.Interface.
|
|
|
|
type CompletedParts []CompletePart
|
2015-10-16 20:26:01 +02:00
|
|
|
|
2017-11-14 09:25:10 +01:00
|
|
|
func (a CompletedParts) Len() int { return len(a) }
|
|
|
|
func (a CompletedParts) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
|
|
|
func (a CompletedParts) Less(i, j int) bool { return a[i].PartNumber < a[j].PartNumber }
|
2015-10-16 20:26:01 +02:00
|
|
|
|
2017-11-14 09:25:10 +01:00
|
|
|
// CompleteMultipartUpload - represents list of parts which are completed, this is sent by the
|
|
|
|
// client during CompleteMultipartUpload request.
|
|
|
|
type CompleteMultipartUpload struct {
|
|
|
|
Parts []CompletePart `xml:"Part"`
|
2015-10-16 20:26:01 +02:00
|
|
|
}
|