app/controllers/katello/api/v2/repositories_controller.rb in katello-3.16.2 vs app/controllers/katello/api/v2/repositories_controller.rb in katello-3.17.0.rc1
- old
+ new
@@ -13,11 +13,11 @@
before_action :find_product, :only => [:index, :auto_complete_search]
before_action :find_product_for_create, :only => [:create]
before_action :find_organization_from_product, :only => [:create]
before_action :find_repository, :only => [:show, :update, :destroy, :sync, :export,
:remove_content, :upload_content, :republish,
- :import_uploads, :gpg_key_content, :verify_checksum]
+ :import_uploads, :gpg_key_content]
before_action :find_content, :only => :remove_content
before_action :find_organization_from_repo, :only => [:update]
before_action :error_on_rh_product, :only => [:create]
before_action :error_on_rh_repo, :only => [:destroy]
before_action(:only => [:create, :update]) { find_content_credential CONTENT_CREDENTIAL_GPG_KEY_TYPE }
@@ -55,10 +55,11 @@
param :ignore_global_proxy, :bool, :desc => N_("if true, will ignore the globally configured proxy when syncing"), :deprecated => true
param :ignorable_content, Array, :desc => N_("List of content units to ignore while syncing a yum repository. Must be subset of %s") % RootRepository::IGNORABLE_CONTENT_UNIT_TYPES.join(",")
param :ansible_collection_requirements, String, :desc => N_("Contents of requirement yaml file to sync from URL")
param :http_proxy_policy, ::Katello::RootRepository::HTTP_PROXY_POLICIES, :desc => N_("policies for HTTP proxy for content sync")
param :http_proxy_id, :number, :desc => N_("ID of a HTTP Proxy")
+ param :auto_enabled, :bool, :desc => N_("if true, the repositories will be automatically enabled on a registered host subscribed to this product. Default: true")
end
def_param_group :repo_create do
param :label, String, :required => false
param :product_id, :number, :required => true, :desc => N_("Product the repository belongs to")
@@ -292,19 +293,10 @@
respond_for_async :resource => task
rescue Errors::InvalidActionOptionError => e
raise HttpErrors::BadRequest, e.message
end
- api :POST, "/repositories/:id/verify_checksum", N_("Verify checksum of repository contents")
- param :id, :number, :required => true, :desc => N_("repository ID")
- def verify_checksum
- task = async_task(::Actions::Katello::Repository::VerifyChecksum, @repository)
- respond_for_async :resource => task
- rescue Errors::InvalidActionOptionError => e
- raise HttpErrors::BadRequest, e.message
- end
-
api :POST, "/repositories/:id/export", N_("Export a repository")
param :id, :number, :desc => N_("Repository identifier"), :required => true
param :export_to_iso, :bool, :desc => N_("Export to ISO format"), :required => false
param :iso_mb_size, :number, :desc => N_("maximum size of each ISO in MB"), :required => false
param :since, Date, :desc => N_("Optional date of last export (ex: 2010-01-01T12:00:00Z)"), :required => false
@@ -334,10 +326,11 @@
end
api :PUT, "/repositories/:id", N_("Update a repository")
param :id, :number, :required => true, :desc => N_("repository ID")
param :name, String, :required => false
+ param :description, String, :desc => N_("description of the repository"), :required => false
param_group :repo
def update
repo_params = repository_params
sync_task(::Actions::Katello::Repository::Update, @repository.root, repo_params)
@@ -470,11 +463,11 @@
end
end
def repository_params
keys = [:download_policy, :mirror_on_sync, :arch, :verify_ssl_on_sync, :upstream_password, :upstream_username,
- :ostree_upstream_sync_depth, :ostree_upstream_sync_policy,
+ :ostree_upstream_sync_depth, :ostree_upstream_sync_policy, :auto_enabled,
:deb_releases, :deb_components, :deb_architectures, :description, :http_proxy_policy, :http_proxy_id,
{:ignorable_content => []}
]
keys += [{:docker_tags_whitelist => []}, :docker_upstream_name] if params[:action] == 'create' || @repository&.docker?
@@ -521,9 +514,10 @@
root.upstream_password = repo_params[:upstream_password] if repo_params.key?(:upstream_password)
root.ignorable_content = repo_params[:ignorable_content] if root.yum? && repo_params.key?(:ignorable_content)
root.ansible_collection_requirements = repo_params[:ansible_collection_requirements] if root.ansible_collection?
root.http_proxy_policy = repo_params[:http_proxy_policy] if repo_params.key?(:http_proxy_policy)
root.http_proxy_id = repo_params[:http_proxy_id] if repo_params.key?(:http_proxy_id)
+ root.auto_enabled = repo_params[:auto_enabled] if repo_params.key?(:auto_enabled)
if root.ostree?
root.ostree_upstream_sync_policy = repo_params[:ostree_upstream_sync_policy]
root.ostree_upstream_sync_depth = repo_params[:ostree_upstream_sync_depth]
end