Module: Hijiki::DcmgrResource::V1203::VolumeMethods::ClassMethods
- Defined in:
- lib/hijiki/dcmgr_resource/12.03/volume.rb
Instance Method Summary collapse
- #attach(volume_id, instance_id) ⇒ Object
- #create(params) ⇒ Object
- #destroy(volume_id) ⇒ Object
- #detach(volume_id) ⇒ Object
- #status(account_id) ⇒ Object
Instance Method Details
#attach(volume_id, instance_id) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/hijiki/dcmgr_resource/12.03/volume.rb', line 22 def attach(volume_id, instance_id) @collection ||= self.collection_name self.collection_name = File.join(@collection,volume_id) result = self.put(:attach, {:volume_id => volume_id,:instance_id => instance_id}) self.collection_name = @collection result.body end |
#create(params) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/hijiki/dcmgr_resource/12.03/volume.rb', line 9 def create(params) volume = self.new volume.volume_size = params[:volume_size] volume.snapshot_id = params[:snapshot_id] volume.storage_pool_id = params[:storage_pool_id] volume.save volume end |
#destroy(volume_id) ⇒ Object
18 19 20 |
# File 'lib/hijiki/dcmgr_resource/12.03/volume.rb', line 18 def destroy(volume_id) self.delete(volume_id).body end |
#detach(volume_id) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/hijiki/dcmgr_resource/12.03/volume.rb', line 30 def detach(volume_id) @collection ||= self.collection_name self.collection_name = File.join(@collection,volume_id) result = self.put(:detach, {:volume_id => volume_id}) self.collection_name = @collection result.body end |
#status(account_id) ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/hijiki/dcmgr_resource/12.03/volume.rb', line 38 def status(account_id) @collection ||= self.collection_name self.collection_name = File.join(@collection,account_id) result = self.get(:status) self.collection_name = @collection result end |