Merge "Change Examples from headings to topics"

This commit is contained in:
Jenkins 2016-09-05 18:55:01 +00:00 committed by Gerrit Code Review
commit 0feb83a00c

View File

@ -312,9 +312,9 @@ method docstring.
Valid calls for this method are as follows: Valid calls for this method are as follows:
* ``stat([options])``: Returns stats for the configured account. * ``stat([options])``: Returns stats for the configured account.
* ``stat(<container>, [options])``: Returns stats for the given container. * ``stat(<container>, [options])``: Returns stats for the given container.
* ``stat(<container>, <object_list>, [options])``: Returns stats for each * ``stat(<container>, <object_list>, [options])``: Returns stats for each
of the given objects in the the given container (through the returned of the given objects in the the given container (through the returned
iterator). iterator).
@ -371,14 +371,13 @@ operation was not successful, and will include the keys below:
'error_timestamp': <timestamp> 'error_timestamp': <timestamp>
} }
Example .. topic:: Example
^^^^^^^
The code below demonstrates the use of ``stat`` to retrieve the headers for a The code below demonstrates the use of ``stat`` to retrieve the headers for
given list of objects in a container using 20 threads. The code creates a a given list of objects in a container using 20 threads. The code creates a
mapping from object name to headers which is then pretty printed to the log. mapping from object name to headers which is then pretty printed to the log.
.. literalinclude:: ../../examples/stat.py .. literalinclude:: ../../examples/stat.py
:language: python :language: python
List List
@ -438,13 +437,12 @@ dictionary as described below:
'error_timestamp': <timestamp> 'error_timestamp': <timestamp>
} }
Example .. topic:: Example
^^^^^^^
The code below demonstrates the use of ``list`` to list all items in a The code below demonstrates the use of ``list`` to list all items in a
container that are over 10MiB in size: container that are over 10MiB in size:
.. literalinclude:: ../../examples/list.py .. literalinclude:: ../../examples/list.py
:language: python :language: python
Post Post
@ -484,13 +482,12 @@ described below:
that each time user metadata is updated, the complete set of desired that each time user metadata is updated, the complete set of desired
key-value pairs must be specified. key-value pairs must be specified.
Example .. topic:: Example
^^^^^^^
The code below demonstrates the use of ``post`` to set an archive folder in a The code below demonstrates the use of ``post`` to set an archive folder in
given container to expire after a 24 hour delay: a given container to expire after a 24 hour delay:
.. literalinclude:: ../../examples/post.py .. literalinclude:: ../../examples/post.py
:language: python :language: python
Download Download
@ -552,13 +549,12 @@ below:
'response_dict': <HTTP response details> 'response_dict': <HTTP response details>
} }
Example .. topic:: Example
^^^^^^^
The code below demonstrates the use of ``download`` to download all PNG images The code below demonstrates the use of ``download`` to download all PNG
from a dated archive folder in a given container: images from a dated archive folder in a given container:
.. literalinclude:: ../../examples/download.py .. literalinclude:: ../../examples/download.py
:language: python :language: python
Upload Upload
@ -646,15 +642,14 @@ below:
'attempts': <attempt count> 'attempts': <attempt count>
} }
Example .. topic:: Example
^^^^^^^
The code below demonstrates the use of ``upload`` to upload all files and The code below demonstrates the use of ``upload`` to upload all files and
folders in a given directory, and rename each object by replacing the root folders in a given directory, and rename each object by replacing the root
directory name with 'my-<d>-objects', where <d> is the name of the uploaded directory name with 'my-<d>-objects', where <d> is the name of the uploaded
directory: directory:
.. literalinclude:: ../../examples/upload.py .. literalinclude:: ../../examples/upload.py
:language: python :language: python
Delete Delete
@ -744,16 +739,15 @@ below:
'response_dict': <HTTP response details> 'response_dict': <HTTP response details>
} }
Example .. topic:: Example
^^^^^^^
The code below demonstrates the use of ``delete`` to remove a given list of The code below demonstrates the use of ``delete`` to remove a given list of
objects from a specified container. As the objects are deleted the transaction objects from a specified container. As the objects are deleted the
ID of the relevant request is printed along with the object name and number transaction ID of the relevant request is printed along with the object name
of attempts required. By printing the transaction ID, the printed operations and number of attempts required. By printing the transaction ID, the printed
can be easily linked to events in the swift server logs: operations can be easily linked to events in the swift server logs:
.. literalinclude:: ../../examples/delete.py .. literalinclude:: ../../examples/delete.py
:language: python :language: python
Copy Copy
@ -810,13 +804,12 @@ below:
'error_timestamp': <timestamp> 'error_timestamp': <timestamp>
} }
Example .. topic:: Example
-------
The code below demonstrates the use of ``copy`` to add new user metadata for The code below demonstrates the use of ``copy`` to add new user metadata for
objects a and b, and to copy object c to d (with added metadata). objects a and b, and to copy object c to d (with added metadata).
.. literalinclude:: ../../examples/copy.py .. literalinclude:: ../../examples/copy.py
:language: python :language: python
Capabilities Capabilities
@ -894,13 +887,12 @@ dictionary is given below:
} }
} }
Example .. topic:: Example
^^^^^^^
The code below demonstrates the use of ``capabilities`` to determine if the The code below demonstrates the use of ``capabilities`` to determine if the
Swift cluster supports static large objects, and if so, the maximum number of Swift cluster supports static large objects, and if so, the maximum number
segments that can be described in a single manifest file, along with the of segments that can be described in a single manifest file, along with the
size restrictions on those objects: size restrictions on those objects:
.. literalinclude:: ../../examples/capabilities.py .. literalinclude:: ../../examples/capabilities.py
:language: python :language: python