Search in sources :

Example 1 with ClusterListResponse

use of org.pmiops.workbench.model.ClusterListResponse in project workbench by all-of-us.

the class ClusterController method listClusters.

@Override
public ResponseEntity<ClusterListResponse> listClusters() {
    String project = userProvider.get().getFreeTierBillingProjectName();
    org.pmiops.workbench.notebooks.model.Cluster fcCluster;
    try {
        fcCluster = this.notebooksService.getCluster(project, DEFAULT_CLUSTER_NAME);
    } catch (NotFoundException e) {
        fcCluster = this.notebooksService.createCluster(project, DEFAULT_CLUSTER_NAME, createFirecloudClusterRequest());
    }
    ClusterListResponse resp = new ClusterListResponse();
    resp.setDefaultCluster(TO_ALL_OF_US_CLUSTER.apply(fcCluster));
    return ResponseEntity.ok(resp);
}
Also used : ClusterListResponse(org.pmiops.workbench.model.ClusterListResponse) NotFoundException(org.pmiops.workbench.exceptions.NotFoundException)

Aggregations

NotFoundException (org.pmiops.workbench.exceptions.NotFoundException)1 ClusterListResponse (org.pmiops.workbench.model.ClusterListResponse)1