{"size": 395, "ext": "js", "max_stars_repo_path": "src/server/api/appbert/clusters.js", "max_stars_repo_name": "xantorres/pf9-ui-plugin", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/server/api/appbert/clusters.js", "max_issues_repo_name": "xantorres/pf9-ui-plugin", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/server/api/appbert/clusters.js", "max_forks_repo_name": "xantorres/pf9-ui-plugin", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.6875, "max_line_length": 49, "alphanum_fraction": 0.6936708861}
import context from '../../context'
import Cluster from '../../models/qbert/Cluster'

const mapCluster = cluster => ({
  name: cluster.name,
  projectId: cluster.projectId,
  tags: Object.keys(cluster.tags),
  uuid: cluster.uuid,
})

export const getAppbertClusters = (req, res) => {
  const clusters = Cluster.list({ context })
  const data = clusters.map(mapCluster)
  return res.send(data)
}
