Class: Tfrb::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/tfrb/cli.rb

Instance Method Summary collapse

Instance Method Details

#__print_versionObject



11
12
13
# File 'lib/tfrb/cli.rb', line 11

def __print_version
  puts Tfrb::VERSION
end

#applyObject



32
33
34
35
36
# File 'lib/tfrb/cli.rb', line 32

def apply
  tfrb = load_tfrb(options[:skip_import])
  tfrb.apply!(options[:parallelism])
  tfrb.clean!
end

#import(resource_type, resource_name, resource_id) ⇒ Object



39
40
41
42
43
44
# File 'lib/tfrb/cli.rb', line 39

def import(resource_type, resource_name, resource_id)
  tfrb = load_tfrb
  tfrb.skip_import = false
  tfrb.import!(resource_type, resource_name, resource_id)
  tfrb.clean!
end

#initObject



16
17
18
# File 'lib/tfrb/cli.rb', line 16

def init
  load_tfrb.init!
end

#planObject



23
24
25
26
27
# File 'lib/tfrb/cli.rb', line 23

def plan
  tfrb = load_tfrb(options[:skip_import], options[:dry_run])
  tfrb.plan!
  tfrb.clean!
end

#statemv(from_resource_id, to_resource_id) ⇒ Object



47
48
49
50
51
52
# File 'lib/tfrb/cli.rb', line 47

def statemv(from_resource_id, to_resource_id)
  tfrb = load_tfrb
  tfrb.skip_import = true
  tfrb.statemv!(from_resource_id, to_resource_id)
  tfrb.clean!
end

#unlock(lock_id) ⇒ Object



64
65
66
67
68
# File 'lib/tfrb/cli.rb', line 64

def unlock(lock_id)
  tfrb = load_tfrb
  tfrb.unlock!(lock_id)
  tfrb.clean!
end