2022-07-28 14:33:23 -04:00
|
|
|
import GeneratedWorkerModel from '../generated/models/worker';
|
2022-08-09 15:34:42 -04:00
|
|
|
import { attr } from '@ember-data/model';
|
2022-07-28 14:33:23 -04:00
|
|
|
|
|
|
|
|
export default class WorkerModel extends GeneratedWorkerModel {
|
|
|
|
|
// =attributes
|
|
|
|
|
|
2022-08-09 15:34:42 -04:00
|
|
|
@attr({
|
2022-07-28 14:33:23 -04:00
|
|
|
description:
|
|
|
|
|
'The deduplicated union of the tags reported by the worker ' +
|
|
|
|
|
'from its configuration and any tags added through other means.\nOutput only.',
|
|
|
|
|
readOnly: true,
|
|
|
|
|
})
|
|
|
|
|
canonical_tags;
|
|
|
|
|
|
2022-08-09 15:34:42 -04:00
|
|
|
@attr({
|
2022-07-28 14:33:23 -04:00
|
|
|
description:
|
|
|
|
|
"The tags set in the worker's configuration file.\nOutput only.",
|
|
|
|
|
readOnly: true,
|
|
|
|
|
})
|
|
|
|
|
config_tags;
|
2022-08-09 15:34:42 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Method to modify the adpater to handle custom POST route for creating worker.
|
|
|
|
|
* @param {object} options
|
|
|
|
|
* @param {object} options.adapterOptions
|
|
|
|
|
* @return {Promise}
|
|
|
|
|
*/
|
|
|
|
|
addWorkerLed(workerGeneratedAuthToken, options = { adapterOptions: {} }) {
|
|
|
|
|
const defaultAdapterOptions = {
|
|
|
|
|
method: 'create:worker-led',
|
|
|
|
|
workerGeneratedAuthToken
|
|
|
|
|
};
|
|
|
|
|
return super.save({
|
|
|
|
|
...options,
|
|
|
|
|
adapterOptions: {
|
|
|
|
|
...defaultAdapterOptions,
|
|
|
|
|
...options.adapterOptions,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
2022-07-28 14:33:23 -04:00
|
|
|
}
|