Add Client object to documentation

After wanting to do a rather simple thing -- figure out of the
"timeout" argument to nodepool was a int or a float, it lead me down
the rabbit-hole to python-novaclient.

It turns out the timeout does get passed through to requests as a
float so that mystery was solved.

But the "Client" class seems to be missing from the documentation as
it's not included in the class list.  So add that and also at least
document the types of the arguments.

However, then I noticd that this wasn't showing up; turns out sphinx
requires "autoclass_content = both" if you want it to document
__init__() functions.  Several other classes had their init args
documented but they weren't showing up because of this.

Change-Id: I8f44e92f2a0f25a75926b1813a8b374e79b4f5db
This commit is contained in:
Ian Wienand 2015-03-11 15:29:14 +11:00
parent 876a3bd80a
commit e9c70598f3
2 changed files with 38 additions and 6 deletions

View File

@ -72,12 +72,12 @@ def gen_ref(ver, title, names):
gen_ref(None, "Exceptions", ["exceptions"])
gen_ref("v2", "Version 1.1, Version 2 API Reference, Version 3 API Reference",
["flavors", "images", "servers", "hosts", "agents", "aggregates",
"availability_zones", "certs", "fixed_ips", "floating_ip_pools",
"floating_ips", "hypervisors", "keypairs", "limits", "networks",
"quota_classes", "quotas", "security_group_rules",
"security_groups", "services", "virtual_interfaces",
"volume_snapshots", "volumes", "volume_types"])
["client", "flavors", "images", "servers", "hosts", "agents",
"aggregates", "availability_zones", "certs", "fixed_ips",
"floating_ip_pools", "floating_ips", "hypervisors", "keypairs",
"limits", "networks", "quota_classes", "quotas",
"security_group_rules", "security_groups", "services",
"virtual_interfaces", "volume_snapshots", "volumes", "volume_types"])
# -- General configuration ----------------------------------------------------
@ -86,6 +86,8 @@ gen_ref("v2", "Version 1.1, Version 2 API Reference, Version 3 API Reference",
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'oslosphinx']
autoclass_content = 'both'
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

View File

@ -104,6 +104,36 @@ class Client(object):
cacert=None, tenant_id=None, user_id=None,
connection_pool=False, session=None, auth=None,
**kwargs):
"""
:param str username: Username
:param str api_key: API Key
:param str project_id: Project ID
:param str auth_url: Auth URL
:param bool insecure: Allow insecure
:param float timeout: API timeout, None or 0 disables
:param str proxy_tenant_id: Tenant ID
:param str proxy_token: Proxy Token
:param str region_name: Region Name
:param str endpoint_type: Endpoint Type
:param str extensions: Exensions
:param str service_type: Service Type
:param str service_name: Service Name
:param str volume_service_name: Volume Service Name
:param bool timings: Timings
:param str bypass_url: Bypass URL
:param bool os_cache: OS cache
:param bool no_cache: No cache
:param bool http_log_debug: Enable debugging for HTTP connections
:param str auth_system: Auth system
:param str auth_plugin: Auth plugin
:param str auth_token: Auth token
:param str cacert: cacert
:param str tenant_id: Tenant ID
:param str user_id: User ID
:param bool connection_pool: Use a connection pool
:param str session: Session
:param str auth: Auth
"""
# FIXME(comstud): Rename the api_key argument above when we
# know it's not being used as keyword argument