Class: DcmgrResource::VolumeSnapshot
- Inherits:
-
Base
- Object
- ActiveResource::Base
- Base
- DcmgrResource::VolumeSnapshot
show all
- Defined in:
- app/models/dcmgr_resource/volume_snapshot.rb
Class Method Summary
collapse
Methods inherited from Base
get_resource_state_count, set_debug, total_resource
Class Method Details
.create(params) ⇒ Object
16
17
18
19
20
21
22
|
# File 'app/models/dcmgr_resource/volume_snapshot.rb', line 16
def self.create(params)
snapshot = self.new
snapshot.volume_id = params[:volume_id]
snapshot.destination = params[:destination]
snapshot.save
snapshot
end
|
.destroy(snapshot_id) ⇒ Object
24
25
26
|
# File 'app/models/dcmgr_resource/volume_snapshot.rb', line 24
def self.destroy(snapshot_id)
self.delete(snapshot_id).body
end
|
.list(params = {}) ⇒ Object
4
5
6
7
8
9
10
|
# File 'app/models/dcmgr_resource/volume_snapshot.rb', line 4
def self.list(params = {})
data = self.find(:all, :params => params)
results = []
data.each { |row|
results << row.attributes
}
end
|
.show(snapshot_id) ⇒ Object
12
13
14
|
# File 'app/models/dcmgr_resource/volume_snapshot.rb', line 12
def self.show(snapshot_id)
self.get(snapshot_id)
end
|
.status(account_id) ⇒ Object
28
29
30
31
32
33
34
|
# File 'app/models/dcmgr_resource/volume_snapshot.rb', line 28
def self.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
36
37
38
39
|
# File 'app/models/dcmgr_resource/volume_snapshot.rb', line 36
def self.upload_destination
result = self.get(:upload_destination)
result
end
|