2020-05-03 04:31:17 +00:00
|
|
|
import { computed } from '@ember/object';
|
2020-03-25 12:51:26 +00:00
|
|
|
import Model from 'ember-data/model';
|
|
|
|
import attr from 'ember-data/attr';
|
2020-05-02 06:38:05 +00:00
|
|
|
import { fragmentArray } from 'ember-data-model-fragments/attributes';
|
2020-03-25 12:51:26 +00:00
|
|
|
|
|
|
|
export default Model.extend({
|
2020-05-03 04:31:17 +00:00
|
|
|
plainId: attr('string'),
|
|
|
|
|
2020-03-25 12:51:26 +00:00
|
|
|
topologies: attr(),
|
|
|
|
provider: attr('string'),
|
|
|
|
version: attr('string'),
|
|
|
|
|
2020-05-02 06:38:05 +00:00
|
|
|
controllers: fragmentArray('storage-controller', { defaultValue: () => [] }),
|
|
|
|
nodes: fragmentArray('storage-node', { defaultValue: () => [] }),
|
2020-05-03 04:31:17 +00:00
|
|
|
|
|
|
|
controllerRequired: attr('boolean'),
|
|
|
|
controllersHealthy: attr('number'),
|
|
|
|
controllersExpected: attr('number'),
|
|
|
|
|
|
|
|
controllersHealthyProportion: computed('controllersHealthy', 'controllersExpected', function() {
|
|
|
|
return this.controllersHealthy / this.controllersExpected;
|
|
|
|
}),
|
|
|
|
|
|
|
|
nodesHealthy: attr('number'),
|
|
|
|
nodesExpected: attr('number'),
|
|
|
|
|
|
|
|
nodesHealthyProportion: computed('nodesHealthy', 'nodesExpected', function() {
|
|
|
|
return this.nodesHealthy / this.nodesExpected;
|
|
|
|
}),
|
2020-03-25 12:51:26 +00:00
|
|
|
});
|