Class: Fog::Volume::SakuraCloud::Disk

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/sakuracloud/models/volume/disk.rb

Instance Method Summary collapse

Instance Method Details

#configure(sshkey_id) ⇒ Object



29
30
31
32
33
# File 'lib/fog/sakuracloud/models/volume/disk.rb', line 29

def configure(sshkey_id)
  requires :id
  service.configure_disk(@attributes[:id], sshkey_id )
  true
end

#deleteObject Also known as: destroy



16
17
18
19
# File 'lib/fog/sakuracloud/models/volume/disk.rb', line 16

def delete
  service.delete_disk(identity)
  true
end

#saveObject



22
23
24
25
26
27
# File 'lib/fog/sakuracloud/models/volume/disk.rb', line 22

def save
  requires :name, :plan, :source_archive
  data = service.create_disk(@attributes[:name], @attributes[:plan], @attributes[:source_archive]).body["Disk"]
  merge_attributes(data)
  true
end