Class: SmartMachine::Commands::GridCommands::Minio

Inherits:
SubThor
  • Object
show all
Includes:
Utilities
Defined in:
lib/smart_machine/commands/grid_commands/minio.rb

Instance Method Summary collapse

Methods inherited from SubThor

banner, subcommand_prefix

Instance Method Details

#downObject



21
22
23
24
25
26
27
28
29
# File 'lib/smart_machine/commands/grid_commands/minio.rb', line 21

def down
  inside_machine_dir do
    with_docker_running do
      machine = SmartMachine::Machine.new
      name_option = options[:name] ? " --name=#{options[:name]}" : ""
      machine.run_on_machine commands: "smartengine grid minio downer#{name_option}"
    end
  end
end

#downerObject



49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/smart_machine/commands/grid_commands/minio.rb', line 49

def downer
  inside_engine_machine_dir do
    if options[:name]
      minio = SmartMachine::Grids::Minio.new(name: options[:name])
      minio.downer
    else
      SmartMachine.config.grids.minio.each do |name, config|
        minio = SmartMachine::Grids::Minio.new(name: name.to_s)
        minio.downer
      end
    end
  end
end

#upObject



9
10
11
12
13
14
15
16
17
# File 'lib/smart_machine/commands/grid_commands/minio.rb', line 9

def up
  inside_machine_dir do
    with_docker_running do
      machine = SmartMachine::Machine.new
      name_option = options[:name] ? " --name=#{options[:name]}" : ""
      machine.run_on_machine commands: "smartengine grid minio uper#{name_option}"
    end
  end
end

#uperObject



33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/smart_machine/commands/grid_commands/minio.rb', line 33

def uper
  inside_engine_machine_dir do
    if options[:name]
      minio = SmartMachine::Grids::Minio.new(name: options[:name])
      minio.uper
    else
      SmartMachine.config.grids.minio.each do |name, config|
        minio = SmartMachine::Grids::Minio.new(name: name.to_s)
        minio.uper
      end
    end
  end
end