gitlab-org--gitlab-foss/app/assets/javascripts/clusters/services/clusters_service.js
Filipa Lacerda e1d4deb2d2 Disables jupyter install button while ingress is not installed
Includes juptyer hostname in the post request
Adds tests
2018-05-25 17:16:42 +03:00

26 lines
711 B
JavaScript

import axios from '../../lib/utils/axios_utils';
export default class ClusterService {
constructor(options = {}) {
this.options = options;
this.appInstallEndpointMap = {
helm: this.options.installHelmEndpoint,
ingress: this.options.installIngressEndpoint,
runner: this.options.installRunnerEndpoint,
prometheus: this.options.installPrometheusEndpoint,
jupyter: this.options.installJupyterEndpoint,
};
}
fetchData() {
return axios.get(this.options.endpoint);
}
installApplication(appId, params) {
return axios.post(this.appInstallEndpointMap[appId], params);
}
static updateCluster(endpoint, data) {
return axios.put(endpoint, data);
}
}