Class: Katello::Api::V2::HostErrataController
Constant Summary
Concerns::FilteredAutoCompleteSearch::PAGE_SIZE
Instance Method Summary
collapse
#auto_complete_search
#full_result_response, #scoped_search
Methods included from Rendering
#respond_for_async, #respond_for_bulk_async, #respond_for_create, #respond_for_destroy, #respond_for_index, #respond_for_show, #respond_for_status, #respond_for_update, #respond_with_template, #respond_with_template_collection, #respond_with_template_resource, #try_specific_collection_template, #try_specific_resource_template
#api_version
Instance Method Details
#apply ⇒ Object
38
39
40
41
|
# File 'app/controllers/katello/api/v2/host_errata_controller.rb', line 38
def apply
task = async_task(::Actions::Katello::Host::Erratum::Install, @host, params[:errata_ids])
respond_for_async :resource => task
end
|
#index ⇒ Object
25
26
27
28
29
30
31
32
33
|
# File 'app/controllers/katello/api/v2/host_errata_controller.rb', line 25
def index
if (params[:content_view_id] && params[:environment_id].nil?) || (params[:environment_id] && params[:content_view_id].nil?)
fail _("Either both parameters 'content_view_id' and 'environment_id' should be specified or neither should be specified")
end
collection = scoped_search(index_relation, 'updated_at', 'desc', :resource_class => Erratum, :includes => [:cves])
@installable_errata_ids = @host.content_facet.installable_errata.pluck("#{Katello::Erratum.table_name}.id")
respond_for_index :collection => collection
end
|
#resource_class ⇒ Object
16
17
18
|
# File 'app/controllers/katello/api/v2/host_errata_controller.rb', line 16
def resource_class
Erratum
end
|
#show ⇒ Object
46
47
48
49
50
|
# File 'app/controllers/katello/api/v2/host_errata_controller.rb', line 46
def show
errata = Erratum.find_by(:errata_id => params[:id])
fail HttpErrors::NotFound, _("Couldn't find errata ids '%s'") % params[:id] unless errata
respond_for_show :resource => errata
end
|