github.com/hernad/nomad@v1.6.112/ui/app/serializers/node.js (about) 1 /** 2 * Copyright (c) HashiCorp, Inc. 3 * SPDX-License-Identifier: MPL-2.0 4 */ 5 6 import { inject as service } from '@ember/service'; 7 import ApplicationSerializer from './application'; 8 9 export default class NodeSerializer extends ApplicationSerializer { 10 @service config; 11 12 attrs = { 13 isDraining: 'Drain', 14 httpAddr: 'HTTPAddr', 15 resources: 'NodeResources', 16 reserved: 'ReservedResources', 17 }; 18 19 mapToArray = ['Drivers', 'HostVolumes']; 20 21 extractRelationships(modelClass, hash) { 22 const { modelName } = modelClass; 23 const nodeURL = this.store 24 .adapterFor(modelName) 25 .buildURL( 26 modelName, 27 this.extractId(modelClass, hash), 28 hash, 29 'findRecord' 30 ); 31 32 return { 33 allocations: { 34 links: { 35 related: `${nodeURL}/allocations`, 36 }, 37 }, 38 }; 39 } 40 }