This operation restores an object that is mistakenly overwritten or deleted. You can use versioning to save, query, and restore objects of different versions. Versioning allows you to easily recover lost data due to misoperations or program faults. Versioning can also be used for retaining and archiving data.
By default, versioning is disabled for a bucket.
Once WORM is enabled for a bucket, OBS automatically enables versioning for the bucket and the versioning cannot be suspended for that bucket.
You can perform this operation to enable or suspend versioning for a bucket.
After versioning is enabled for a bucket:
After versioning is suspended for a bucket:
Only the bucket owner can set versioning for the bucket.
1 2 3 4 5 6 7 8 9 | PUT /?versioning HTTP/1.1 Host: bucketname.obs.region.example.com Date: date Authorization: authorization Content-Length: length <VersioningConfiguration> <Status>status</Status> </VersioningConfiguration> |
This request contains no message parameters.
This request uses common headers. For details, see Table 3.
This request contains elements to configure the bucket versioning in XML format. Table 1 lists the request elements.
1 2 3 4 | HTTP/1.1 status_code Date: date Content-Length: length |
The response to the request uses common headers. For details, see Table 1.
This response contains no elements.
No special error responses are returned. For details about error responses, see Table 2.
1 2 3 4 5 6 7 8 9 10 11 | PUT /?versioning HTTP/1.1 User-Agent: curl/7.29.0 Host: examplebucket.obs.region.example.com Accept: */* Date: WED, 01 Jul 2015 03:14:18 GMT Authorization: OBS H4IPJX0TQTHTHEBQQCEC:sc2PM13Wlfcoc/YZLK0MwsI2Zpo= Content-Length: 89 <VersioningConfiguration> <Status>Enabled</Status> </VersioningConfiguration> |
1 2 3 4 5 6 | HTTP/1.1 200 OK Server: OBS x-obs-request-id: BF26000001643672B973EEBC5FBBF909 x-obs-id-2: 32AAAQAAEAABSAAgAAEAABAAAQAAEAABCSH6rPRHjQCa62fcNpCCPs7+1Aq/hKzE Date: Date: WED, 01 Jul 2015 03:14:18 GMT Content-Length: 0 |