2019-03-26 04:55:06 +00:00
|
|
|
import { copy } from 'ember-copy';
|
2017-09-19 14:47:10 +00:00
|
|
|
import ApplicationSerializer from './application';
|
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
export default class TaskGroup extends ApplicationSerializer {
|
2020-08-20 17:14:49 +00:00
|
|
|
arrayNullOverrides = ['Services'];
|
|
|
|
mapToArray = ['Volumes'];
|
|
|
|
|
2017-09-19 14:47:10 +00:00
|
|
|
normalize(typeHash, hash) {
|
|
|
|
// Provide EphemeralDisk to each task
|
|
|
|
hash.Tasks.forEach(task => {
|
|
|
|
task.EphemeralDisk = copy(hash.EphemeralDisk);
|
|
|
|
});
|
|
|
|
|
|
|
|
hash.ReservedEphemeralDisk = hash.EphemeralDisk.SizeMB;
|
2020-02-11 00:19:28 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
return super.normalize(typeHash, hash);
|
|
|
|
}
|
|
|
|
}
|