Module: Hijiki::DcmgrResource::V1203::VolumeSnapshotMethods::ClassMethods
- Defined in:
- lib/hijiki/dcmgr_resource/12.03/volume_snapshot.rb
Instance Method Summary collapse
- #create(params) ⇒ Object
- #destroy(snapshot_id) ⇒ Object
- #list(params = {}) ⇒ Object
- #status(account_id) ⇒ Object
- #upload_destination ⇒ Object
Instance Method Details
#create(params) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/hijiki/dcmgr_resource/12.03/volume_snapshot.rb', line 17 def create(params) snapshot = self.new snapshot.volume_id = params[:volume_id] snapshot.destination = params[:destination] snapshot.save snapshot end |
#destroy(snapshot_id) ⇒ Object
25 26 27 |
# File 'lib/hijiki/dcmgr_resource/12.03/volume_snapshot.rb', line 25 def destroy(snapshot_id) self.delete(snapshot_id).body end |
#list(params = {}) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/hijiki/dcmgr_resource/12.03/volume_snapshot.rb', line 9 def list(params = {}) data = self.find(:all, :params => params) results = [] data.each { |row| results << row.attributes } end |
#status(account_id) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/hijiki/dcmgr_resource/12.03/volume_snapshot.rb', line 29 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 |
#upload_destination ⇒ Object
37 38 39 40 |
# File 'lib/hijiki/dcmgr_resource/12.03/volume_snapshot.rb', line 37 def upload_destination result = self.get(:upload_destination) result end |