def list_clusters(self): """Lists clusters owned by the project. :rtype: tuple :returns: A pair of results, the first is a list of :class:`.Cluster` s returned and the second is a list of strings (the failed zones in the request). """ request_pb = messages_pb2.ListClustersRequest(name=self.project_name) # We expect a `.messages_pb2.ListClustersResponse` list_clusters_response = self._cluster_stub.ListClusters( request_pb, self.timeout_seconds) failed_zones = [zone.display_name for zone in list_clusters_response.failed_zones] clusters = [Cluster.from_pb(cluster_pb, self) for cluster_pb in list_clusters_response.clusters] return clusters, failed_zones
def list_clusters(self): """Lists clusters in this instance. :rtype: tuple :returns: A pair of results, the first is a list of :class:`.Cluster` s returned and the second is a list of strings (the failed locations in the request). """ request_pb = messages_v2_pb2.ListClustersRequest(parent=self.name) # We expect a `.cluster_messages_v1_pb2.ListClustersResponse` list_clusters_response = self._client._instance_stub.ListClusters( request_pb, self._client.timeout_seconds) failed_locations = [ location for location in list_clusters_response.failed_locations] clusters = [Cluster.from_pb(cluster_pb, self) for cluster_pb in list_clusters_response.clusters] return clusters, failed_locations
def list_clusters(self): """Lists clusters in this instance. :rtype: tuple :returns: A pair of results, the first is a list of :class:`.Cluster` s returned and the second is a list of strings (the failed locations in the request). """ request_pb = messages_v2_pb2.ListClustersRequest(parent=self.name) # We expect a `.cluster_messages_v1_pb2.ListClustersResponse` list_clusters_response = self._client._instance_stub.ListClusters( request_pb, self._client.timeout_seconds) failed_locations = [ location for location in list_clusters_response.failed_locations ] clusters = [ Cluster.from_pb(cluster_pb, self) for cluster_pb in list_clusters_response.clusters ] return clusters, failed_locations