2016-03-05 19:43:48 -05:00
|
|
|
/*
|
2019-04-09 14:39:42 -04:00
|
|
|
* MinIO Cloud Storage, (C) 2015, 2016 MinIO, Inc.
|
2016-03-05 19:43:48 -05: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-18 19:23:42 -04:00
|
|
|
package cmd
|
2016-03-05 19:43:48 -05:00
|
|
|
|
2016-04-20 20:35:38 -04:00
|
|
|
import (
|
|
|
|
"encoding/xml"
|
2020-11-19 21:43:58 -05:00
|
|
|
"time"
|
2016-04-20 20:35:38 -04:00
|
|
|
)
|
|
|
|
|
2020-06-12 23:04:01 -04:00
|
|
|
// DeletedObject objects deleted
|
|
|
|
type DeletedObject struct {
|
2020-07-10 11:30:23 -04:00
|
|
|
DeleteMarker bool `xml:"DeleteMarker,omitempty"`
|
2020-06-12 23:04:01 -04:00
|
|
|
DeleteMarkerVersionID string `xml:"DeleteMarkerVersionId,omitempty"`
|
|
|
|
ObjectName string `xml:"Key,omitempty"`
|
|
|
|
VersionID string `xml:"VersionId,omitempty"`
|
2020-11-12 15:10:59 -05:00
|
|
|
|
|
|
|
// MinIO extensions to support delete marker replication
|
2020-11-19 21:43:58 -05:00
|
|
|
// Replication status of DeleteMarker
|
2020-11-12 15:10:59 -05:00
|
|
|
DeleteMarkerReplicationStatus string `xml:"DeleteMarkerReplicationStatus,omitempty"`
|
2020-11-19 21:43:58 -05:00
|
|
|
// MTime of DeleteMarker on source that needs to be propagated to replica
|
2020-11-29 00:15:45 -05:00
|
|
|
DeleteMarkerMTime DeleteMarkerMTime `xml:"DeleteMarkerMTime,omitempty"`
|
2020-11-19 21:43:58 -05:00
|
|
|
// Status of versioned delete (of object or DeleteMarker)
|
2020-11-12 15:10:59 -05:00
|
|
|
VersionPurgeStatus VersionPurgeStatusType `xml:"VersionPurgeStatus,omitempty"`
|
2020-11-25 14:24:50 -05:00
|
|
|
// PurgeTransitioned is nonempty if object is in transition tier
|
|
|
|
PurgeTransitioned string `xml:"PurgeTransitioned,omitempty"`
|
2020-06-12 23:04:01 -04:00
|
|
|
}
|
|
|
|
|
2020-11-29 00:15:45 -05:00
|
|
|
// DeleteMarkerMTime is an embedded type containing time.Time for XML marshal
|
|
|
|
type DeleteMarkerMTime struct {
|
|
|
|
time.Time
|
|
|
|
}
|
|
|
|
|
|
|
|
// MarshalXML encodes expiration date if it is non-zero and encodes
|
|
|
|
// empty string otherwise
|
|
|
|
func (t DeleteMarkerMTime) MarshalXML(e *xml.Encoder, startElement xml.StartElement) error {
|
|
|
|
if t.Time.IsZero() {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return e.EncodeElement(t.Time.Format(time.RFC3339), startElement)
|
|
|
|
}
|
|
|
|
|
2020-06-12 23:04:01 -04:00
|
|
|
// ObjectToDelete carries key name for the object to delete.
|
|
|
|
type ObjectToDelete struct {
|
2016-03-05 19:43:48 -05:00
|
|
|
ObjectName string `xml:"Key"`
|
2020-06-12 23:04:01 -04:00
|
|
|
VersionID string `xml:"VersionId"`
|
2020-11-19 21:43:58 -05:00
|
|
|
// Replication status of DeleteMarker
|
2020-11-12 15:10:59 -05:00
|
|
|
DeleteMarkerReplicationStatus string `xml:"DeleteMarkerReplicationStatus"`
|
2020-11-19 21:43:58 -05:00
|
|
|
// Status of versioned delete (of object or DeleteMarker)
|
2020-11-12 15:10:59 -05:00
|
|
|
VersionPurgeStatus VersionPurgeStatusType `xml:"VersionPurgeStatus"`
|
2020-11-19 21:43:58 -05:00
|
|
|
// Version ID of delete marker
|
2020-11-12 15:10:59 -05:00
|
|
|
DeleteMarkerVersionID string `xml:"DeleteMarkerVersionId"`
|
2020-11-25 14:24:50 -05:00
|
|
|
// PurgeTransitioned is nonempty if object is in transition tier
|
|
|
|
PurgeTransitioned string `xml:"PurgeTransitioned"`
|
2016-03-05 19:43:48 -05:00
|
|
|
}
|
|
|
|
|
2016-04-20 20:35:38 -04:00
|
|
|
// createBucketConfiguration container for bucket configuration request from client.
|
2019-11-20 16:18:09 -05:00
|
|
|
// Used for parsing the location from the request body for Makebucket.
|
2016-04-20 20:35:38 -04:00
|
|
|
type createBucketLocationConfiguration struct {
|
2016-09-29 18:51:00 -04:00
|
|
|
XMLName xml.Name `xml:"CreateBucketConfiguration" json:"-"`
|
2016-04-20 20:35:38 -04:00
|
|
|
Location string `xml:"LocationConstraint"`
|
|
|
|
}
|
|
|
|
|
2016-03-05 19:43:48 -05:00
|
|
|
// DeleteObjectsRequest - xml carrying the object key names which needs to be deleted.
|
|
|
|
type DeleteObjectsRequest struct {
|
|
|
|
// Element to enable quiet mode for the request
|
|
|
|
Quiet bool
|
|
|
|
// List of objects to be deleted
|
2020-06-12 23:04:01 -04:00
|
|
|
Objects []ObjectToDelete `xml:"Object"`
|
2016-03-05 19:43:48 -05:00
|
|
|
}
|