gitlab-org--gitlab-foss/app/assets/javascripts/clusters/services/clusters_service.js

29 lines
824 B
JavaScript
Raw Normal View History

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,
2018-11-02 23:38:21 -04:00
cert_manager: this.options.installCertManagerEndpoint,
runner: this.options.installRunnerEndpoint,
prometheus: this.options.installPrometheusEndpoint,
jupyter: this.options.installJupyterEndpoint,
2018-10-25 01:38:44 -04:00
knative: this.options.installKnativeEndpoint,
};
}
fetchData() {
return axios.get(this.options.endpoint);
}
installApplication(appId, params) {
return axios.post(this.appInstallEndpointMap[appId], params);
}
2017-11-24 08:43:00 -05:00
static updateCluster(endpoint, data) {
return axios.put(endpoint, data);
}
}