Data modeling for node drain and scheduling eligibility

This commit is contained in:
Michael Lange 2018-05-29 10:05:16 -07:00
parent 5aebd8d2d0
commit 078d921dc4
2 changed files with 5 additions and 0 deletions

View File

@ -1,4 +1,5 @@
import { computed } from '@ember/object';
import { equal } from '@ember/object/computed';
import Model from 'ember-data/model';
import attr from 'ember-data/attr';
import { hasMany } from 'ember-data/relationships';
@ -11,6 +12,7 @@ export default Model.extend({
name: attr('string'),
datacenter: attr('string'),
isDraining: attr('boolean'),
schedulingEligibility: attr('string'),
status: attr('string'),
statusDescription: attr('string'),
shortId: shortUUIDProperty('id'),
@ -24,6 +26,8 @@ export default Model.extend({
resources: fragment('resources'),
reserved: fragment('resources'),
isEligible: equal('schedulingEligibility', 'eligible'),
address: computed('httpAddr', function() {
return ipParts(this.get('httpAddr')).address;
}),

View File

@ -7,6 +7,7 @@ export default ApplicationSerializer.extend({
config: service(),
attrs: {
isDraining: 'Drain',
httpAddr: 'HTTPAddr',
},