Module: ForemanOvirt::ComputeResourcesVmsController::Overrides

Defined in:
app/controllers/concerns/foreman_ovirt/compute_resources_vms_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/controllers/concerns/foreman_ovirt/compute_resources_vms_controller.rb', line 10

def index
  load_vms
  @authorizer = Authorizer.new(User.current, collection: [@compute_resource])

  respond_to do |format|
    format.html
    format.json do
      if @compute_resource.supports_vms_pagination?
        # XXX: Foreman Core uses ".json", but this results in a "partial missing" error.
        render partial: "compute_resources_vms/index/#{@compute_resource.provider.downcase}_json"
      else
        render json: _('JSON VM listing is not supported for this compute resource.'),
               status: :not_implemented
      end
    end
  end
end