@trusthab/composable-resources
Version:
migrating https://github.com/knetikmedia/hab-api/tree/integration/app/resources/composable
29 lines (22 loc) • 557 B
JavaScript
const composer = require('../../mixin_loader');
module.exports = (App) => {
const { underscore } = require('inflected');
const PROPERTIES_VALUES = ['offline'];
class DevicesDowntimeResource {
static mixins() {
return [
'MetricTimer',
'Kpi'
];
}
getMetricId() {
return `devices_downtime`;
}
shouldRun() {
const { status } = this.get('obj');
if (PROPERTIES_VALUES.includes(status)) { return true; }
return false;
}
}
return composer(DevicesDowntimeResource, App);
};