Class: Dcmgr::Drivers::IIJGIOStorage

Inherits:
SnapshotStorage show all
Includes:
Helpers::SnapshotStorageHelper, Logger
Defined in:
lib/dcmgr/drivers/iijgio_storage.rb

Instance Attribute Summary

Attributes inherited from SnapshotStorage

#volume_snaphost_path

Instance Method Summary collapse

Methods included from Helpers::SnapshotStorageHelper

#execute, #key

Methods included from Logger

create, default_logdev, included

Methods inherited from SnapshotStorage

#check, #clear, #initialize, #setenv, #snapshot

Methods included from Helpers::CliHelper

#sh, #tryagain

Constructor Details

This class inherits a constructor from Dcmgr::Drivers::SnapshotStorage

Instance Method Details

#delete(filename) ⇒ Object



21
22
23
24
25
# File 'lib/dcmgr/drivers/iijgio_storage.rb', line 21

def delete(filename)
  cmd = "rm %s %s"
  args = [@bucket, key(filename)]
  execute(cmd, args)
end

#download(filename) ⇒ Object



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

def download(filename) 
  cmd = "get %s %s %s" 
  args = [@bucket, key(filename), self.snapshot(filename)]
  execute(cmd, args)
end

#upload(filename) ⇒ Object



15
16
17
18
19
# File 'lib/dcmgr/drivers/iijgio_storage.rb', line 15

def upload(filename)
  cmd = "put %s %s %s"
  args = [@bucket, key(filename), self.snapshot(filename)]
  execute(cmd, args)
end