Repository: libcloud Updated Branches: refs/heads/trunk 00225d904 -> 0a1f67b32
Fix docstrings. Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/ca644173 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/ca644173 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/ca644173 Branch: refs/heads/trunk Commit: ca6441739b8a56c61d8224747bc16633d2ee4079 Parents: 00225d9 Author: Tomaz Muraus <[email protected]> Authored: Sat Sep 27 19:42:35 2014 +0200 Committer: Tomaz Muraus <[email protected]> Committed: Sat Sep 27 20:02:35 2014 +0200 ---------------------------------------------------------------------- libcloud/common/abiquo.py | 3 +- libcloud/common/base.py | 2 +- libcloud/common/google.py | 62 ++++++++++++++++++++++-------------------- libcloud/common/linode.py | 14 +++------- libcloud/pricing.py | 2 +- 5 files changed, 40 insertions(+), 43 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/ca644173/libcloud/common/abiquo.py ---------------------------------------------------------------------- diff --git a/libcloud/common/abiquo.py b/libcloud/common/abiquo.py index f621b2a..041a9ff 100644 --- a/libcloud/common/abiquo.py +++ b/libcloud/common/abiquo.py @@ -192,7 +192,8 @@ class AbiquoConnection(ConnectionUserAndKey, PollingConnection): :type headers: ``dict`` :param headers: Default input headers - :rtype ``dict`` + + :rtype: ``dict`` :return: Default input headers with the 'Authorization' header """ http://git-wip-us.apache.org/repos/asf/libcloud/blob/ca644173/libcloud/common/base.py ---------------------------------------------------------------------- diff --git a/libcloud/common/base.py b/libcloud/common/base.py index 1d05b4b..75200b4 100644 --- a/libcloud/common/base.py +++ b/libcloud/common/base.py @@ -852,7 +852,7 @@ class PollingConnection(Connection): :type context: ``dict`` :param context: Context dictionary which is passed to the functions - which construct initial and poll URL. + which construct initial and poll URL. :return: An :class:`Response` instance. :rtype: :class:`Response` instance http://git-wip-us.apache.org/repos/asf/libcloud/blob/ca644173/libcloud/common/google.py ---------------------------------------------------------------------- diff --git a/libcloud/common/google.py b/libcloud/common/google.py index 725c383..52692e6 100644 --- a/libcloud/common/google.py +++ b/libcloud/common/google.py @@ -26,38 +26,40 @@ _Console: https://cloud.google.com/console Setting up Service Account authentication (note that you need the PyCrypto package installed to use this): - - Go to the Console - - Go to your project and then to "APIs & auth" on the left - - Click on "Credentials" - - Click on "Create New Client ID..." - - Select "Service account" and click on "Create Client ID" - - Download the Private Key (should happen automatically). - - The key that you download is a PKCS12 key. It needs to be converted to - the PEM format. - - Convert the key using OpenSSL (the default password is 'notasecret'): - ``openssl pkcs12 -in YOURPRIVKEY.p12 -nodes -nocerts - -passin pass:notasecret | openssl rsa -out PRIV.pem`` - - Move the .pem file to a safe location. - - To Authenticate, you will need to pass the Service Account's "Email - address" in as the user_id and the path to the .pem file as the key. + +- Go to the Console +- Go to your project and then to "APIs & auth" on the left +- Click on "Credentials" +- Click on "Create New Client ID..." +- Select "Service account" and click on "Create Client ID" +- Download the Private Key (should happen automatically). +- The key that you download is a PKCS12 key. It needs to be converted to + the PEM format. +- Convert the key using OpenSSL (the default password is 'notasecret'): + ``openssl pkcs12 -in YOURPRIVKEY.p12 -nodes -nocerts + -passin pass:notasecret | openssl rsa -out PRIV.pem`` +- Move the .pem file to a safe location. +- To Authenticate, you will need to pass the Service Account's "Email + address" in as the user_id and the path to the .pem file as the key. Setting up Installed Application authentication: - - Go to the Console - - Go to your project and then to "APIs & auth" on the left - - Click on "Credentials" - - Select "Installed application" and "Other" then click on - "Create Client ID" - - To Authenticate, pass in the "Client ID" as the user_id and the "Client - secret" as the key - - The first time that you do this, the libcloud will give you a URL to - visit. Copy and paste the URL into a browser. - - When you go to the URL it will ask you to log in (if you aren't already) - and ask you if you want to allow the project access to your account. - - Click on Accept and you will be given a code. - - Paste that code at the prompt given to you by the Google libcloud - connection. - - At that point, a token & refresh token will be stored in your home - directory and will be used for authentication. + +- Go to the Console +- Go to your project and then to "APIs & auth" on the left +- Click on "Credentials" +- Select "Installed application" and "Other" then click on + "Create Client ID" +- To Authenticate, pass in the "Client ID" as the user_id and the "Client + secret" as the key +- The first time that you do this, the libcloud will give you a URL to + visit. Copy and paste the URL into a browser. +- When you go to the URL it will ask you to log in (if you aren't already) + and ask you if you want to allow the project access to your account. +- Click on Accept and you will be given a code. +- Paste that code at the prompt given to you by the Google libcloud + connection. +- At that point, a token & refresh token will be stored in your home + directory and will be used for authentication. Please remember to secure your keys and access tokens. """ http://git-wip-us.apache.org/repos/asf/libcloud/blob/ca644173/libcloud/common/linode.py ---------------------------------------------------------------------- diff --git a/libcloud/common/linode.py b/libcloud/common/linode.py index 2d60500..fb6ea2b 100644 --- a/libcloud/common/linode.py +++ b/libcloud/common/linode.py @@ -63,19 +63,13 @@ class LinodeException(Exception): class LinodeResponse(JsonResponse): - """Linode API response - - Wraps the HTTP response returned by the Linode API, which should be JSON in - this structure: + """ + Linode API response - { - "ERRORARRAY": [ ... ], - "DATA": [ ... ], - "ACTION": " ... " - } + Wraps the HTTP response returned by the Linode API. libcloud does not take advantage of batching, so a response will always - reflect the above format. A few weird quirks are caught here as well. + reflect the above format. A few weird quirks are caught here as well. """ objects = None http://git-wip-us.apache.org/repos/asf/libcloud/blob/ca644173/libcloud/pricing.py ---------------------------------------------------------------------- diff --git a/libcloud/pricing.py b/libcloud/pricing.py index 1dbdf20..cc2506f 100644 --- a/libcloud/pricing.py +++ b/libcloud/pricing.py @@ -70,7 +70,7 @@ def get_pricing(driver_type, driver_name, pricing_file_path=None): :type driver_type: ``str`` :param driver_type: Driver type ('compute' or 'storage') - :type driver_name: ``str` + :type driver_name: ``str`` :param driver_name: Driver name :type pricing_file_path: ``str``
