def execute(self, context) -> str:
     hook = GKEHook(
         gcp_conn_id=self.gcp_conn_id,
         location=self.location,
         impersonation_chain=self.impersonation_chain,
     )
     create_op = hook.create_cluster(cluster=self.body, project_id=self.project_id)
     return create_op
 def execute(self, context) -> Optional[str]:
     hook = GKEHook(
         gcp_conn_id=self.gcp_conn_id,
         location=self.location,
         impersonation_chain=self.impersonation_chain,
     )
     delete_result = hook.delete_cluster(name=self.name, project_id=self.project_id)
     return delete_result
Ejemplo n.º 3
0
 def execute(self, context: 'Context') -> str:
     hook = GKEHook(
         gcp_conn_id=self.gcp_conn_id,
         location=self.location,
         impersonation_chain=self.impersonation_chain,
     )
     create_op = hook.create_cluster(cluster=self.body,
                                     project_id=self.project_id)
     KubernetesEngineClusterLink.persist(context=context,
                                         task_instance=self,
                                         cluster=self.body)
     return create_op
Ejemplo n.º 4
0
 def setUp(self):
     self.gke_hook = GKEHook(location=GKE_ZONE)
     self.gke_hook._client = mock.Mock()
Ejemplo n.º 5
0
 def setUp(self):
     self.gke_hook = GKEHook(location=GKE_ZONE)
 def execute(self, context):
     hook = GKEHook(gcp_conn_id=self.gcp_conn_id, location=self.location)
     delete_result = hook.delete_cluster(name=self.name,
                                         project_id=self.project_id)
     return delete_result
 def execute(self, context):
     hook = GKEHook(gcp_conn_id=self.gcp_conn_id, location=self.location)
     create_op = hook.create_cluster(cluster=self.body,
                                     project_id=self.project_id)
     return create_op