Merge "Add docs for usage show/list"

This commit is contained in:
Jenkins 2015-01-02 17:54:30 +00:00 committed by Gerrit Code Review
commit 8132072630
3 changed files with 57 additions and 6 deletions

View File

@ -0,0 +1,50 @@
=====
usage
=====
Compute v2
usage list
----------
List resource usage per project
.. program:: usage list
.. code:: bash
os usage list
--start <start>
--end <end>
.. option:: --start <start>
Usage range start date, ex 2012-01-20 (default: 4 weeks ago).
.. option:: --end <end>
Usage range end date, ex 2012-01-20 (default: tomorrow)
usage show
----------
Show resource usage for a single project.
.. program:: usage show
.. code:: bash
os usage show
--project <project>
--start <start>
--end <end>
.. option:: --project <project>
Name or ID of project to show usage for.
.. option:: --start <start>
Usage range start date, ex 2012-01-20 (default: 4 weeks ago).
.. option:: --end <end>
Usage range end date, ex 2012-01-20 (default: tomorrow)

View File

@ -108,6 +108,7 @@ referring to both Compute and Volume quotas.
* ``service``: Identity - a cloud service
* ``snapshot``: Volume - a point-in-time copy of a volume
* ``token``: (**Identity**) a bearer token managed by Identity service
* ``usage``: (**Compute**) display host resources being consumed
* ``user``: (**Identity**) individual cloud resources users
* ``user role``: (**Identity**) roles assigned to a user
* ``volume``: Volume - block volumes

View File

@ -125,6 +125,12 @@ class ShowUsage(show.ShowOne):
def get_parser(self, prog_name):
parser = super(ShowUsage, self).get_parser(prog_name)
parser.add_argument(
"--project",
metavar="<project>",
default=None,
help="Name or ID of project to show usage for."
)
parser.add_argument(
"--start",
metavar="<start>",
@ -138,12 +144,6 @@ class ShowUsage(show.ShowOne):
default=None,
help="Usage range end date, ex 2012-01-20 (default: tomorrow)."
)
parser.add_argument(
"--project",
metavar="<project>",
default=None,
help="Name or ID of project to show usage for."
)
return parser
def take_action(self, parsed_args):