From cf83528ae95d9589fecf180aa09fe3d030f0f1ee Mon Sep 17 00:00:00 2001 From: Anthony Lee Date: Fri, 12 Dec 2014 15:01:57 -0800 Subject: [PATCH] Documentation fixes Fixed various typos/errors/missing pages in the documentation. Change-Id: Ia254d472780434b159c08a8bd11004914ea9dfbc --- docs/api/hplefthandclient/http.rst | 12 ++------ docs/changelog.rst | 21 +++++++------- hplefthandclient/client.py | 44 +++++++++++++++--------------- hplefthandclient/http.py | 3 ++ 4 files changed, 38 insertions(+), 42 deletions(-) diff --git a/docs/api/hplefthandclient/http.rst b/docs/api/hplefthandclient/http.rst index e10be95..9d130ec 100644 --- a/docs/api/hplefthandclient/http.rst +++ b/docs/api/hplefthandclient/http.rst @@ -4,19 +4,11 @@ .. automodule:: hplefthandclient.http :synopsis: HTTP REST Base Class - .. autoclass::hplefthandclient.http(api_url, [insecure=False[,http_log_debug=False]]) + .. autoclass:: hplefthandclient.http.HTTPJSONRESTClient(api_url, [insecure=False[,http_log_debug=False]]) .. automethod:: authenticate .. automethod:: unauthenticate - - .. describe:: c[db_name] || c.db_name - - Get the `db_name` :class:`~pymongo.database.Database` on :class:`Connection` `c`. - - Raises :class:`~pymongo.errors.InvalidName` if an invalid database name is used. - - .. autoattribute:: api_url - .. autoattribute:: http_log_debug + .. automethod:: set_debug_flag .. automethod:: request .. automethod:: get .. automethod:: post diff --git a/docs/changelog.rst b/docs/changelog.rst index c05bc3d..c914fd7 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -5,28 +5,29 @@ Changelog Changes in Version 1.0.0 ------------------------ -- First implementation of the REST API Client +* First implementation of the REST API Client Changes in Version 1.0.1 ------------------------ -- Updated the REST API Client to be Python 3.0 compliant +* Updated the REST API Client to be Python 3.0 compliant Changes in Version 1.0.2 ------------------------ -- Added support for query parameter in getVolume +* Added support for query parameter in getVolume Changes in Version 1.0.3 ------------------------ -- Added missing Flask imports so that running unit tests against the mock LHOS +* Added missing Flask imports so that running unit tests against the mock LHOS pass -- Added new API - * Find Server Volumes -- Updated the mock Flask server to support server API +* Added new API + - Find Server Volumes +* Updated the mock Flask server to support server API calls. -- Added unit tests for server API calls. -- Added a volume unit test that makes sure that volumes are created with the +* Added unit tests for server API calls. +* Added a volume unit test that makes sure that volumes are created with the correct size. -- Added support for PEP8 checks with tox. +* Added support for PEP8 checks with tox. +* Fixed various typos in the documentation. diff --git a/hplefthandclient/client.py b/hplefthandclient/client.py index 5d85cd0..7a59dad 100644 --- a/hplefthandclient/client.py +++ b/hplefthandclient/client.py @@ -99,8 +99,8 @@ class HPLeftHandClient: :type name: str :returns: cluster - :raises: :class:`~hplefthandclient.exceptions.HTTPNotFound` - - NON_EXISTENT_CLUSTER - cluster doesn't exist + :raises: :class:`~hplefthandclient.exceptions.HTTPNotFound` + - NON_EXISTENT_CLUSTER - cluster doesn't exist """ response, body = self.http.get('/clusters?name=%s' % name) return body @@ -135,8 +135,8 @@ class HPLeftHandClient: :type name: str :returns: server - :raises: :class:`~hplefthandclient.exceptions.HTTPNotFound` - - NON_EXISTENT_SERVER - server doesn't exist + :raises: :class:`~hplefthandclient.exceptions.HTTPNotFound` + - NON_EXISTENT_SERVER - server doesn't exist """ response, body = self.http.get('/servers?name=%s' % name) return body @@ -168,8 +168,8 @@ class HPLeftHandClient: } :returns: server - :raises: :class:`~hplefthandclient.exceptions.HTTPNotFound` - - NON_EXISTENT_SERVER - server doesn't exist + :raises: :class:`~hplefthandclient.exceptions.HTTPNotFound` + - NON_EXISTENT_SERVER - server doesn't exist """ info = {'name': name, 'iscsiIQN': iqn} if optional: @@ -184,8 +184,8 @@ class HPLeftHandClient: :param server_id: the server ID to delete - :raises: :class:`~hplefthandclient.exceptions.HTTPNotFound` - - NON_EXISTENT_SERVER - The server does not exist + :raises: :class:`~hplefthandclient.exceptions.HTTPNotFound` + - NON_EXISTENT_SERVER - The server does not exist """ response, body = self.http.delete('/servers/%s' % server_id) return body @@ -216,8 +216,8 @@ class HPLeftHandClient: :param name: The name of the snapshot to find :returns: volume - :raises: :class:`~hplefthandclient.exceptions.HTTPNotFound` - - NON_EXISTENT_SNAP - shapshot doesn't exist + :raises: :class:`~hplefthandclient.exceptions.HTTPNotFound` + - NON_EXISTENT_SNAP - shapshot doesn't exist """ response, body = self.http.get('/snapshots?name=%s' % name) return body @@ -258,8 +258,8 @@ class HPLeftHandClient: :param snapshot_id: the snapshot ID to delete - :raises: :class:`~hplefthandclient.exceptions.HTTPNotFound` - - NON_EXISTENT_SNAPSHOT - The snapshot does not exist + :raises: :class:`~hplefthandclient.exceptions.HTTPNotFound` + - NON_EXISTENT_SNAPSHOT - The snapshot does not exist """ response, body = self.http.delete('/snapshots/%s' % snapshot_id) return body @@ -311,8 +311,8 @@ class HPLeftHandClient: :type volume_id: str :returns: volume - :raises: :class:`~hplefthandclient.exceptions.HTTPNotFound` - - NON_EXISTENT_VOL - volume doesn't exist + :raises: :class:`~hplefthandclient.exceptions.HTTPNotFound` + - NON_EXISTENT_VOL - volume doesn't exist """ uri = '/volumes/%s' % volume_id if query: @@ -328,8 +328,8 @@ class HPLeftHandClient: :type name: str :returns: volume - :raises: :class:`~hplefthandclient.exceptions.HTTPNotFound` - - NON_EXISTENT_VOL - volume doesn't exist + :raises: :class:`~hplefthandclient.exceptions.HTTPNotFound` + - NON_EXISTENT_VOL - volume doesn't exist """ response, body = self.http.get('/volumes?name=%s' % name) return body @@ -392,8 +392,8 @@ class HPLeftHandClient: :returns: List of Volumes - :raises: :class:`~hplefthandclient.exceptions.HTTPConflict` - - EXISTENT_SV - Volume Exists already + :raises: :class:`~hplefthandclient.exceptions.HTTPConflict` + - EXISTENT_SV - Volume Exists already """ info = {'name': name, 'clusterID': cluster_id, 'size': size} if optional: @@ -409,8 +409,8 @@ class HPLeftHandClient: :param name: the name of the volume :type name: str - :raises: :class:`~hplefthandclient.exceptions.HTTPNotFound` - - NON_EXISTENT_VOL - The volume does not exist + :raises: :class:`~hplefthandclient.exceptions.HTTPNotFound` + - NON_EXISTENT_VOL - The volume does not exist """ response, body = self.http.delete('/volumes/%s' % volume_id) return body @@ -422,8 +422,8 @@ class HPLeftHandClient: :type volume_id: str :returns: volume - :raises: :class:`~hplefthandclient.exceptions.HTTPNotFound` - - NON_EXISTENT_VOL - volume doesn't exist + :raises: :class:`~hplefthandclient.exceptions.HTTPNotFound` + - NON_EXISTENT_VOL - volume doesn't exist """ info = {'volume_id': volume_id} info = self._mergeDict(info, optional) diff --git a/hplefthandclient/http.py b/hplefthandclient/http.py index d0e1e7b..4d26dae 100644 --- a/hplefthandclient/http.py +++ b/hplefthandclient/http.py @@ -17,6 +17,9 @@ """ HPLeftHand HTTP Client + +.. module: http + :Author: Walter A. Boring IV :Description: This is the HTTP Client that is used to make the actual calls. It includes the authentication that knows the cookie name for LH.