maestro/app/classes/state/os/IsAliveState.js
2020-04-15 09:11:10 -05:00

26 lines
570 B
JavaScript

const State = require('../State')
class IsAliveState extends State {
async apply() {
throw new Error('IsAliveState cannot be applied. It is a check measure only.')
}
async check() {
return this._host.is_alive()
}
async reverse() {
throw new Error('IsAliveState cannot be reversed. It is a check measure only.')
}
failure_message() {
return `Unable to connect to host "${this._host.name}".`
}
check_message() {
return this.failure_message()
}
}
module.exports = exports = IsAliveState