@@ -20,30 +20,37 @@ To allow object versioning within a cluster, the cloud provider should add the
2020``allow_versioned_writes `` option to ``true `` in the
2121``[filter:versioned_writes] `` section of the proxy-server configuration file.
2222
23- The ``X-Versions-Location `` header defines the
24- container that holds the non-current versions of your objects. You
25- must UTF-8-encode and then URL-encode the container name before you
26- include it in the ``X-Versions-Location `` header. This header enables
27- object versioning for all objects in the container. With a comparable
28- ``archive `` container in place, changes to objects in the ``current ``
29- container automatically create non-current versions in the ``archive ``
30- container.
31-
32- The ``X-Versions-Mode `` header defines the behavior of ``DELETE `` requests to
33- objects in the versioned container. In the default ``stack `` mode, deleting an
34- object will restore the most-recent version from the ``archive `` container,
35- overwriting the curent version. Alternatively you may specify ``history ``
36- mode, where deleting an object will copy the current version to the
37- ``archive `` then remove it from the ``current `` container.
38-
39- Example Using ``stack `` Mode
40- ----------------------------
23+ To enable object versioning for a container, you must specify an "archive
24+ container" that will retain non-current versions via either the
25+ ``X-Versions-Location `` or ``X-History-Location `` header. These two headers
26+ enable two distinct modes of operation. Either mode may be used within a
27+ cluster, but only one mode may be active for any given container. You must
28+ UTF-8-encode and then URL-encode the container name before you include it in
29+ the header.
30+
31+ For both modes, **PUT ** requests will archive any pre-existing objects before
32+ writing new data, and **GET ** requests will serve the current version. **COPY **
33+ requests behave like a **GET ** followed by a **PUT **; that is, if the copy
34+ *source * is in a versioned container then the current version will be copied,
35+ and if the copy *destination * is in a versioned container then any pre-existing
36+ object will be archived before writing new data.
37+
38+ If object versioning was enabled using ``X-History-Location ``, then object
39+ **DELETE ** requests will copy the current version to the archive container then
40+ remove it from the versioned container.
41+
42+ If object versioning was enabled using ``X-Versions-Location ``, then object
43+ **DELETE ** requests will restore the most-recent version from the archive
44+ container, overwriting the curent version.
45+
46+ Example Using ``X-Versions-Location ``
47+ -------------------------------------
4148
4249#. Create the ``current `` container:
4350
4451 .. code ::
4552
46- # curl -i $publicURL/current -X PUT -H "Content-Length: 0" -H "X-Auth-Token: $token" -H "X-Versions-Location: archive" -H "X-Versions-Mode: stack"
53+ # curl -i $publicURL/current -X PUT -H "Content-Length: 0" -H "X-Auth-Token: $token" -H "X-Versions-Location: archive"
4754
4855 .. code ::
4956
@@ -169,14 +176,14 @@ Example Using ``stack`` Mode
169176 on it. If want to completely remove an object and you have five
170177 versions of it, you must **DELETE ** it five times.
171178
172- Example Using ``history `` Mode
173- ------------------------------
179+ Example Using ``X-History-Location ``
180+ ------------------------------------
174181
175182#. Create the ``current `` container:
176183
177184 .. code ::
178185
179- # curl -i $publicURL/current -X PUT -H "Content-Length: 0" -H "X-Auth-Token: $token" -H "X-Versions -Location: archive" -H "X-Versions-Mode: history "
186+ # curl -i $publicURL/current -X PUT -H "Content-Length: 0" -H "X-Auth-Token: $token" -H "X-History -Location: archive"
180187
181188 .. code ::
182189
@@ -266,7 +273,7 @@ Example Using ``history`` Mode
266273#. Issue a **DELETE ** request to a versioned object to copy the
267274 current version of the object to the archive container then delete it from
268275 the current container. Subsequent **GET ** requests to the object in the
269- current container will return 404 Not Found.
276+ current container will return `` 404 Not Found `` .
270277
271278 .. code ::
272279
0 commit comments