Class: Katello::Api::V2::FlatpakRemotesController
Constant Summary
Concerns::FilteredAutoCompleteSearch::PAGE_SIZE
Instance Method Summary
collapse
#auto_complete_search
#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
#create ⇒ Object
52
53
54
55
56
|
# File 'app/controllers/katello/api/v2/flatpak_remotes_controller.rb', line 52
def create
flatpak_remote = FlatpakRemote.new(flatpak_remote_params)
flatpak_remote.save!
respond_for_create(resource: flatpak_remote)
end
|
#default_sort ⇒ Object
81
82
83
|
# File 'app/controllers/katello/api/v2/flatpak_remotes_controller.rb', line 81
def default_sort
%w(name asc)
end
|
#destroy ⇒ Object
70
71
72
|
# File 'app/controllers/katello/api/v2/flatpak_remotes_controller.rb', line 70
def destroy
@flatpak_remote.destroy!
end
|
#flatpak_remote_params ⇒ Object
85
86
87
|
# File 'app/controllers/katello/api/v2/flatpak_remotes_controller.rb', line 85
def flatpak_remote_params
params.require(:flatpak_remote).permit(:name, :url, :description, :organization_id, :username, :token)
end
|
#index ⇒ Object
27
28
29
|
# File 'app/controllers/katello/api/v2/flatpak_remotes_controller.rb', line 27
def index
respond(:collection => scoped_search(index_relation, :name, :asc))
end
|
#index_relation ⇒ Object
31
32
33
34
35
36
37
|
# File 'app/controllers/katello/api/v2/flatpak_remotes_controller.rb', line 31
def index_relation
remotes = FlatpakRemote.readable
remotes = remotes.where(organization_id: @organization.id) if @organization
remotes = remotes.where(name: params[:name]) if params[:name]
remotes = remotes.where(label: params[:label]) if params[:label]
remotes
end
|
#rejected_autocomplete_items ⇒ Object
89
90
91
|
# File 'app/controllers/katello/api/v2/flatpak_remotes_controller.rb', line 89
def rejected_autocomplete_items
['organization_id']
end
|
#scan ⇒ Object
76
77
78
79
|
# File 'app/controllers/katello/api/v2/flatpak_remotes_controller.rb', line 76
def scan
task = async_task(::Actions::Katello::Flatpak::ScanRemote, @flatpak_remote)
respond_for_async :resource => task
end
|
#show ⇒ Object
43
44
45
|
# File 'app/controllers/katello/api/v2/flatpak_remotes_controller.rb', line 43
def show
respond :resource => @flatpak_remote
end
|
#update ⇒ Object
63
64
65
66
|
# File 'app/controllers/katello/api/v2/flatpak_remotes_controller.rb', line 63
def update
@flatpak_remote.update!(flatpak_remote_params)
respond_for_show(:resource => @flatpak_remote)
end
|