diff options
author | Koren Lev <korenlev@gmail.com> | 2017-10-02 11:37:03 +0300 |
---|---|---|
committer | Yaron Yogev <yaronyogev@gmail.com> | 2017-10-03 10:13:23 +0000 |
commit | 1fff14f0a5e25adaa851537c71c7bd8381c1bbb1 (patch) | |
tree | 4c2104a7de50858f34f930db8be36ae7b0efb29f /ui/imports/api/scheduled-scans/methods.js | |
parent | d0adff06bed72f9a0edd7adccfa6a1111784bc8b (diff) |
ui move to docker
Change-Id: Iff31ebb3fff782e848704801b7800fdf480264a1
Signed-off-by: Koren Lev <korenlev@gmail.com>
(cherry picked from commit a9691f5fe78af32c474754f841a71a68e2d2a484)
Diffstat (limited to 'ui/imports/api/scheduled-scans/methods.js')
-rw-r--r-- | ui/imports/api/scheduled-scans/methods.js | 123 |
1 files changed, 0 insertions, 123 deletions
diff --git a/ui/imports/api/scheduled-scans/methods.js b/ui/imports/api/scheduled-scans/methods.js deleted file mode 100644 index 06cdea7..0000000 --- a/ui/imports/api/scheduled-scans/methods.js +++ /dev/null @@ -1,123 +0,0 @@ -import { ValidatedMethod } from 'meteor/mdg:validated-method'; -import * as R from 'ramda'; - -import { ScheduledScans } from './scheduled-scans'; - -export const insert = new ValidatedMethod({ - name: 'scheduled-scans.insert', - validate: ScheduledScans.simpleSchema() - .pick([ - 'environment', - 'object_id', - 'log_level', - 'clear', - 'loglevel', - 'scan_only_inventory', - 'scan_only_links', - 'scan_only_cliques', - 'freq', - ]).validator({ clean: true, filter: false }), - run({ - environment, - object_id, - log_level, - clear, - loglevel, - scan_only_inventory, - scan_only_links, - scan_only_cliques, - freq, - }) { - let scan = ScheduledScans.schema.clean({ }); - - scan = R.merge(scan, { - environment, - object_id, - log_level, - clear, - loglevel, - scan_only_inventory, - scan_only_links, - scan_only_cliques, - freq, - submit_timestamp: Date.now() - }); - - ScheduledScans.insert(scan); - }, - -}); - -export const update = new ValidatedMethod({ - name: 'scheduled_scans.update', - validate: ScheduledScans.simpleSchema() - .pick([ - '_id', - 'environment', - 'object_id', - 'log_level', - 'clear', - 'loglevel', - 'scan_only_inventory', - 'scan_only_links', - 'scan_only_cliques', - 'freq', - ]).validator({ clean: true, filter: false }), - run({ - _id, - environment, - object_id, - log_level, - clear, - loglevel, - scan_only_inventory, - scan_only_links, - scan_only_cliques, - freq, - }) { - let item = ScheduledScans.findOne({ _id: _id }); - console.log('scheduled scan for update: ', item); - - item = R.merge(R.pick([ - 'environment', - 'object_id', - 'log_level', - 'clear', - 'loglevel', - 'scan_only_inventory', - 'scan_only_links', - 'scan_only_cliques', - 'submit_timestamp', - 'freq', - ], item), { - environment, - object_id, - log_level, - clear, - loglevel, - scan_only_inventory, - scan_only_links, - scan_only_cliques, - freq, - submit_timestamp: Date.now() - }); - - ScheduledScans.update({ _id: _id }, { $set: item }); - } -}); - -export const remove = new ValidatedMethod({ - name: 'scheduled_scans.remove', - validate: ScheduledScans.simpleSchema() - .pick([ - '_id', - ]).validator({ clean: true, filter: false }), - run({ - _id - }) { - let item = ScheduledScans.findOne({ _id: _id }); - console.log('scheduled scan for remove: ', item); - - ScheduledScans.remove({ _id: _id }); - } -}); |