Class: Api::V2::BulkSnapshotsController

Inherits:
V2::BaseController
  • Object
show all
Includes:
BulkHostsExtension
Defined in:
app/controllers/api/v2/bulk_snapshots_controller.rb

Constant Summary collapse

SNAPSHOT_MODES =
ForemanSnapshotManagement::Extensions::BulkHostsManager::SNAPSHOT_MODES

Instance Method Summary collapse

Instance Method Details

#createObject



38
39
40
41
42
43
44
45
46
# File 'app/controllers/api/v2/bulk_snapshots_controller.rb', line 38

def create
  results = ::BulkHostsManager.new(hosts: @hosts).create_snapshots(
    name: @snapshot_name,
    description: @snapshot_description,
    mode: params[:mode]
  )

  render_results(results)
end