@@ -0,0 +1,2015 @@
+# Copyright (c) 2015, Stavros Sachtouris%0A# All rights reserved.%0A# %0A# Redistribution and use in source and binary forms, with or without%0A# modification, are permitted provided that the following conditions are met:%0A# %0A# * Redistributions of source code must retain the above copyright notice, this%0A#   list of conditions and the following disclaimer.%0A# %0A# * Redistributions in binary form must reproduce the above copyright notice,%0A#   this list of conditions and the following disclaimer in the documentation%0A#   and/or other materials provided with the distribution.%0A# %0A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS %22AS IS%22%0A# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE%0A# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE%0A# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE%0A# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL%0A# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR%0A# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER%0A# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,%0A# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE%0A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.%0A%0Afrom kamaki.clients import Client, utils, astakos, cyclades%0A%0A%0Aclass KeyAPI(Client):%0A    %22%22%22A kamaki-based API client for  public Key API%22%22%22%0A%0A    @staticmethod%0A    def get_endpoint_url(auth_url):%0A        %22%22%22Use the authentication URL and astakos to construct Key API url%22%22%22%0A        auth = astakos.AstakosClient(auth_url, '')%0A        compute_endpoint = auth.get_endpoint_url(%0A            cyclades.CycladesComputeClient.service_type)%0A        endpoint, _ = compute_endpoint.split('/compute')%0A        return utils.path4url(endpoint, 'userdata', 'keys')%0A%0A%0A%0A# utils.https.patch_ignore_ssl()%0A# print KeyAPI.get_endpoint_url('https://accounts.okeanos.grnet.gr/identity/v2.0')%0A

Create KeyAPI class + method to construct endpoint