feat: 🎸 add sync_interval_seconds to plugin host-sets

This commit is contained in:
dharini committed 2022-03-02 09:44:30 -08:00
1 parent 42cce22e99
commit d50b3a5625
4 files changed
+16 -2

No files matched your search

@@ -57,6 +57,13 @@ export default class GeneratedHostSetModel extends BaseModel {
})
plugin;
@attr('number', {
description:
"The number of seconds between the time boundary syncs the hosts in this set using this host set's plugin. If not provided a system determined default is used",
defaultValue: 0,
})
sync_interval_seconds;
// Azure specific
@attr('string', {
description: '',
+2 -2
View File
@@ -2,8 +2,8 @@ import ApplicationSerializer from './application';
import { copy } from 'ember-copy';
const fieldByType = {
aws: ['preferred_endpoints', 'filters'],
azure: ['preferred_endpoints', 'filter'],
aws: ['preferred_endpoints', 'filters', 'sync_interval_seconds'],
azure: ['preferred_endpoints', 'filter', 'sync_interval_seconds'],
};
export default class HostSetSerializer extends ApplicationSerializer {
// =properties
+1
View File
@@ -29,6 +29,7 @@ export default factory.extend({
return result;
}
},
sync_interval_seconds: () => datatype.number(),
// AWS specific
filters() {
if (this.plugin?.name === 'aws') {
@@ -12,12 +12,14 @@ module('Unit | Serializer | host set', function (hooks) {
compositeType: 'static',
description: 'Description',
host_catalog_id: '123',
sync_interval_seconds: 1,
version: 1,
});
assert.deepEqual(record.serialize(), {
name: 'Host Set 1',
description: 'Description',
host_catalog_id: '123',
sync_interval_seconds: 1,
version: 1,
});
});
@@ -53,6 +55,7 @@ module('Unit | Serializer | host set', function (hooks) {
host_catalog_id: '123',
version: 1,
preferred_endpoints: [{ value: 'option 1' }, { value: 'option 2' }],
sync_interval_seconds: 1,
filters: [{ value: 'filter 1' }, { value: 'filter 2' }],
});
assert.deepEqual(record.serialize(), {
@@ -61,6 +64,7 @@ module('Unit | Serializer | host set', function (hooks) {
host_catalog_id: '123',
version: 1,
preferred_endpoints: ['option 1', 'option 2'],
sync_interval_seconds: 1,
attributes: {
filters: ['filter 1', 'filter 2'],
},
@@ -77,6 +81,7 @@ module('Unit | Serializer | host set', function (hooks) {
host_catalog_id: '123',
version: 1,
preferred_endpoints: [{ value: 'option 1' }, { value: 'option 2' }],
sync_interval_seconds: 1,
filter: 'filter 1 && filter 2',
});
assert.deepEqual(record.serialize(), {
@@ -85,6 +90,7 @@ module('Unit | Serializer | host set', function (hooks) {
host_catalog_id: '123',
version: 1,
preferred_endpoints: ['option 1', 'option 2'],
sync_interval_seconds: 1,
attributes: {
filter: 'filter 1 && filter 2',
},