2017-09-19 14:47:10 +00:00
|
|
|
import ApplicationSerializer from './application';
|
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
export default class Task extends ApplicationSerializer {
|
2017-09-19 14:47:10 +00:00
|
|
|
normalize(typeHash, hash) {
|
|
|
|
// Lift the reserved resource numbers out of the Resources object
|
|
|
|
const resources = hash.Resources;
|
|
|
|
if (resources) {
|
|
|
|
hash.ReservedMemory = resources.MemoryMB;
|
2021-04-28 20:38:14 +00:00
|
|
|
hash.ReservedMemoryMax = resources.MemoryMaxMB;
|
2017-09-19 14:47:10 +00:00
|
|
|
hash.ReservedCPU = resources.CPU;
|
|
|
|
hash.ReservedDisk = resources.DiskMB;
|
|
|
|
hash.ReservedEphemeralDisk = hash.EphemeralDisk.SizeMB;
|
|
|
|
}
|
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
return super.normalize(typeHash, hash);
|
|
|
|
}
|
|
|
|
}
|