You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/kubernetes/services/healthService.js

31 lines
715 B

import angular from 'angular';
import PortainerError from 'Portainer/error';
class KubernetesHealthService {
/* @ngInject */
constructor($async, KubernetesHealth) {
this.$async = $async;
this.KubernetesHealth = KubernetesHealth;
this.pingAsync = this.pingAsync.bind(this);
}
/**
* PING
*/
async pingAsync() {
try {
return await this.KubernetesHealth.ping().$promise;
} catch (err) {
throw new PortainerError('Unable to retrieve environment health', err);
}
}
ping() {
return this.$async(this.pingAsync);
}
}
export default KubernetesHealthService;
angular.module('portainer.kubernetes').service('KubernetesHealthService', KubernetesHealthService);