From d5caa6a26baf2fccbf276080fef60c81ed4beae3 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Tue, 23 Dec 2014 17:04:12 -0600 Subject: [PATCH] Command object docs: container, object Change-Id: Ie3df543a28cbee0cc809310a05f431c97b2c7e70 --- doc/source/command-objects/container.rst | 105 +++++++++++++++++ doc/source/command-objects/object.rst | 140 +++++++++++++++++++++++ openstackclient/object/v1/container.py | 18 +-- openstackclient/object/v1/object.py | 32 +++--- 4 files changed, 270 insertions(+), 25 deletions(-) create mode 100644 doc/source/command-objects/container.rst create mode 100644 doc/source/command-objects/object.rst diff --git a/doc/source/command-objects/container.rst b/doc/source/command-objects/container.rst new file mode 100644 index 0000000000..3afaeb9217 --- /dev/null +++ b/doc/source/command-objects/container.rst @@ -0,0 +1,105 @@ +========= +container +========= + +Object Store v1 + +container create +---------------- + +Create new container + +.. program:: container create +.. code:: bash + + os container create + [ ...] + +.. option:: + + New container name(s) + +container delete +---------------- + +Delete container + +.. program:: container delete +.. code:: bash + + os container delete + [ ...] + +.. option:: + + Container(s) to delete + +container list +-------------- + +List containers + +.. program:: container list +.. code::bash + + os container list + [--prefix ] + [--marker ] + [--end-marker ] + [--limit ] + [--long] + [--all] + +.. option:: --prefix + + Filter list using + +.. option:: --marker + + Anchor for paging + +.. option:: --end-marker + + End anchor for paging + +.. option:: --limit + + Limit the number of containers returned + +.. option:: --long + + List additional fields in output + +.. options:: --all + + List all containers (default is 10000) + +container save +-------------- + +Save container contents locally + +.. program:: container save +.. code:: bash + + os container save + + +.. option:: + + Container to save + +container show +-------------- + +Show container details + +.. program:: container show +.. code:: bash + + os container show + [] + +.. option:: + + Container to display diff --git a/doc/source/command-objects/object.rst b/doc/source/command-objects/object.rst new file mode 100644 index 0000000000..5cbc95d71c --- /dev/null +++ b/doc/source/command-objects/object.rst @@ -0,0 +1,140 @@ +====== +object +====== + +Object Store v1 + +object create +------------- + +Upload object to container + +.. program:: object create +.. code:: bash + + os object create + + [ ...] + +.. option:: + + Container for new object + +.. option:: + + Local filename(s) to upload + +object delete +------------- + +Delete object from container + +.. program:: object delete +.. code:: bash + + os object delete + + [ ...] + +.. option:: + + Delete object(s) from + +.. option:: + + Object(s) to delete + +list object +----------- + +List objects + +.. program object list +.. code:: bash + + os object list + [--prefix ] + [--delimiter ] + [--marker ] + [--end-marker ] + [--limit ] + [--long] + [--all] + ] + +.. option:: --prefix + + Filter list using + +.. option:: --delimiter + + Roll up items with + +.. option:: --marker + + Anchor for paging + +.. option:: --end-marker + + End anchor for paging + +.. option:: --limit + + Limit number of objects returned + +.. option:: --long + + List additional fields in output + +.. options:: --all + + List all objects in (default is 10000) + +.. option:: + + Container to list + +object save +----------- + +Save object locally + +.. program:: object save +.. code:: bash + + os object save + [--file ] + [] + [] + +.. option:: --file + + Destination filename (defaults to object name) + +.. option:: + + Download from + +.. option:: + + Object to save + +object show +----------- + +Show object details + +.. program:: object show +.. code:: bash + + os object show + + + +.. option:: + + Display from + +.. option:: + + Object to display diff --git a/openstackclient/object/v1/container.py b/openstackclient/object/v1/container.py index ead3df45e9..b75888e408 100644 --- a/openstackclient/object/v1/container.py +++ b/openstackclient/object/v1/container.py @@ -27,7 +27,7 @@ from openstackclient.common import utils class CreateContainer(lister.Lister): - """Create a container""" + """Create new container""" log = logging.getLogger(__name__ + '.CreateContainer') @@ -35,9 +35,9 @@ class CreateContainer(lister.Lister): parser = super(CreateContainer, self).get_parser(prog_name) parser.add_argument( 'containers', - metavar='', + metavar='', nargs="+", - help='Container name(s) to create', + help='New container name(s)', ) return parser @@ -60,7 +60,7 @@ class CreateContainer(lister.Lister): class DeleteContainer(command.Command): - """Delete a container""" + """Delete container""" log = logging.getLogger(__name__ + '.DeleteContainer') @@ -70,7 +70,7 @@ class DeleteContainer(command.Command): 'containers', metavar='', nargs="+", - help='Container name(s) to delete', + help='Container(s) to delete', ) return parser @@ -157,7 +157,7 @@ class ListContainer(lister.Lister): class SaveContainer(command.Command): - """Save the contents of a container locally""" + """Save container contents locally""" log = logging.getLogger(__name__ + ".SaveContainer") @@ -166,7 +166,7 @@ class SaveContainer(command.Command): parser.add_argument( 'container', metavar='', - help='Container name to save', + help='Container to save', ) return parser @@ -179,7 +179,7 @@ class SaveContainer(command.Command): class ShowContainer(show.ShowOne): - """Show container information""" + """Show container details""" log = logging.getLogger(__name__ + '.ShowContainer') @@ -188,7 +188,7 @@ class ShowContainer(show.ShowOne): parser.add_argument( 'container', metavar='', - help='Container name to display', + help='Container to display', ) return parser diff --git a/openstackclient/object/v1/object.py b/openstackclient/object/v1/object.py index cbe9da2fb4..781dd047fa 100644 --- a/openstackclient/object/v1/object.py +++ b/openstackclient/object/v1/object.py @@ -27,7 +27,7 @@ from openstackclient.common import utils class CreateObject(lister.Lister): - """Upload an object to a container""" + """Upload object to container""" log = logging.getLogger(__name__ + '.CreateObject') @@ -36,13 +36,13 @@ class CreateObject(lister.Lister): parser.add_argument( 'container', metavar='', - help='Container to store new object', + help='Container for new object', ) parser.add_argument( 'objects', - metavar='', + metavar='', nargs="+", - help='Local path of object(s) to upload', + help='Local filename(s) to upload', ) return parser @@ -66,7 +66,7 @@ class CreateObject(lister.Lister): class DeleteObject(command.Command): - """Delete an object within a container""" + """Delete object from container""" log = logging.getLogger(__name__ + '.DeleteObject') @@ -75,11 +75,11 @@ class DeleteObject(command.Command): parser.add_argument( 'container', metavar='', - help='Container that stores the object to delete', + help='Delete object(s) from ', ) parser.add_argument( 'objects', - metavar='', + metavar='', nargs="+", help='Object(s) to delete', ) @@ -104,8 +104,8 @@ class ListObject(lister.Lister): parser = super(ListObject, self).get_parser(prog_name) parser.add_argument( "container", - metavar="", - help="List contents of container-name", + metavar="", + help="Container to list", ) parser.add_argument( "--prefix", @@ -188,7 +188,7 @@ class ListObject(lister.Lister): class SaveObject(command.Command): - """Save an object locally""" + """Save object locally""" log = logging.getLogger(__name__ + ".SaveObject") @@ -197,17 +197,17 @@ class SaveObject(command.Command): parser.add_argument( "--file", metavar="", - help="Downloaded object filename [defaults to object name]", + help="Destination filename (defaults to object name)", ) parser.add_argument( 'container', metavar='', - help='Container name that has the object', + help='Download from ', ) parser.add_argument( "object", metavar="", - help="Name of the object to save", + help="Object to save", ) return parser @@ -222,7 +222,7 @@ class SaveObject(command.Command): class ShowObject(show.ShowOne): - """Show object information""" + """Show object details""" log = logging.getLogger(__name__ + '.ShowObject') @@ -231,12 +231,12 @@ class ShowObject(show.ShowOne): parser.add_argument( 'container', metavar='', - help='Container name for object to display', + help='Display from ', ) parser.add_argument( 'object', metavar='', - help='Object name to display', + help='Object to display', ) return parser