Use Google Compute APIs to list/edit clusters

This commit is contained in:
2018-04-23 09:54:12 -05:00
parent 6584f2094b
commit e8a29df069
2 changed files with 10 additions and 6 deletions
+10
View File
@@ -20,6 +20,16 @@ def ssd_type(project, zone):
return "projects/{0}/zones/{1}/diskTypes/pd-ssd".format(project, zone)
class Cluster(object):
def __init__(self, obj, api=None):
self.api = api
self.name = obj['name']
self.id = obj['id']
self.created_at = obj['creationTimestamp']
self.link = obj['selfLink']
self.status = obj['status']
class NodePool(object):
def __init__(self, obj, api=None):
self.api = api
-6
View File
@@ -4,12 +4,6 @@ from kubernetes.stream import stream
POD_NAMESPACE = 'default'
class Cluster(object):
def __init__(self, cluster, api=None):
self.api = api
self.cluster = cluster
class Node(object):
def __init__(self, node, api=None):
self.api = api