PUT Bucket Version

最近更新时间:2020-07-13 22:23:02

PUT Bucket Version


Description

This PUT operation uses the version resource to set the multi version settings of user space. If you use this interface, you need to be the owner of this space. Users can open or close multiple versions through this interface:

  • Open status: all files uploaded to the storage space will be identified with a unique version ID.

  • Closed status: all files uploaded to the storage space will identify a version ID with a value of null.

Request

Grammar

PUT /?versioning HTTP/1.1
Host: {BucketName}.{endpoint}
Date: {date}
Authorization: {SignatureValue}

<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
   <Status>string</Status>
</VersioningConfiguration>.

Note:

Request parameters

The interface does not use request parameters.

Request header

This interface only uses common request headers. For more information, please click Public request headers.

Request content

Name Description
Status The multi version state of the storage space.
Type: String
Valid value: Enabled Suspended

Response

Response header

This interface can use all common response headers. For more information, please click Public response headers.

Response content

The interface does not return the corresponding content.

Special errors

The interface does not return any special errors.

Example

Example of opening a multi version request

PUT /?versioning HTTP/1.1
Host: ks3-example.ks3-cn-beijing.ksyun.com
Date: Fri, 26 Dec 2014 06:38:43 GMT
Authorization: authorization string
Content-Type: text/plain
Content-Length: 124

<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> 
  <Status>Enabled</Status> 
</VersioningConfiguration>

Response example

HTTP/1.1 200 OK
Date: Fri, 26 Dec 2014 06:38:43 GMT
Server: Tengine

Example of closing a multi version request

PUT /?versioning HTTP/1.1
Host: ks3-example.ks3-cn-beijing.ksyun.com
Date: Fri, 26 Dec 2014 06:38:43 GMT
Authorization: authorization string
Content-Type: text/plain
Content-Length: 124

<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> 
  <Status>Suspended</Status> 
</VersioningConfiguration>

Example of a response to closing a log

HTTP/1.1 200 OK
Date: Fri, 26 Dec 2014 06:38:43 GMT
Server: Tengine

金山云,开启您的云计算之旅

免费注册