2018-03-17 18:26:18 +05:30
|
|
|
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,
|
2018-11-08 19:23:39 +05:30
|
|
|
jupyter: this.options.installJupyterEndpoint,
|
2018-12-13 13:39:08 +05:30
|
|
|
knative: this.options.installKnativeEndpoint,
|
2018-03-17 18:26:18 +05:30
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
fetchData() {
|
|
|
|
return axios.get(this.options.endpoint);
|
|
|
|
}
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
installApplication(appId, params) {
|
|
|
|
return axios.post(this.appInstallEndpointMap[appId], params);
|
2018-03-17 18:26:18 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
static updateCluster(endpoint, data) {
|
|
|
|
return axios.put(endpoint, data);
|
|
|
|
}
|
|
|
|
}
|