summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--doc/source/cli/glance.rst (renamed from doc/source/man/glance.rst)0
-rw-r--r--doc/source/cli/index.rst31
-rw-r--r--doc/source/conf.py43
-rw-r--r--doc/source/index.rst64
-rw-r--r--doc/source/reference/api/index.rst8
-rw-r--r--doc/source/reference/apiv2.rst (renamed from doc/source/apiv2.rst)0
-rw-r--r--doc/source/reference/index.rst27
-rw-r--r--setup.cfg7
9 files changed, 82 insertions, 99 deletions
diff --git a/.gitignore b/.gitignore
index aea02f5..a407c52 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,3 +24,4 @@ glanceclient/versioninfo
releasenotes/build
# File created by docs build process
/doc/source/ref
+/doc/source/reference/api/*
diff --git a/doc/source/man/glance.rst b/doc/source/cli/glance.rst
index 8d3cac0..8d3cac0 100644
--- a/doc/source/man/glance.rst
+++ b/doc/source/cli/glance.rst
diff --git a/doc/source/cli/index.rst b/doc/source/cli/index.rst
new file mode 100644
index 0000000..01b594c
--- /dev/null
+++ b/doc/source/cli/index.rst
@@ -0,0 +1,31 @@
+=============================
+ Command-line Tool Reference
+=============================
+
+In order to use the CLI, you must provide your OpenStack username,
+password, tenant, and auth endpoint. Use the corresponding
+configuration options (``--os-username``, ``--os-password``,
+``--os-tenant-id``, and ``--os-auth-url``) or set them in environment
+variables::
+
+ export OS_USERNAME=user
+ export OS_PASSWORD=pass
+ export OS_TENANT_ID=b363706f891f48019483f8bd6503c54b
+ export OS_AUTH_URL=http://auth.example.com:5000/v2.0
+
+The command line tool will attempt to reauthenticate using your
+provided credentials for every request. You can override this behavior
+by manually supplying an auth token using ``--os-image-url`` and
+``--os-auth-token``. You can alternatively set these environment
+variables::
+
+ export OS_IMAGE_URL=http://glance.example.org:9292/
+ export OS_AUTH_TOKEN=3bcc3d3a03f44e3d8377f9247b0ad155
+
+Once you've configured your authentication parameters, you can run
+``glance help`` to see a complete listing of available commands.
+
+.. toctree::
+
+ glance
+
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 4c22042..0056074 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -19,49 +19,6 @@ import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__),
'..', '..')))
-BASE_DIR = os.path.dirname(os.path.abspath(__file__))
-ROOT = os.path.abspath(os.path.join(BASE_DIR, "..", ".."))
-
-
-def gen_ref(ver, title, names):
- refdir = os.path.join(BASE_DIR, "ref")
- pkg = "glanceclient"
- if ver:
- pkg = "%s.%s" % (pkg, ver)
- refdir = os.path.join(refdir, ver)
- if not os.path.exists(refdir):
- os.makedirs(refdir)
- idxpath = os.path.join(refdir, "index.rst")
- with open(idxpath, "w") as idx:
- idx.write(("%(title)s\n"
- "%(signs)s\n"
- "\n"
- ".. toctree::\n"
- " :maxdepth: 1\n"
- "\n") % {"title": title, "signs": "=" * len(title)})
- for name in names:
- idx.write(" %s\n" % name)
- rstpath = os.path.join(refdir, "%s.rst" % name)
- with open(rstpath, "w") as rst:
- rst.write(("%(title)s\n"
- "%(signs)s\n"
- "\n"
- ".. automodule:: %(pkg)s.%(name)s\n"
- " :members:\n"
- " :undoc-members:\n"
- " :show-inheritance:\n"
- " :noindex:\n")
- % {"title": name.capitalize(),
- "signs": "=" * len(name),
- "pkg": pkg, "name": name})
-
-gen_ref(None, "API", ["client", "exc"])
-gen_ref("v1", "OpenStack Images Version 1 Client Reference",
- ["client", "images", "image_members"])
-gen_ref("v2", "OpenStack Images Version 2 Client Reference",
- ["client", "images", "image_tags",
- "image_members", "tasks", "metadefs"])
-
# -- General configuration ----------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
diff --git a/doc/source/index.rst b/doc/source/index.rst
index b75bc6a..1be7eff 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -1,61 +1,15 @@
-Python Bindings for the OpenStack Images API
-============================================
+==============================================
+ Python Bindings for the OpenStack Images API
+==============================================
-This is a client for the OpenStack Images API. There's :doc:`a Python API <ref/index>` (the :mod:`glanceclient` module) and a :doc:`command-line script<man/glance>` (installed as :program:`glance`).
+This is a client for the OpenStack Images API. There's :doc:`a Python
+API <library/api/index>` (the :mod:`glanceclient` module) and a
+:doc:`command-line script <cli/glance>` (installed as
+:program:`glance`).
-Python API
-----------
-In order to use the python api directly, you must first obtain an auth token and identify which endpoint you wish to speak to. Once you have done so, you can use the API like so::
-
- >>> from glanceclient import Client
- >>> glance = Client('1', endpoint=OS_IMAGE_ENDPOINT, token=OS_AUTH_TOKEN)
- >>> image = glance.images.create(name="My Test Image")
- >>> print image.status
- 'queued'
- >>> image.update(data=open('/tmp/myimage.iso', 'rb'))
- >>> print image.status
- 'active'
- >>> image.update(properties=dict(my_custom_property='value'))
- >>> with open('/tmp/copyimage.iso', 'wb') as f:
- for chunk in image.data():
- f.write(chunk)
- >>> image.delete()
-
-Python API Reference
-~~~~~~~~~~~~~~~~~~~~
.. toctree::
:maxdepth: 2
- ref/index
- ref/v1/index
- ref/v2/index
-
-.. toctree::
- :maxdepth: 1
-
- How to use the v2 API <apiv2>
-
-Command-line Tool Reference
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. toctree::
- :maxdepth: 1
-
- man/glance
-
-Command-line Tool
------------------
-In order to use the CLI, you must provide your OpenStack username, password, tenant, and auth endpoint. Use the corresponding configuration options (``--os-username``, ``--os-password``, ``--os-tenant-id``, and ``--os-auth-url``) or set them in environment variables::
-
- export OS_USERNAME=user
- export OS_PASSWORD=pass
- export OS_TENANT_ID=b363706f891f48019483f8bd6503c54b
- export OS_AUTH_URL=http://auth.example.com:5000/v2.0
-
-The command line tool will attempt to reauthenticate using your provided credentials for every request. You can override this behavior by manually supplying an auth token using ``--os-image-url`` and ``--os-auth-token``. You can alternatively set these environment variables::
-
- export OS_IMAGE_URL=http://glance.example.org:9292/
- export OS_AUTH_TOKEN=3bcc3d3a03f44e3d8377f9247b0ad155
-
-Once you've configured your authentication parameters, you can run ``glance help`` to see a complete listing of available commands.
+ reference/index
+ cli/index
-See also :doc:`/man/glance`.
diff --git a/doc/source/reference/api/index.rst b/doc/source/reference/api/index.rst
new file mode 100644
index 0000000..df916b6
--- /dev/null
+++ b/doc/source/reference/api/index.rst
@@ -0,0 +1,8 @@
+======================
+ Python API Reference
+======================
+
+.. toctree::
+ :maxdepth: 2
+
+ autoindex
diff --git a/doc/source/apiv2.rst b/doc/source/reference/apiv2.rst
index 3f75bc6..3f75bc6 100644
--- a/doc/source/apiv2.rst
+++ b/doc/source/reference/apiv2.rst
diff --git a/doc/source/reference/index.rst b/doc/source/reference/index.rst
new file mode 100644
index 0000000..33ce8b2
--- /dev/null
+++ b/doc/source/reference/index.rst
@@ -0,0 +1,27 @@
+==========================
+ Python Library Reference
+==========================
+
+In order to use the python api directly, you must first obtain an auth
+token and identify which endpoint you wish to speak to. Once you have
+done so, you can use the API like so::
+
+ >>> from glanceclient import Client
+ >>> glance = Client('1', endpoint=OS_IMAGE_ENDPOINT, token=OS_AUTH_TOKEN)
+ >>> image = glance.images.create(name="My Test Image")
+ >>> print image.status
+ 'queued'
+ >>> image.update(data=open('/tmp/myimage.iso', 'rb'))
+ >>> print image.status
+ 'active'
+ >>> image.update(properties=dict(my_custom_property='value'))
+ >>> with open('/tmp/copyimage.iso', 'wb') as f:
+ for chunk in image.data():
+ f.write(chunk)
+ >>> image.delete()
+
+.. toctree::
+ :maxdepth: 2
+
+ api/index
+ apiv2
diff --git a/setup.cfg b/setup.cfg
index e0510ae..8276c63 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -36,7 +36,6 @@ console_scripts =
[build_sphinx]
builders = html,man
all-files = 1
-warning-is-error = 1
source-dir = doc/source
build-dir = doc/build
@@ -45,3 +44,9 @@ upload-dir = doc/build/html
[wheel]
universal = 1
+
+[pbr]
+autodoc_index_modules = True
+autodoc_exclude_modules =
+ glanceclient.tests.*
+api_doc_dir = reference/api