def TeardownCluster(self):
    self.cluster_info.SetStatus(datastore.ClusterStatus.TEARING_DOWN)
    name_filter = 'name eq "%s|%s"'% (
        self.master_name, self.worker_name_pattern)
    logging.info('Delete instances:')
    self._DeleteResource(
        name_filter, self._GetApi().ListInstances,
        self._GetApi().DeleteInstance, self._GetApi().GetInstance)

    logging.info('Delete disks:')
    self._DeleteResource(
        name_filter, self._GetApi().ListDisks,
        self._GetApi().DeleteDisk, self._GetApi().GetDisk)

    self.cluster_info.key.delete()
Deletes Compute Engine instances with likely names.
dataset/ETHPy150Open GoogleCloudPlatform/Data-Pipeline/app/src/hadoop/hadoop_cluster.py/HadoopCluster.TeardownCluster