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
34 35 36 37 |
# File 'app/controllers/api/v2/snapshots_controller.rb', line 34 def create @snapshot = resource_class.new(snapshot_params.to_h.merge(host: @nested_obj)) process_response @snapshot.save end |
#destroy ⇒ Object
52 53 54 |
# File 'app/controllers/api/v2/snapshots_controller.rb', line 52 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
60 61 62 |
# File 'app/controllers/api/v2/snapshots_controller.rb', line 60 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
44 45 46 |
# File 'app/controllers/api/v2/snapshots_controller.rb', line 44 def update process_response @snapshot.update_attributes(snapshot_params) end |