2018-03-08 22:14:55 +00:00
|
|
|
import { bool, equal } from '@ember/object/computed';
|
2021-02-17 21:01:44 +00:00
|
|
|
import Model from '@ember-data/model';
|
2022-04-05 18:34:37 +00:00
|
|
|
import { attr, belongsTo, hasMany } from '@ember-data/model';
|
2017-11-29 01:21:56 +00:00
|
|
|
import { fragmentArray } from 'ember-data-model-fragments/attributes';
|
|
|
|
import shortUUIDProperty from '../utils/properties/short-uuid';
|
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
export default class Evaluation extends Model {
|
|
|
|
@shortUUIDProperty('id') shortId;
|
2021-12-23 16:54:47 +00:00
|
|
|
@shortUUIDProperty('nodeId') shortNodeId;
|
2020-06-10 13:49:16 +00:00
|
|
|
@attr('number') priority;
|
|
|
|
@attr('string') type;
|
|
|
|
@attr('string') triggeredBy;
|
|
|
|
@attr('string') status;
|
|
|
|
@attr('string') statusDescription;
|
2021-12-28 16:08:12 +00:00
|
|
|
@fragmentArray('placement-failure', { defaultValue: () => [] })
|
|
|
|
failedTGAllocs;
|
2017-11-29 01:21:56 +00:00
|
|
|
|
2022-04-05 18:34:37 +00:00
|
|
|
@attr('string') previousEval;
|
|
|
|
@attr('string') nextEval;
|
|
|
|
@attr('string') blockedEval;
|
|
|
|
@hasMany('evaluation-stub', { async: false }) relatedEvals;
|
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@bool('failedTGAllocs.length') hasPlacementFailures;
|
|
|
|
@equal('status', 'blocked') isBlocked;
|
2017-11-29 01:21:56 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@belongsTo('job') job;
|
2021-12-23 16:54:47 +00:00
|
|
|
@belongsTo('node') node;
|
2017-11-29 01:21:56 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@attr('number') modifyIndex;
|
|
|
|
@attr('date') modifyTime;
|
2019-08-22 13:11:24 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@attr('number') createIndex;
|
|
|
|
@attr('date') createTime;
|
2018-05-03 19:17:06 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@attr('date') waitUntil;
|
2021-12-23 16:54:47 +00:00
|
|
|
@attr('string') namespace;
|
|
|
|
@attr('string') plainJobId;
|
|
|
|
|
|
|
|
get hasJob() {
|
|
|
|
return !!this.plainJobId;
|
|
|
|
}
|
|
|
|
|
|
|
|
get hasNode() {
|
|
|
|
return !!this.belongsTo('node').id();
|
|
|
|
}
|
|
|
|
|
|
|
|
get nodeId() {
|
|
|
|
return this.belongsTo('node').id();
|
|
|
|
}
|
2020-06-10 13:49:16 +00:00
|
|
|
}
|