libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthonys...@apache.org
Subject [07/34] libcloud git commit: it runs
Date Thu, 22 Jun 2017 03:11:11 GMT
it runs


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/78c72b15
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/78c72b15
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/78c72b15

Branch: refs/heads/trunk
Commit: 78c72b15787279125110026a0c42bb1dbdf65239
Parents: b970421
Author: andy <andymaheshw@gmail.com>
Authored: Fri Jun 9 23:17:09 2017 -0400
Committer: andy <andymaheshw@gmail.com>
Committed: Fri Jun 9 23:17:09 2017 -0400

----------------------------------------------------------------------
 libcloud/container/drivers/gke.py | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/78c72b15/libcloud/container/drivers/gke.py
----------------------------------------------------------------------
diff --git a/libcloud/container/drivers/gke.py b/libcloud/container/drivers/gke.py
index 02bb33f..6900952 100644
--- a/libcloud/container/drivers/gke.py
+++ b/libcloud/container/drivers/gke.py
@@ -46,6 +46,18 @@ class GKEConnection(GoogleBaseConnection):
         self.request_path = '%s/projects/%s' % (API_VERSION, project)
         self.gce_params = None
 
+    def pre_connect_hook(self, params, headers):
+        """
+        Update URL parameters with values from self.gce_params.
+
+        @inherits: :class:`GoogleBaseConnection.pre_connect_hook`
+        """
+        params, headers = super(GKEConnection, self).pre_connect_hook(params,
+                                                                      headers)
+        if self.gce_params:
+            params.update(self.gce_params)
+        return params, headers
+
     def request(self, *args, **kwargs):
         """
         Perform request then do GCE-specific processing of URL params.
@@ -85,7 +97,7 @@ class GKEContainerDriver(KubernetesContainerDriver):
     website = 'https://container.googleapis.com'
     supports_clusters = True
 
-    AUTH_URL = "https://www.googleapis.com/auth/cloudplatform"
+    AUTH_URL = "https://container.googleapis.com/auth/"
 
     BACKEND_SERVICE_PROTOCOLS = ['HTTP', 'HTTPS', 'HTTP2', 'TCP', 'SSL']
 
@@ -159,3 +171,12 @@ class GKEContainerDriver(KubernetesContainerDriver):
         print(self.website+self.base_path)
         response = self.connection.request(request, method='GET').object
         print(response)
+
+    def get_server_config(self, zone=None):
+        """
+        """
+        request = "/zones/%s/serverconfig" % (zone)
+        # https://container.googleapis.com/v1/projects/{projectId}/zones/{zone}/clusters
+        print(self.website+self.base_path)
+        response = self.connection.request(request, method='GET').object
+        print(response)


Mime
View raw message