Class: OVH::Provisioner::CliVrack

Inherits:
Thor
  • Object
show all
Defined in:
lib/ovh/provisioner/cli_vrack.rb

Overview

The command line runner

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ThorPatching

#banner

Class Method Details

.exit_on_failure?Boolean

Exit 1 on failure

Returns:

  • (Boolean)


29
30
31
# File 'lib/ovh/provisioner/cli_vrack.rb', line 29

def self.exit_on_failure?
  true
end

Instance Method Details

#add(vrack_id, *targets) ⇒ Object



40
41
42
43
# File 'lib/ovh/provisioner/cli_vrack.rb', line 40

def add(vrack_id, *targets)
  msg = 'You are going to add those servers to vrack'
  execute_on_vrack(vrack_id, targets, :add, msg)
end

#list(*targets) ⇒ Object



34
35
36
37
# File 'lib/ovh/provisioner/cli_vrack.rb', line 34

def list(*targets)
  spawner = Provisioner.init(options)
  puts spawner.get('Vrack', *Cli.all(targets)).format
end

#rm(vrack_id, *targets) ⇒ Object



46
47
48
49
# File 'lib/ovh/provisioner/cli_vrack.rb', line 46

def rm(vrack_id, *targets)
  msg = 'You are going to remove those servers from vrack'
  execute_on_vrack(vrack_id, targets, :remove, msg)
end