Class: ForemanM2::HostsController

Inherits:
HostsController
  • Object
show all
Defined in:
app/controllers/foreman_m2/hosts_controller.rb

Overview

Example: Plugin’s HostsController inherits from Foreman’s HostsController

Instance Method Summary collapse

Instance Method Details

#new_actionObject

change layout if needed layout ‘foreman_m2/layouts/new_layout’



10
11
12
13
14
15
16
17
# File 'app/controllers/foreman_m2/hosts_controller.rb', line 10

def new_action
  # automatically renders view/foreman_m2/hosts/new_action

  proxy = ::ProxyAPI::M2.new(url: SmartProxy.with_features('M2').first.url)
  proxyAPI = ::ProxyAPI::M2.new(url: proxy.url)
  @response = proxyAPI.get_images(:project => 'ian')
  @snaps = proxyAPI.get_snapshots(:project => 'ian')
end