Class: ForemanPatch::Api::V2::WindowsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/foreman_patch/api/v2/windows_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



40
41
42
43
# File 'app/controllers/foreman_patch/api/v2/windows_controller.rb', line 40

def create
  @window = Window.new(window_params)
  process_response @window.save
end

#destroyObject



54
55
56
# File 'app/controllers/foreman_patch/api/v2/windows_controller.rb', line 54

def destroy
  process_response @window.destroy
end

#indexObject



18
19
20
# File 'app/controllers/foreman_patch/api/v2/windows_controller.rb', line 18

def index
  @windows = resource_scope_for_index(params.permit(:cycle_id))
end

#resource_classObject



64
65
66
# File 'app/controllers/foreman_patch/api/v2/windows_controller.rb', line 64

def resource_class
  ForemanPatch::Window
end

#scheduleObject



60
61
62
# File 'app/controllers/foreman_patch/api/v2/windows_controller.rb', line 60

def schedule
  ::ForemanTasks.delay(::Actions::ForemanPatch::Window::Patch, delay_options, @window)
end

#showObject



24
25
# File 'app/controllers/foreman_patch/api/v2/windows_controller.rb', line 24

def show
end

#updateObject



48
49
50
# File 'app/controllers/foreman_patch/api/v2/windows_controller.rb', line 48

def update
  process_response @window.update(window_params)
end