Class: SnapshotsController
Instance Method Summary
collapse
#dispatch, #get_locales, #is_dcmgr?, #set_application, #set_locale
Instance Method Details
#create ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'app/controllers/snapshots_controller.rb', line 8
def create
volume_ids = params[:ids]
destination = params[:destination]
res = []
volume_ids.each do |volume_id|
data = {
:volume_id => volume_id,
:destination => destination
}
res << DcmgrResource::VolumeSnapshot.create(data)
end
render :json => res
end
|
#destroy ⇒ Object
22
23
24
25
26
27
28
29
|
# File 'app/controllers/snapshots_controller.rb', line 22
def destroy
snapshot_ids = params[:ids]
res = []
snapshot_ids.each do |snapshot_id|
res << DcmgrResource::VolumeSnapshot.delete(snapshot_id)
end
render :json => res
end
|
#index ⇒ Object
5
6
|
# File 'app/controllers/snapshots_controller.rb', line 5
def index
end
|
#list ⇒ Object
31
32
33
34
35
36
37
38
|
# File 'app/controllers/snapshots_controller.rb', line 31
def list
data = {
:start => params[:start].to_i - 1,
:limit => params[:limit]
}
snapshots = DcmgrResource::VolumeSnapshot.list(data)
respond_with(snapshots[0], :to => [:json])
end
|
#show ⇒ Object
40
41
42
43
44
|
# File 'app/controllers/snapshots_controller.rb', line 40
def show
snapshot_id = params[:id]
detail = DcmgrResource::VolumeSnapshot.show(snapshot_id)
respond_with(detail,:to => [:json])
end
|
#upload_destination ⇒ Object