diff --git a/addons/api/mirage/factories/host-set.js b/addons/api/mirage/factories/host-set.js index 35b26e560..cfda11aed 100644 --- a/addons/api/mirage/factories/host-set.js +++ b/addons/api/mirage/factories/host-set.js @@ -1,5 +1,6 @@ import factory from '../generated/factories/host-set'; import permissions from '../helpers/permissions'; +import { datatype, internet, database } from 'faker'; export default factory.extend({ id: (i) => `host-set-id-${i}`, @@ -18,4 +19,31 @@ export default factory.extend({ return this.hostCatalog.plugin; } }, + preferred_endpoints() { + if (this.type === 'plugin') { + const enpointsAmount = datatype.number({ min: 1, max: 5 }); + let result = []; + for (let i = 0; i < enpointsAmount; ++i) { + result.push(internet.ip()); + } + return result; + } + }, + // AWS specific + filters() { + if (this.type === 'plugin' && this.plugin?.name === 'aws') { + const filtersAmount = datatype.number({ min: 1, max: 5 }); + let result = []; + for (let i = 0; i < filtersAmount; ++i) { + result.push(`${datatype.string(3)}=${datatype.string(8)}`); + } + return result; + } + }, + // Azure specific + filter() { + if (this.type === 'plugin' && this.plugin?.name === 'azure') { + return `${database.column}=${database.collation}`; + } + }, });