app/controllers/katello/api/v2/repositories_controller.rb in katello-3.0.2 vs app/controllers/katello/api/v2/repositories_controller.rb in katello-3.1.0.rc1

- old
+ new

@@ -26,18 +26,21 @@ param :product_id, :number, :required => true, :desc => N_("Product the repository belongs to") param :url, String, :desc => N_("repository source url") param :gpg_key_id, :number, :desc => N_("id of the gpg key that will be assigned to the new repository") param :unprotected, :bool, :desc => N_("true if this repository can be published via HTTP") param :content_type, RepositoryTypeManager.creatable_repository_types.keys, :required => true, :desc => N_("type of repo (either 'yum', 'puppet', 'docker', or 'ostree')") - param :checksum_type, String, :desc => N_("checksum of the repository, currently 'sha1' & 'sha256' are supported.'") + param :checksum_type, String, :desc => N_("checksum of the repository, currently 'sha1' & 'sha256' are supported.") param :docker_upstream_name, String, :desc => N_("name of the upstream docker repository") param :download_policy, ["immediate", "on_demand", "background"], :desc => N_("download policy for yum repos (either 'immediate', 'on_demand', or 'background')") param :mirror_on_sync, :bool, :desc => N_("true if this repository when synced has to be mirrored from the source and stale rpms removed.") end api :GET, "/repositories", N_("List of enabled repositories") api :GET, "/content_views/:id/repositories", N_("List of repositories for a content view") + api :GET, "/organizations/:organization_id/environments/:environment_id/repositories", _("List repositories in the environment") + api :GET, "/products/:product_id/repositories", N_("List of repositories for a product") + api :GET, "/environments/:environment_id/products/:product_id/repositories", N_("List of repositories belonging to a product in an environment") param :organization_id, :number, :desc => N_("ID of an organization to show repositories in") param :product_id, :number, :desc => N_("ID of a product to show repositories of") param :environment_id, :number, :desc => N_("ID of an environment to show repositories in") param :content_view_id, :number, :desc => N_("ID of a content view to show repositories in") param :content_view_version_id, :number, :desc => N_("ID of a content view version to show repositories in") @@ -238,11 +241,11 @@ repo_id = params['payload']['repo_id'] task_id = params['call_report']['task_id'] User.current = User.anonymous_admin - repo = Repository.where(:pulp_id => repo_id).first + repo = Repository.where(:pulp_id => repo_id).first fail _("Couldn't find repository '%s'") % repo_id if repo.nil? Rails.logger.info("Sync_complete called for #{repo.name}, running after_sync.") unless repo.dynflow_handled_last_sync?(task_id) async_task(::Actions::Katello::Repository::Sync, repo, task_id) @@ -368,10 +371,10 @@ @content = @repository.units_for_removal(params[:ids]) end def filter_by_content_view(query, content_view_id, environment_id, is_available_for) if is_available_for - params[:library] = true + params[:library] = true sub_query = ContentViewRepository.where(:content_view_id => content_view_id).pluck(:repository_id) query = query.where("#{Repository.table_name}.id not in (#{sub_query.join(',')})") unless sub_query.empty? elsif environment_id version = ContentViewVersion.in_environment(environment_id).where(:content_view_id => content_view_id) query = query.where(:content_view_version_id => version)