summaryrefslogtreecommitdiff
path: root/quantumclient
diff options
context:
space:
mode:
authorgongysh <gongysh@cn.ibm.com>2012-09-12 10:33:38 +0800
committergongysh <gongysh@cn.ibm.com>2012-09-12 21:09:59 +0800
commit2a45b707bd0f8b44149ba12f4473f0e5df7db364 (patch)
tree0dd27b8121dcfd6a8ea239bba28e34536d95d4b8 /quantumclient
parentf0a9235586897740e829154dfeac743eae001843 (diff)
downloadpython-neutronclient-2a45b707bd0f8b44149ba12f4473f0e5df7db364.tar.gz
Add document for using quantum client by python or cli invocation.
After this patch, we should see output at http://docs.openstack.org/developer/python-quantumclient/. Change-Id: I908c0d0e7f80a6eb73e97ee30eaab1bfbfec1e61
Diffstat (limited to 'quantumclient')
-rw-r--r--quantumclient/quantum/client.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/quantumclient/quantum/client.py b/quantumclient/quantum/client.py
index c7d7948..c89408b 100644
--- a/quantumclient/quantum/client.py
+++ b/quantumclient/quantum/client.py
@@ -26,7 +26,7 @@ API_VERSIONS = {
def make_client(instance):
- """Returns an identity service client.
+ """Returns an quantum client.
"""
quantum_client = utils.get_client_class(
API_NAME,
@@ -49,3 +49,15 @@ def make_client(instance):
else:
raise exceptions.UnsupportedVersion("API version %s is not supported" %
instance._api_version[API_NAME])
+
+
+def Client(api_version, *args, **kwargs):
+ """Return an quantum client.
+ @param api_version: only 2.0 is supported now
+ """
+ quantum_client = utils.get_client_class(
+ API_NAME,
+ api_version,
+ API_VERSIONS,
+ )
+ return quantum_client(*args, **kwargs)