Class: Dcmgr::Drivers::SnapshotStorage

Inherits:
Object
  • Object
show all
Includes:
Helpers::CliHelper
Defined in:
lib/dcmgr/drivers/snapshot_storage.rb

Direct Known Subclasses

IIJGIOStorage, LocalStorage, S3Storage

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers::CliHelper

#sh, #tryagain

Constructor Details

#initialize(account_id, bucket, volume_snaphost_path, options = {}) ⇒ SnapshotStorage

Returns a new instance of SnapshotStorage.



8
9
10
11
12
13
14
# File 'lib/dcmgr/drivers/snapshot_storage.rb', line 8

def initialize(, bucket, volume_snaphost_path, options = {})
  @account_id = 
  @env = []
  @volume_snaphost_path = volume_snaphost_path
  @bucket = bucket
  @tmp_dir = options[:tmp_dir] || '/var/tmp'
end

Instance Attribute Details

#volume_snaphost_pathObject (readonly)

Returns the value of attribute volume_snaphost_path.



6
7
8
# File 'lib/dcmgr/drivers/snapshot_storage.rb', line 6

def volume_snaphost_path
  @volume_snaphost_path
end

Instance Method Details

#check(filename) ⇒ Object



38
39
# File 'lib/dcmgr/drivers/snapshot_storage.rb', line 38

def check(filename)
end

#clearObject



20
21
22
# File 'lib/dcmgr/drivers/snapshot_storage.rb', line 20

def clear
  sh("/bin/rm #{@temporary_file}") if File.exists?(@temporary_file)
end

#delete(filename) ⇒ Object



35
36
# File 'lib/dcmgr/drivers/snapshot_storage.rb', line 35

def delete(filename)
end

#download(filename) ⇒ Object



29
30
# File 'lib/dcmgr/drivers/snapshot_storage.rb', line 29

def download(filename)
end

#setenv(key, value) ⇒ Object



16
17
18
# File 'lib/dcmgr/drivers/snapshot_storage.rb', line 16

def setenv(key, value)
  @env.push("#{key}=#{value}")
end

#snapshot(filename) ⇒ Object



24
25
26
27
# File 'lib/dcmgr/drivers/snapshot_storage.rb', line 24

def snapshot(filename)
  raise 'filename is empty' if filename == ''
  @temporary_file = File.join(@tmp_dir, filename)
end

#upload(filename) ⇒ Object



32
33
# File 'lib/dcmgr/drivers/snapshot_storage.rb', line 32

def upload(filename)
end