Class: Api::V2::SnapshotsController
- Inherits:
-
V2::BaseController
- Object
- V2::BaseController
- Api::V2::SnapshotsController
- Includes:
- Api::Version2, Foreman::Controller::Parameters::Snapshot
- Defined in:
- app/controllers/api/v2/snapshots_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
35 36 37 38 |
# File 'app/controllers/api/v2/snapshots_controller.rb', line 35 def create @snapshot = resource_class.new(snapshot_params.to_h.merge(host: @nested_obj).merge(include_ram: params[:include_ram])) process_response @snapshot.save end |
#destroy ⇒ Object
53 54 55 |
# File 'app/controllers/api/v2/snapshots_controller.rb', line 53 def destroy process_response @snapshot.destroy end |
#index ⇒ Object
13 14 15 |
# File 'app/controllers/api/v2/snapshots_controller.rb', line 13 def index @snapshots = resource_scope_for_index end |
#revert ⇒ Object
61 62 63 |
# File 'app/controllers/api/v2/snapshots_controller.rb', line 61 def revert process_response @snapshot.revert end |
#show ⇒ Object
21 |
# File 'app/controllers/api/v2/snapshots_controller.rb', line 21 def show; end |
#update ⇒ Object
45 46 47 |
# File 'app/controllers/api/v2/snapshots_controller.rb', line 45 def update process_response @snapshot.update_attributes(snapshot_params) end |