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
765 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(endpointID) {
try {
return await this.KubernetesHealth.ping({ id: endpointID }).$promise;
} catch (err) {
throw new PortainerError('Unable to retrieve environment health', err);
}
}
ping(endpointID) {
return this.$async(this.pingAsync, endpointID);
}
}
export default KubernetesHealthService;
angular.module('portainer.kubernetes').service('KubernetesHealthService', KubernetesHealthService);