chore: 🤖 add host catalog model and adapter

This commit is contained in:
Randall Morey committed 2020-06-04 16:32:16 -04:00
1 parent 87947f6a4f
commit 7132b59a76
7 files changed
+75

No files matched your search

@@ -0,0 +1,6 @@
import ApplicationAdapter from './application';
import ScopeAdapterMixin from '../mixins/scope-adapter';
export default class HostCatalogAdapter extends ApplicationAdapter.extend(
ScopeAdapterMixin
) { }
@@ -0,0 +1,41 @@
import BaseModel from '../../models/base';
import { attr } from '@ember-data/model';
/**
* HostCatalog manages Hosts and HostSets
*/
export default class GeneratedHostCatalogModel extends BaseModel {
// =attributes
@attr('string', {
description: 'The type of the resource, to help differentiate schemas'
}) type;
@attr('string', {
description: 'Optional name for identification purposes'
}) name;
@attr('string', {
description: 'Optional user-set description for identification purposes'
}) description;
@attr('date', {
description: 'The time this resource was created\nOutput only.',
readOnly: true
}) created_time;
@attr('date', {
description: 'The time this resource was last updated\nOutput only.',
readOnly: true
}) updated_time;
@attr('boolean', {
description: 'Whether the catalog is disabled'
}) disabled;
@attr({
description: 'Attributes specific to the catalog type'
}) attributes;
}
+3
View File
@@ -0,0 +1,3 @@
import GeneratedHostCatalogModel from '../generated/models/host-catalog';
export default class HostCatalogModel extends GeneratedHostCatalogModel { }
+1
View File
@@ -0,0 +1 @@
export { default } from 'api/adapters/host-catalog';
+1
View File
@@ -0,0 +1 @@
export { default } from 'api/models/host-catalog';
@@ -0,0 +1,11 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Adapter | host catalog', function(hooks) {
setupTest(hooks);
test('it exists', function(assert) {
let adapter = this.owner.lookup('adapter:host-catalog');
assert.ok(adapter);
});
});
@@ -0,0 +1,12 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Model | host catalog', function(hooks) {
setupTest(hooks);
test('it exists', function(assert) {
let store = this.owner.lookup('service:store');
let model = store.createRecord('host-catalog', {});
assert.ok(model);
});
});