Class: Katello::Api::V2::AlternateContentSourcesBulkActionsController
- Inherits:
-
ApiController
- Object
- Api::V2::BaseController
- ApiController
- Katello::Api::V2::AlternateContentSourcesBulkActionsController
show all
- Defined in:
- app/controllers/katello/api/v2/alternate_content_sources_bulk_actions_controller.rb
Instance Method Summary
collapse
#empty_search_query?, #full_result_response, #resource_class, #scoped_search, #skip_session
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
#destroy_alternate_content_sources ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'app/controllers/katello/api/v2/alternate_content_sources_bulk_actions_controller.rb', line 7
def destroy_alternate_content_sources
deletable_alternate_content_sources = @alternate_content_sources.deletable
if deletable_alternate_content_sources.empty?
msg = _("Unable to delete any alternate content source. You either do not have the permission to"\
" delete, or none of the alternate content sources exist.")
fail HttpErrors::UnprocessableEntity, msg
end
task = async_task(::Actions::BulkAction,
::Actions::Katello::AlternateContentSource::Destroy,
deletable_alternate_content_sources)
respond_for_async :resource => task
end
|
#refresh_all_alternate_content_sources ⇒ Object
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# File 'app/controllers/katello/api/v2/alternate_content_sources_bulk_actions_controller.rb', line 38
def refresh_all_alternate_content_sources
refreshable_alternate_content_sources = AlternateContentSource.editable
if refreshable_alternate_content_sources.empty?
msg = _("Unable to refresh any alternate content source. You either do"\
" not have the permission to refresh, or no alternate content sources exist.")
fail HttpErrors::UnprocessableEntity, msg
else
task = async_task(::Actions::BulkAction,
::Actions::Katello::AlternateContentSource::Refresh,
refreshable_alternate_content_sources)
respond_for_async resource: task
end
end
|
#refresh_alternate_content_sources ⇒ Object
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'app/controllers/katello/api/v2/alternate_content_sources_bulk_actions_controller.rb', line 23
def refresh_alternate_content_sources
refreshable_alternate_content_sources = @alternate_content_sources.editable
if refreshable_alternate_content_sources.empty?
msg = _("Unable to refresh any alternate content source. You either do not have the permission to"\
" refresh, or none of the alternate content sources exist.")
fail HttpErrors::UnprocessableEntity, msg
else
task = async_task(::Actions::BulkAction,
::Actions::Katello::AlternateContentSource::Refresh,
refreshable_alternate_content_sources)
respond_for_async resource: task
end
end
|