docs: Add all commands help
This change add gnocchi.rst with all commands help. And validate the doc with doc8. Change-Id: I1b7c8f675165d3d193d28b06357c05ad01c3a901
This commit is contained in:
parent
5f2a369713
commit
1ef64d5fd5
|
@ -55,3 +55,4 @@ ChangeLog
|
||||||
|
|
||||||
# generated docs
|
# generated docs
|
||||||
doc/source/api
|
doc/source/api
|
||||||
|
doc/source/gnocchi.rst
|
||||||
|
|
|
@ -26,6 +26,7 @@ sys.path.insert(0, BASE_DIR)
|
||||||
# Add any Sphinx extension module names here, as strings. They can be
|
# Add any Sphinx extension module names here, as strings. They can be
|
||||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||||
extensions = [
|
extensions = [
|
||||||
|
'gnocchiclient.gendoc',
|
||||||
'sphinx.ext.autodoc',
|
'sphinx.ext.autodoc',
|
||||||
#'sphinx.ext.intersphinx'
|
#'sphinx.ext.intersphinx'
|
||||||
]
|
]
|
||||||
|
|
|
@ -7,6 +7,9 @@ The :program:`gnocchi` shell utility
|
||||||
The :program:`gnocchi` shell utility interacts with Gnocchi from the command
|
The :program:`gnocchi` shell utility interacts with Gnocchi from the command
|
||||||
line. It supports the entirety of the Gnocchi API.
|
line. It supports the entirety of the Gnocchi API.
|
||||||
|
|
||||||
|
Authentication method
|
||||||
|
+++++++++++++++++++++
|
||||||
|
|
||||||
You'll need to provide the authentication method and your credentials to
|
You'll need to provide the authentication method and your credentials to
|
||||||
:program:`gnocchi`.
|
:program:`gnocchi`.
|
||||||
|
|
||||||
|
@ -44,8 +47,8 @@ in your environment::
|
||||||
Basic authentication
|
Basic authentication
|
||||||
~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If you're using Gnocchi with basic authentication, export the following variables
|
If you're using Gnocchi with basic authentication, export the following
|
||||||
in your environment::
|
variables in your environment::
|
||||||
|
|
||||||
export OS_AUTH_TYPE=gnocchi-basic
|
export OS_AUTH_TYPE=gnocchi-basic
|
||||||
export GNOCCHI_USER=<youruserid>
|
export GNOCCHI_USER=<youruserid>
|
||||||
|
@ -82,28 +85,8 @@ environment variables::
|
||||||
export GNOCCHI_USER_ID=99aae-4dc2-4fbc-b5b8-9688c470d9cc
|
export GNOCCHI_USER_ID=99aae-4dc2-4fbc-b5b8-9688c470d9cc
|
||||||
export GNOCCHI_PROJECT_ID=c8d27445-48af-457c-8e0d-1de7103eae1f
|
export GNOCCHI_PROJECT_ID=c8d27445-48af-457c-8e0d-1de7103eae1f
|
||||||
|
|
||||||
Usage
|
|
||||||
=====
|
|
||||||
|
|
||||||
Once authentication is set up, all shell commands take the form::
|
Commands descriptions
|
||||||
|
+++++++++++++++++++++
|
||||||
|
|
||||||
gnocchi <command> [arguments...]
|
.. include:: gnocchi.rst
|
||||||
|
|
||||||
Run :program:`gnocchi help` to get a full list of all possible commands,
|
|
||||||
and run :program:`gnocchi help <command>` to get detailed help for that
|
|
||||||
command.
|
|
||||||
|
|
||||||
Examples
|
|
||||||
--------
|
|
||||||
|
|
||||||
Create a resource::
|
|
||||||
|
|
||||||
gnocchi resource create --attribute id:5a301761-f78b-46e2-8900-8b4f6fe6675a --attribute project_id:eba5c38f-c3dd-4d9c-9235-32d430471f94 -n temperature:high instance
|
|
||||||
|
|
||||||
List resources::
|
|
||||||
|
|
||||||
gnocchi resource list --type instance
|
|
||||||
|
|
||||||
Search of resources::
|
|
||||||
|
|
||||||
gnocchi resource search "project_id='5a301761-f78b-46e2-8900-8b4f6fe6675a' and type=instance"
|
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
# -*- encoding: utf-8 -*-
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
# not use this file except in compliance with the License. You may obtain
|
||||||
|
# a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from os_doc_tools import commands
|
||||||
|
|
||||||
|
# HACK(jd) Not sure why but Sphinx setup this multiple times, so we just avoid
|
||||||
|
# doing several times the requests by using this global variable :(
|
||||||
|
_RUN = False
|
||||||
|
|
||||||
|
|
||||||
|
def setup(app):
|
||||||
|
global _RUN
|
||||||
|
if _RUN:
|
||||||
|
return
|
||||||
|
commands.document_single_project("gnocchi", "doc/source", False)
|
||||||
|
with open("doc/source/gnocchi.rst", "r") as f:
|
||||||
|
data = f.read().splitlines(True)
|
||||||
|
for index, line in enumerate(data):
|
||||||
|
if "This chapter documents" in line:
|
||||||
|
break
|
||||||
|
with open("doc/source/gnocchi.rst", "w") as f:
|
||||||
|
f.writelines(data[index+1:])
|
||||||
|
_RUN = True
|
|
@ -84,8 +84,10 @@ test =
|
||||||
testtools>=1.4.0
|
testtools>=1.4.0
|
||||||
|
|
||||||
doc =
|
doc =
|
||||||
|
doc8
|
||||||
sphinx!=1.2.0,!=1.3b1,>=1.1.2
|
sphinx!=1.2.0,!=1.3b1,>=1.1.2
|
||||||
oslosphinx>=2.5.0 # Apache-2.0
|
oslosphinx>=2.5.0 # Apache-2.0
|
||||||
|
openstack-doc-tools>=1.0.1
|
||||||
|
|
||||||
|
|
||||||
[build_sphinx]
|
[build_sphinx]
|
||||||
|
|
5
tox.ini
5
tox.ini
|
@ -31,12 +31,15 @@ deps = .[test,doc]
|
||||||
commands =
|
commands =
|
||||||
rm -rf doc/source/ref
|
rm -rf doc/source/ref
|
||||||
python setup.py build_sphinx
|
python setup.py build_sphinx
|
||||||
|
doc8 --ignore-path doc/source/gnocchi.rst doc/source
|
||||||
|
|
||||||
[testenv:docs-gnocchi.xyz]
|
[testenv:docs-gnocchi.xyz]
|
||||||
deps = .[test,doc]
|
deps = .[test,doc]
|
||||||
sphinx_rtd_theme
|
sphinx_rtd_theme
|
||||||
setenv = SPHINX_HTML_THEME=sphinx_rtd_theme
|
setenv = SPHINX_HTML_THEME=sphinx_rtd_theme
|
||||||
commands = python setup.py build_sphinx
|
commands =
|
||||||
|
python setup.py build_sphinx
|
||||||
|
doc8 --ignore-path doc/source/gnocchi.rst doc/source
|
||||||
|
|
||||||
[testenv:debug]
|
[testenv:debug]
|
||||||
commands = pifpaf --debug run gnocchi -- oslo_debug_helper {posargs}
|
commands = pifpaf --debug run gnocchi -- oslo_debug_helper {posargs}
|
||||||
|
|
Loading…
Reference in New Issue