CLI to trigger checks

master
aeris 2020-12-05 17:58:04 +01:00
parent 9288138875
commit f071dea0cd
1 changed files with 8 additions and 2 deletions

View File

@ -57,8 +57,6 @@ Class.new Thor do
def ls
services = Service.all
filter = {}
type = options[:type]
services = services.where type: type if type
name = options[:name]
@ -80,4 +78,12 @@ Class.new Thor do
service.destroy!
puts "Check #{service.id.colorize :red} deleted"
end
desc 'check <id*>', 'perform a check'
def check(*ids)
services = Service
services = ids.empty? ? services.all : services.where(id: ids)
services.each &:check!
end
end.start