Class: Katello::Api::V2::ContentImportsController

Inherits:
ApiController
  • Object
show all
Defined in:
app/controllers/katello/api/v2/content_imports_controller.rb

Instance Method Summary collapse

Methods inherited from ApiController

#check_katello_agent_not_disabled, #deprecate_katello_agent, #empty_search_query?, #full_result_response, #katello_agent_removal_release, #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

Methods included from Katello::Api::Version2

#api_version

Instance Method Details

#indexObject



16
17
18
19
20
21
22
23
24
25
# File 'app/controllers/katello/api/v2/content_imports_controller.rb', line 16

def index
  history = ContentViewVersionImportHistory.readable
  history = history.where(:id => params[:id]) unless params[:id].blank?
  history = history.where(:content_view_version_id => params[:content_view_version_id]) unless params[:content_view_version_id].blank?
  history = history.with_organization_id(params[:organization_id]) unless params[:organization_id].blank?
  history = history.with_content_view_id(params[:content_view_id]) unless params[:content_view_id].blank?
  history = history.where(:import_type => params[:type]) unless params[:type].blank?
  respond_with_template_collection("index", 'content_view_version_import_histories',
                                   :collection => scoped_search(history, 'id', 'asc', resource_class: ContentViewVersionImportHistory))
end

#libraryObject



41
42
43
44
# File 'app/controllers/katello/api/v2/content_imports_controller.rb', line 41

def library
  task = async_task(::Actions::Katello::ContentViewVersion::ImportLibrary, @organization, path: params[:path], metadata: .to_h)
  respond_for_async :resource => task
end

#repositoryObject



50
51
52
53
# File 'app/controllers/katello/api/v2/content_imports_controller.rb', line 50

def repository
  task = async_task(::Actions::Katello::ContentViewVersion::ImportRepository, @organization, path: params[:path], metadata: .to_h)
  respond_for_async :resource => task
end

#versionObject



31
32
33
34
35
# File 'app/controllers/katello/api/v2/content_imports_controller.rb', line 31

def version
  task = async_task(::Actions::Katello::ContentViewVersion::Import, organization: @organization,
                                              path: params[:path], metadata: .to_h)
  respond_for_async :resource => task
end