class Stratocumulus::ETCD
Public Class Methods
new(options = {})
click to toggle source
Calls superclass method
Stratocumulus::Database::new
# File lib/stratocumulus/database/etcd.rb, line 8 def initialize(options = {}) @data_dir = options["data_dir"] super(options) end
Public Instance Methods
cleanup()
click to toggle source
# File lib/stratocumulus/database/etcd.rb, line 25 def cleanup FileUtils.rm_rf(backup_dir) @_backup_dir = nil end
command()
click to toggle source
# File lib/stratocumulus/database/etcd.rb, line 13 def command command = "etcdctl " command << "backup " command << "--data-dir #{data_dir} " command << "--backup-dir #{backup_dir} " command << "&& tar -cf - -C #{backup_dir} . " end
dependencies()
click to toggle source
Calls superclass method
Stratocumulus::Database#dependencies
# File lib/stratocumulus/database/etcd.rb, line 21 def dependencies super + %w(etcdctl tar) end
Private Instance Methods
backup_dir()
click to toggle source
# File lib/stratocumulus/database/etcd.rb, line 40 def backup_dir @_backup_dir ||= Dir.tmpdir end
data_dir()
click to toggle source
# File lib/stratocumulus/database/etcd.rb, line 36 def data_dir @data_dir || "/var/lib/etcd" end
suffix()
click to toggle source
# File lib/stratocumulus/database/etcd.rb, line 32 def suffix ".tar.gz" end