New namespaces model

This commit is contained in:
Michael Lange 2017-10-06 18:27:36 -07:00
parent 3bb0a9779c
commit 4481e04d43
4 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,8 @@
import Model from 'ember-data/model';
import attr from 'ember-data/attr';
export default Model.extend({
name: attr('string'),
hash: attr('string'),
description: attr('string'),
});

View File

@ -58,6 +58,9 @@ export default function() {
this.get('/allocation/:id');
this.get('/namespaces');
this.get('/namespace/:id');
this.get('/agent/members', function({ agents }) {
return {
Members: this.serialize(agents.all()),

View File

@ -0,0 +1,10 @@
import { Factory, faker } from 'ember-cli-mirage';
export default Factory.extend({
id: i => `namespace-${i}`,
name() {
return this.id;
},
hash: () => faker.random.uuid(),
description: '',
});

View File

@ -1,5 +1,9 @@
export default function(server) {
server.createList('agent', 3);
server.createList('node', 50);
server.create('namespace', { id: 'default' });
server.createList('namespace', 3);
server.createList('job', 15);
}