From 727792da17ac5edcfc2df7dd820dbccf318554fe Mon Sep 17 00:00:00 2001
From: Steve Martinelli <stevemar@ca.ibm.com>
Date: Fri, 16 Oct 2015 02:08:05 -0400
Subject: [PATCH] autodocument commands from plugins using stevedore.sphinxext

conflicting command names are a painpoint, so is manually updating
a list. let's autodocument the commands that are being use by
existing osc supporters.

Change-Id: If37d81dfd57cc79803668b64be1ccd776e319572
---
 doc/source/commands.rst        |  3 ++-
 doc/source/conf.py             |  1 +
 doc/source/index.rst           |  1 +
 doc/source/plugin-commands.rst | 32 ++++++++++++++++++++++++++++++++
 test-requirements.txt          | 11 +++++++++++
 5 files changed, 47 insertions(+), 1 deletion(-)
 create mode 100644 doc/source/plugin-commands.rst

diff --git a/doc/source/commands.rst b/doc/source/commands.rst
index e0742ab441..606989504b 100644
--- a/doc/source/commands.rst
+++ b/doc/source/commands.rst
@@ -126,7 +126,8 @@ Plugin Objects
 --------------
 
 The following are known `Objects` used by OpenStack :doc:`plugins`. These are
-listed here to avoid name conflicts when creating new plugins.
+listed here to avoid name conflicts when creating new plugins. For a complete
+list check out :doc:`plugin-commands`.
 
 * ``baremetal``: (**Baremetal (Ironic)**)
 * ``congress datasource``: (**Policy (Congress)**)
diff --git a/doc/source/conf.py b/doc/source/conf.py
index f4434ec154..792ba40a41 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -38,6 +38,7 @@ extensions = ['sphinx.ext.autodoc',
               'sphinx.ext.todo',
               'oslosphinx',
               'ext.apidoc',
+              'stevedore.sphinxext',
               ]
 
 # Add any paths that contain templates here, relative to this directory.
diff --git a/doc/source/index.rst b/doc/source/index.rst
index c1fbbe39fd..49929972c3 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -16,6 +16,7 @@ User Documentation
    commands
    configuration
    plugins
+   plugin-commands
    authentication
    interactive
    humaninterfaceguide
diff --git a/doc/source/plugin-commands.rst b/doc/source/plugin-commands.rst
new file mode 100644
index 0000000000..893c4c4968
--- /dev/null
+++ b/doc/source/plugin-commands.rst
@@ -0,0 +1,32 @@
+=================
+ Plugin Commands
+=================
+
+.. list-plugins:: openstack.cli.extension
+
+.. list-plugins:: openstack.key_manager.v1
+   :detailed:
+
+.. list-plugins:: openstack.baremetal.v1
+   :detailed:
+
+.. list-plugins:: openstack.congressclient.v1
+   :detailed:
+
+.. list-plugins:: openstack.workflow_engine.v2
+   :detailed:
+
+.. list-plugins:: openstack.data_processing.v1
+   :detailed:
+
+.. list-plugins:: openstack.dns.v1
+   :detailed:
+
+.. list-plugins:: openstack.management.v1
+   :detailed:
+
+.. list-plugins:: openstack.messaging.v1
+   :detailed:
+
+.. list-plugins:: openstack.orchestration.v1
+   :detailed:
diff --git a/test-requirements.txt b/test-requirements.txt
index c02ebf0ea4..05b95f758a 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -16,3 +16,14 @@ testrepository>=0.0.18
 testtools>=1.4.0
 WebOb>=1.2.3
 tempest-lib>=0.10.0
+
+# Install these to generate sphinx autodocs
+python-barbicanclient>=3.3.0
+python-congressclient>=1.0.0
+python-designateclient>=1.5.0
+python-heatclient>=0.6.0
+python-ironicclient>=0.8.0
+python-mistralclient>=1.0.0
+python-saharaclient>=0.10.0
+python-tuskarclient>=0.1.17
+python-zaqarclient>=0.3.0