Class: Katello::Api::V2::HostPackagesController
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
#index ⇒ Object
22
23
24
25
|
# File 'app/controllers/katello/api/v2/host_packages_controller.rb', line 22
def index
collection = scoped_search(index_relation.uniq, :name, :asc, :resource_class => ::Katello::InstalledPackage)
respond_for_index(:collection => collection)
end
|
#index_relation ⇒ Object
81
82
83
|
# File 'app/controllers/katello/api/v2/host_packages_controller.rb', line 81
def index_relation
@host.installed_packages
end
|
#install ⇒ Object
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'app/controllers/katello/api/v2/host_packages_controller.rb', line 30
def install
if params[:packages]
packages = validate_package_list_format(params[:packages])
task = async_task(::Actions::Katello::Host::Package::Install, @host, packages)
respond_for_async :resource => task
return
end
if params[:groups]
groups = (params[:groups])
task = async_task(::Actions::Katello::Host::PackageGroup::Install, @host, groups)
respond_for_async :resource => task
end
end
|
#remove ⇒ Object
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
# File 'app/controllers/katello/api/v2/host_packages_controller.rb', line 66
def remove
if params[:packages]
packages = validate_package_list_format(params[:packages])
task = async_task(::Actions::Katello::Host::Package::Remove, @host, packages)
respond_for_async :resource => task
return
end
if params[:groups]
groups = (params[:groups])
task = async_task(::Actions::Katello::Host::PackageGroup::Remove, @host, groups)
respond_for_async :resource => task
end
end
|
#resource_class ⇒ Object
85
86
87
|
# File 'app/controllers/katello/api/v2/host_packages_controller.rb', line 85
def resource_class
Katello::InstalledPackage
end
|
#upgrade ⇒ Object
48
49
50
51
52
53
54
|
# File 'app/controllers/katello/api/v2/host_packages_controller.rb', line 48
def upgrade
if params[:packages]
packages = validate_package_list_format(params[:packages])
task = async_task(::Actions::Katello::Host::Package::Update, @host, packages)
respond_for_async :resource => task
end
end
|
#upgrade_all ⇒ Object
58
59
60
61
|
# File 'app/controllers/katello/api/v2/host_packages_controller.rb', line 58
def upgrade_all
task = async_task(::Actions::Katello::Host::Package::Update, @host, [])
respond_for_async :resource => task
end
|