katello 3.6.0.1.rc2 → 3.7.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of katello might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/javascripts/katello/hosts/activation_key_edit.js +2 -2
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +6 -4
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +1 -3
- data/app/controllers/katello/api/v2/api_controller.rb +13 -3
- data/app/controllers/katello/api/v2/content_credentials_controller.rb +116 -0
- data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +1 -1
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +6 -0
- data/app/controllers/katello/api/v2/content_views_controller.rb +2 -1
- data/app/controllers/katello/api/v2/environments_controller.rb +20 -3
- data/app/controllers/katello/api/v2/gpg_keys_controller.rb +5 -0
- data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +14 -7
- data/app/controllers/katello/api/v2/products_controller.rb +31 -1
- data/app/controllers/katello/api/v2/repositories_controller.rb +103 -34
- data/app/controllers/katello/api/v2/repository_sets_controller.rb +22 -15
- data/app/controllers/katello/api/v2/subscriptions_controller.rb +31 -7
- data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +93 -0
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +2 -2
- data/app/helpers/katello/katello_urls_helper.rb +21 -4
- data/app/jobs/create_pulp_disk_space_notifications.rb +4 -0
- data/app/jobs/send_expire_soon_notifications.rb +13 -0
- data/app/lib/actions/candlepin/import_pool_handler.rb +5 -4
- data/app/lib/actions/candlepin/owner/import_products.rb +4 -2
- data/app/lib/actions/helpers/notifications.rb +35 -0
- data/app/lib/actions/katello/capsule_content/sync.rb +12 -1
- data/app/lib/actions/katello/content_view/{capsule_generate_and_sync.rb → capsule_sync.rb} +1 -1
- data/app/lib/actions/katello/content_view/promote_to_environment.rb +1 -1
- data/app/lib/actions/katello/content_view/publish.rb +40 -11
- data/app/lib/actions/katello/content_view/remove.rb +2 -2
- data/app/lib/actions/katello/environment/publish_repositories.rb +41 -0
- data/app/lib/actions/katello/event_queue/poller_thread.rb +10 -8
- data/app/lib/actions/katello/host/attach_subscriptions.rb +1 -1
- data/app/lib/actions/katello/host/remove_subscriptions.rb +1 -1
- data/app/lib/actions/katello/organization/manifest_delete.rb +22 -0
- data/app/lib/actions/katello/organization/manifest_import.rb +22 -0
- data/app/lib/actions/katello/organization/manifest_refresh.rb +22 -0
- data/app/lib/actions/katello/product/create.rb +3 -6
- data/app/lib/actions/katello/product/reindex_subscriptions.rb +3 -4
- data/app/lib/actions/katello/repository/{capsule_generate_and_sync.rb → capsule_sync.rb} +1 -1
- data/app/lib/actions/katello/repository/clone_yum_metadata.rb +2 -1
- data/app/lib/actions/katello/repository/create.rb +2 -1
- data/app/lib/actions/katello/repository/filtered_index_content.rb +2 -0
- data/app/lib/actions/katello/repository/import_upload.rb +38 -6
- data/app/lib/actions/katello/repository/remove_content.rb +1 -1
- data/app/lib/actions/katello/repository/sync.rb +8 -1
- data/app/lib/actions/katello/repository/sync_hook.rb +11 -0
- data/app/lib/actions/katello/repository/update.rb +4 -1
- data/app/lib/actions/katello/sync_plan/add_products.rb +1 -1
- data/app/lib/actions/katello/upstream_subscriptions/bind_entitlement.rb +31 -0
- data/app/lib/actions/katello/upstream_subscriptions/bind_entitlements.rb +28 -0
- data/app/lib/actions/katello/upstream_subscriptions/remove_entitlement.rb +22 -0
- data/app/lib/actions/katello/upstream_subscriptions/remove_entitlements.rb +35 -0
- data/app/lib/actions/katello/upstream_subscriptions/update_entitlement.rb +23 -0
- data/app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb +37 -0
- data/app/lib/actions/middleware/execute_if_contents_changed.rb +1 -1
- data/app/lib/actions/pulp/repository/create.rb +3 -0
- data/app/lib/actions/pulp/repository/ensure_sync_notification.rb +11 -0
- data/app/lib/actions/pulp/repository/import_upload.rb +2 -2
- data/app/lib/katello/resources/candlepin.rb +68 -801
- data/app/lib/katello/resources/candlepin/activation_key.rb +101 -0
- data/app/lib/katello/resources/candlepin/c_p_user.rb +17 -0
- data/app/lib/katello/resources/candlepin/candlepin_ping.rb +19 -0
- data/app/lib/katello/resources/candlepin/consumer.rb +204 -0
- data/app/lib/katello/resources/candlepin/content.rb +36 -0
- data/app/lib/katello/resources/candlepin/entitlement.rb +22 -0
- data/app/lib/katello/resources/candlepin/environment.rb +44 -0
- data/app/lib/katello/resources/candlepin/job.rb +25 -0
- data/app/lib/katello/resources/candlepin/owner.rb +130 -0
- data/app/lib/katello/resources/candlepin/owner_info.rb +18 -0
- data/app/lib/katello/resources/candlepin/pool.rb +39 -0
- data/app/lib/katello/resources/candlepin/product.rb +116 -0
- data/app/lib/katello/resources/candlepin/proxy.rb +41 -0
- data/app/lib/katello/resources/candlepin/subscription.rb +31 -0
- data/app/lib/katello/resources/candlepin/upstream_consumer.rb +41 -0
- data/app/lib/katello/resources/candlepin/upstream_entitlement.rb +19 -0
- data/app/lib/katello/resources/candlepin/upstream_owner.rb +15 -0
- data/app/lib/katello/resources/candlepin/upstream_pool.rb +17 -0
- data/app/lib/katello/util/data.rb +2 -4
- data/app/lib/katello/util/http_proxy.rb +29 -0
- data/app/lib/katello/util/model.rb +1 -1
- data/app/lib/katello/validators/container_image_name_validator.rb +18 -0
- data/app/lib/katello/validators/content_view_environment_org_validator.rb +14 -0
- data/app/lib/katello/validators/environment_docker_repositories_validator.rb +71 -0
- data/app/lib/katello/validators/gpg_key_content_type_validator.rb +22 -0
- data/app/models/katello/activation_key.rb +4 -2
- data/app/models/katello/authorization/content_view_history.rb +0 -1
- data/app/models/katello/authorization/pool.rb +0 -2
- data/app/models/katello/authorization/repository.rb +0 -2
- data/app/models/katello/capsule_lifecycle_environment.rb +2 -0
- data/app/models/katello/compliance_reason.rb +5 -0
- data/app/models/katello/concerns/content_facet_host_extensions.rb +5 -1
- data/app/models/katello/concerns/organization_extensions.rb +22 -0
- data/app/models/katello/concerns/smart_proxy_extensions.rb +3 -2
- data/app/models/katello/concerns/subscription_facet_host_extensions.rb +2 -0
- data/app/models/katello/content.rb +5 -0
- data/app/models/katello/content_facet_applicable_rpm.rb +1 -0
- data/app/models/katello/content_view.rb +50 -82
- data/app/models/katello/content_view_component.rb +1 -0
- data/app/models/katello/content_view_docker_filter_rule.rb +0 -1
- data/app/models/katello/content_view_environment.rb +5 -3
- data/app/models/katello/content_view_filter.rb +2 -1
- data/app/models/katello/content_view_history.rb +3 -0
- data/app/models/katello/content_view_puppet_environment.rb +12 -0
- data/app/models/katello/content_view_puppet_module.rb +1 -0
- data/app/models/katello/content_view_version.rb +18 -1
- data/app/models/katello/docker_manifest.rb +2 -1
- data/app/models/katello/docker_manifest_list.rb +2 -1
- data/app/models/katello/docker_meta_tag.rb +22 -1
- data/app/models/katello/erratum.rb +17 -5
- data/app/models/katello/event.rb +2 -0
- data/app/models/katello/glue/candlepin/activation_key.rb +2 -2
- data/app/models/katello/glue/candlepin/candlepin_object.rb +7 -6
- data/app/models/katello/glue/candlepin/owner.rb +4 -3
- data/app/models/katello/glue/candlepin/pool.rb +51 -20
- data/app/models/katello/glue/candlepin/product.rb +3 -2
- data/app/models/katello/glue/candlepin/subscription.rb +16 -35
- data/app/models/katello/glue/pulp/repo.rb +26 -6
- data/app/models/katello/glue/pulp/repos.rb +6 -3
- data/app/models/katello/gpg_key.rb +29 -4
- data/app/models/katello/host/content_facet.rb +5 -3
- data/app/models/katello/host/subscription_facet.rb +55 -23
- data/app/models/katello/host_collection.rb +1 -0
- data/app/models/katello/host_collection_hosts.rb +1 -1
- data/app/models/katello/installed_package.rb +4 -0
- data/app/models/katello/installed_product.rb +33 -0
- data/app/models/katello/key_host_collection.rb +2 -2
- data/app/models/katello/kt_environment.rb +8 -0
- data/app/models/katello/ostree_branch.rb +1 -1
- data/app/models/katello/ping.rb +1 -0
- data/app/models/katello/pool.rb +13 -7
- data/app/models/katello/pool_product.rb +6 -0
- data/app/models/katello/product.rb +16 -6
- data/app/models/katello/product_content.rb +4 -0
- data/app/models/katello/pulp_task_status.rb +0 -46
- data/app/models/katello/repository.rb +96 -19
- data/app/models/katello/repository_docker_manifest.rb +1 -1
- data/app/models/katello/repository_docker_manifest_list.rb +1 -1
- data/app/models/katello/repository_ostree_branch.rb +1 -1
- data/app/models/katello/rhsm_fact_importer.rb +2 -17
- data/app/models/katello/subscription.rb +5 -5
- data/app/models/katello/subscription_facet_installed_product.rb +6 -0
- data/app/models/katello/subscription_facet_pool.rb +2 -0
- data/app/models/katello/sync_plan.rb +1 -0
- data/app/models/katello/upstream_pool.rb +112 -0
- data/app/models/setting/content.rb +11 -7
- data/app/services/katello/candlepin/consumer.rb +9 -2
- data/app/services/katello/candlepin/message_handler.rb +18 -35
- data/app/services/katello/candlepin/pool_service.rb +17 -0
- data/app/services/katello/event_queue.rb +11 -6
- data/app/services/katello/pulp/server.rb +3 -1
- data/app/services/katello/registration_manager.rb +9 -2
- data/app/services/katello/repository_type_manager.rb +2 -1
- data/app/services/katello/ui_notifications/abstract_notification.rb +29 -0
- data/app/services/katello/ui_notifications/content_view/auto_publish_failure.rb +22 -0
- data/app/services/katello/ui_notifications/pulp/proxy_disk_space.rb +3 -4
- data/app/services/katello/ui_notifications/subscriptions/expire_soon.rb +65 -0
- data/app/services/katello/ui_notifications/subscriptions/manifest_delete_error.rb +13 -0
- data/app/services/katello/ui_notifications/subscriptions/manifest_delete_success.rb +13 -0
- data/app/services/katello/ui_notifications/subscriptions/manifest_import_error.rb +13 -0
- data/app/services/katello/ui_notifications/subscriptions/manifest_import_success.rb +13 -0
- data/app/services/katello/ui_notifications/subscriptions/manifest_refresh_error.rb +13 -0
- data/app/services/katello/ui_notifications/subscriptions/manifest_refresh_success.rb +13 -0
- data/app/services/katello/ui_notifications/task_notification.rb +26 -0
- data/app/views/foreman/job_templates/install_errata.erb +7 -2
- data/app/views/foreman/job_templates/install_errata_-_katello_ansible_default.erb +18 -0
- data/app/views/foreman/job_templates/install_group_-_katello_ansible_default.erb +16 -0
- data/app/views/foreman/job_templates/install_package_-_katello_ansible_default.erb +16 -0
- data/app/views/foreman/job_templates/remove_group_-_katello_ansible_default.erb +16 -0
- data/app/views/foreman/job_templates/remove_package_-_katello_ansible_default.erb +16 -0
- data/app/views/foreman/job_templates/restart_services_-_katello_ansible_default.erb +20 -0
- data/app/views/foreman/job_templates/update_group_-_katello_ansible_default.erb +16 -0
- data/app/views/foreman/job_templates/update_package_-_katello_ansible_default.erb +16 -0
- data/app/views/foreman/smart_proxies/_content_tab.html.erb +1 -1
- data/app/views/katello/api/v2/content_credentials/index.json.rabl +3 -0
- data/app/views/katello/api/v2/content_credentials/show.json.rabl +101 -0
- data/app/views/katello/api/v2/content_view_histories/show.json.rabl +13 -1
- data/app/views/katello/api/v2/content_views/base.json.rabl +1 -0
- data/app/views/katello/api/v2/environments/show.json.rabl +1 -0
- data/app/views/katello/api/v2/errata/{available_errata.rabl → available_errata.json.rabl} +0 -0
- data/app/views/katello/api/v2/errata/show.json.rabl +4 -0
- data/app/views/katello/api/v2/products/_product_content.json.rabl +6 -6
- data/app/views/katello/api/v2/products/base.json.rabl +3 -0
- data/app/views/katello/api/v2/products/show.json.rabl +12 -0
- data/app/views/katello/api/v2/repositories/base.json.rabl +2 -1
- data/app/views/katello/api/v2/repositories/show.json.rabl +19 -5
- data/app/views/katello/api/v2/subscription_facet/show.json.rabl +10 -14
- data/app/views/katello/api/v2/subscriptions/base.json.rabl +2 -1
- data/app/views/katello/api/v2/upstream_subscriptions/base.json.rabl +18 -0
- data/app/views/katello/api/v2/upstream_subscriptions/index.json.rabl +7 -0
- data/app/views/katello/sync_management/_products.html.erb +1 -1
- data/config/katello.yaml.example +10 -0
- data/config/routes.rb +3 -14
- data/config/routes/api/rhsm.rb +1 -0
- data/config/routes/api/v2.rb +16 -0
- data/db/migrate/20161014133811_move_content_view_version_description_to_histories.rb +2 -1
- data/db/migrate/20161214151548_move_content_source_id_to_content_facets.rb +2 -2
- data/db/migrate/20171110082124_add_ssl_certs_to_products_and_repos.rb +42 -0
- data/db/migrate/20171214050230_add_auto_publish_to_content_views.rb +5 -0
- data/db/migrate/20180117202932_sub_facet_add_installed_products.rb +20 -0
- data/db/migrate/20180119152210_add_compliance_reasons.rb +11 -0
- data/db/migrate/20180207232901_add_triggered_by_to_content_view_history.rb +7 -0
- data/db/migrate/20180218191449_add_manifest_refreshed_at_to_organization.rb +9 -0
- data/db/migrate/20180227094827_use_uuid_for_task_id.rb +26 -0
- data/db/migrate/20180323175122_add_registry_name_pattern_to_environment.rb +11 -0
- data/db/migrate/20180326145716_subscription_cp_id_change.rb +10 -0
- data/db/migrate/20180326150339_move_stacking_id.rb +25 -0
- data/db/migrate/20180326190408_move_subscription_products.rb +75 -0
- data/db/migrate/20180402160223_clean_up_force_post_sync_action_setting.rb +5 -0
- data/db/migrate/20180410140909_add_organization_id_to_pool.rb +15 -0
- data/db/migrate/20180413153126_content_facet_applicable_rpms_index.rb +5 -0
- data/db/migrate/20180417031215_add_ignorable_content_to_repository.rb +5 -0
- data/db/migrate/20180521200848_drop_repo_rpms_timestamp_not_null.rb +18 -0
- data/db/seeds.d/109-katello-notification-blueprints.rb +42 -0
- data/db/seeds.d/110-content-view-autopublish.rb +15 -0
- data/db/seeds.d/75-job_templates.rb +3 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-add-subscriptions.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-details-info.controller.js +34 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-subscriptions.controller.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-info.html +3 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion_katello.js +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/common/views/subscription-add-or-remove.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-credential.factory.js +83 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/{gpg-keys/gpg-keys.controller.js → content-credentials/content-credentials.controller.js} +8 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/{gpg-keys/gpg-keys.module.js → content-credentials/content-credentials.module.js} +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-credentials.routes.js +76 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-type.filter.js +25 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/{gpg-keys/details/gpg-key-details-info.controller.js → content-credentials/details/content-credential-details-info.controller.js} +10 -10
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js +48 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-products.controller.js +36 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-repositories.controller.js +36 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-details.html +36 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/{gpg-keys/details/views/gpg-key-info.html → content-credentials/details/views/content-credential-info.html} +21 -12
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/{gpg-keys/details/views/gpg-key-products.html → content-credentials/details/views/content-credential-products.html} +6 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/{gpg-keys/details/views/gpg-key-repositories.html → content-credentials/details/views/content-credential-repositories.html} +6 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js +39 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/views/new-content-credential.html +53 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/views/content-credentials.html +55 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +31 -19
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-host-collections-modal.controller.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-packages-modal.controller.js +4 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-environment-modal.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html +108 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-host-collections-modal.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-packages-modal.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-subscriptions-modal.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-errata.controller.js +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-errata.html +9 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-applicable.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-installed.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-add-subscriptions.controller.js +1 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-subscriptions.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +4 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-repository-sets.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register.html +14 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/content-view-composite-available-content-views.controller.js +7 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-deb-repositories.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-docker-repositories.controller.js +5 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-file-repositories.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-ostree-repositories.controller.js +5 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-repositories.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-deb-repositories-list.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-docker-repositories-list.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-file-repositories-list.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-ostree-repositories-list.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-repositories-list.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-versions.controller.js +5 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/date-type-errata-filter.controller.js +8 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-helper.service.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/new-filter.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/date-type-errata.html +6 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/docker-filter.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/new-filter.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/content-view-history.controller.js +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/content-view-puppet-modules.controller.js +5 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-details.html +8 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-docker-repositories.html +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-info.html +14 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-versions.html +12 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/views/content-view-new.html +16 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version-content.controller.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-errata.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/views/docker-tag-details.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/views/docker-tag-environments.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/views/docker-tag-info.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/docker-tags.routes.js +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/views/docker-tags.html +4 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/content.service.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/environment.controller.js +3 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-details.html +8 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-docker.html +9 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-errata.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment.html +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/views/environments.html +18 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/erratum-content-hosts.controller.js +22 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/erratum-repositories.controller.js +18 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum-content-hosts.html +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/incremental-update.service.js +3 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/views/apply-errata-confirm.html +17 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/views/errata.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/README +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +3465 -1541
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/translations.js +10 -10
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/katello-features.run.js +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/ostree-branch-repositories.controller.js +18 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branch-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package-repositories.controller.js +18 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/views/package-info.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/views/package-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/views/package.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/packages.routes.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/views/packages.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-details-info.controller.js +32 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +34 -13
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.filter.js +16 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-manage-content.controller.js +15 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +42 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-debs.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-docker-manifest-lists.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-docker-manifests.html +7 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-docker-tags.html +47 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-files.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-packages.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +10 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +43 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repositories.routes.js +11 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository-types.service.js +39 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +6 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/yum-content-units.service.js +24 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/views/product-info.html +24 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/discovery-create.controller.js +7 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/discovery.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/views/discovery-create.html +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/new/product-form.controller.js +7 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/new/views/product-new-form.html +29 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.controller.js +9 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.module.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/views/products.html +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-details.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-import.controller.js +12 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-delete-modal.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-import.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task.factory.js +4 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/tasks-nutupane.factory.js +6 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/tasks-table.directive.js +6 -3
- data/engines/bastion_katello/lib/bastion_katello/engine.rb +1 -1
- data/lib/katello/apipie/validators.rb +0 -56
- data/lib/katello/engine.rb +6 -43
- data/lib/katello/permission_creator.rb +31 -4
- data/lib/katello/plugin.rb +124 -73
- data/lib/katello/scheduled_jobs.rb +10 -4
- data/lib/katello/tasks/job_templates.rake +16 -0
- data/lib/katello/tasks/reset.rake +0 -3
- data/lib/katello/tasks/upgrades/3.6/import_backend_consumer_attributes.rake +32 -0
- data/lib/katello/tasks/upgrades/3.7/make_all_ks_repos_bootable.rake +11 -0
- data/lib/katello/version.rb +1 -1
- data/locale/action_names.rb +52 -48
- data/locale/katello.pot +3136 -1999
- data/package.json +83 -0
- data/webpack/__mocks__/foremanReact/common/helpers.js +5 -0
- data/webpack/__mocks__/foremanReact/components/common/table.js +6 -0
- data/webpack/__mocks__/react-bootstrap-tooltip-button.js +6 -0
- data/webpack/components/MultiSelect/index.js +35 -0
- data/webpack/components/PaginationRow/PaginationRow.test.js +25 -0
- data/webpack/components/PaginationRow/__snapshots__/PaginationRow.test.js.snap +35 -0
- data/webpack/components/PaginationRow/index.js +90 -0
- data/webpack/components/Search/Search.test.js +20 -0
- data/webpack/components/Search/__snapshots__/Search.test.js.snap +18 -0
- data/webpack/components/Search/helpers.js +6 -0
- data/webpack/components/Search/index.js +86 -0
- data/webpack/containers/Application/Routes.js +11 -0
- data/webpack/containers/Application/config.js +21 -0
- data/webpack/containers/Application/index.js +39 -0
- data/webpack/containers/Application/overrides.scss +38 -0
- data/webpack/index.js +18 -0
- data/webpack/mockRequest.js +32 -0
- data/webpack/move_to_foreman/Settings/SettingsActions.js +28 -0
- data/webpack/move_to_foreman/Settings/SettingsConstants.js +3 -0
- data/webpack/move_to_foreman/Settings/__tests__/SettingsActions.test.js +41 -0
- data/webpack/move_to_foreman/Settings/__tests__/settings.fixtures.js +34 -0
- data/webpack/move_to_foreman/__mocks__/foreman_toast_notifications.js +3 -0
- data/webpack/move_to_foreman/common/helpers.js +36 -0
- data/webpack/move_to_foreman/components/common/ConfirmDialog/ConfirmDialog.js +50 -0
- data/webpack/move_to_foreman/components/common/ConfirmDialog/__tests__/ConfirmDialog.test.js +40 -0
- data/webpack/move_to_foreman/components/common/ConfirmDialog/__tests__/__snapshots__/ConfirmDialog.test.js.snap +125 -0
- data/webpack/move_to_foreman/components/common/ConfirmDialog/index.js +3 -0
- data/webpack/move_to_foreman/components/common/Dialog/Dialog.js +65 -0
- data/webpack/move_to_foreman/components/common/Dialog/__tests__/Dialog.test.js +61 -0
- data/webpack/move_to_foreman/components/common/Dialog/__tests__/__snapshots__/Dialog.test.js.snap +349 -0
- data/webpack/move_to_foreman/components/common/Dialog/index.js +3 -0
- data/webpack/move_to_foreman/components/common/ModalProgressBar/ModalProgressBar.js +43 -0
- data/webpack/move_to_foreman/components/common/ModalProgressBar/ModalProgressBar.scss +15 -0
- data/webpack/move_to_foreman/components/common/ModalProgressBar/__tests__/ModalProgressBar.test.js +22 -0
- data/webpack/move_to_foreman/components/common/ModalProgressBar/__tests__/__snapshots__/ModalProgressBar.test.js.snap +60 -0
- data/webpack/move_to_foreman/components/common/ModalProgressBar/index.js +4 -0
- data/webpack/move_to_foreman/components/common/emptyState/index.js +49 -0
- data/webpack/move_to_foreman/components/common/table/index.js +88 -0
- data/webpack/move_to_foreman/foreman_toast_notifications.js +22 -0
- data/webpack/move_to_pf/TypeAhead/TypeAhead.js +125 -0
- data/webpack/move_to_pf/TypeAhead/TypeAhead.scss +7 -0
- data/webpack/move_to_pf/TypeAhead/TypeAheadInput.js +47 -0
- data/webpack/move_to_pf/TypeAhead/TypeAheadItems.js +60 -0
- data/webpack/move_to_pf/TypeAhead/helpers.js +5 -0
- data/webpack/move_to_pf/react-bootstrap-select/index.js +65 -0
- data/webpack/redux/actions/RedHatRepositories/enabled.js +53 -0
- data/webpack/redux/actions/RedHatRepositories/helpers.js +38 -0
- data/webpack/redux/actions/RedHatRepositories/repositorySetRepositories.js +50 -0
- data/webpack/redux/actions/RedHatRepositories/sets.js +42 -0
- data/webpack/redux/consts.js +18 -0
- data/webpack/redux/index.js +9 -0
- data/webpack/redux/reducers/RedHatRepositories/enabled.fixtures.js +149 -0
- data/webpack/redux/reducers/RedHatRepositories/enabled.js +80 -0
- data/webpack/redux/reducers/RedHatRepositories/enabled.test.js +36 -0
- data/webpack/redux/reducers/RedHatRepositories/filters.fixtures.js +5 -0
- data/webpack/redux/reducers/RedHatRepositories/index.js +10 -0
- data/webpack/redux/reducers/RedHatRepositories/repositorySetRepositories.fixtures.js +135 -0
- data/webpack/redux/reducers/RedHatRepositories/repositorySetRepositories.js +97 -0
- data/webpack/redux/reducers/RedHatRepositories/repositorySetRepositories.test.js +66 -0
- data/webpack/redux/reducers/RedHatRepositories/sets.fixtures.js +123 -0
- data/webpack/redux/reducers/RedHatRepositories/sets.js +41 -0
- data/webpack/redux/reducers/RedHatRepositories/sets.test.js +36 -0
- data/webpack/redux/reducers/index.js +14 -0
- data/webpack/scenes/Organizations/OrganizationActions.js +60 -0
- data/webpack/scenes/Organizations/OrganizationConstants.js +7 -0
- data/webpack/scenes/Organizations/OrganizationReducer.js +32 -0
- data/webpack/scenes/Organizations/__tests__/OrganizationActions.test.js +59 -0
- data/webpack/scenes/Organizations/__tests__/OrganizationReducer.test.js +56 -0
- data/webpack/scenes/Organizations/__tests__/organizations.fixtures.js +99 -0
- data/webpack/scenes/RedHatRepositories/components/EnabledRepository.js +114 -0
- data/webpack/scenes/RedHatRepositories/components/EnabledRepository.stories.js +13 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySet.js +35 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepositories.js +64 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository.js +127 -0
- data/webpack/scenes/RedHatRepositories/components/RepositoryTypeIcon.js +33 -0
- data/webpack/scenes/RedHatRepositories/components/Search.js +91 -0
- data/webpack/scenes/RedHatRepositories/components/SearchBar.js +145 -0
- data/webpack/scenes/RedHatRepositories/components/__tests__/RepositoryTypeIcon.test.js +28 -0
- data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/RepositoryTypeIcon.test.js.snap +143 -0
- data/webpack/scenes/RedHatRepositories/helpers.js +72 -0
- data/webpack/scenes/RedHatRepositories/index.js +91 -0
- data/webpack/scenes/RedHatRepositories/index.scss +63 -0
- data/webpack/scenes/Subscriptions/EntitlementsInlineEditFormatter.js +87 -0
- data/webpack/scenes/Subscriptions/Manifest/DeleteManifestModalText.js +22 -0
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +243 -0
- data/webpack/scenes/Subscriptions/Manifest/Manifest.scss +3 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +114 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestConstants.js +15 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js +34 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryTableSchema.js +46 -0
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManageManifestModal.test.js +26 -0
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestActions.test.js +113 -0
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js +36 -0
- data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +363 -0
- data/webpack/scenes/Subscriptions/Manifest/__tests__/manifest.fixtures.js +216 -0
- data/webpack/scenes/Subscriptions/Manifest/index.js +28 -0
- data/webpack/scenes/Subscriptions/SubscriptionActions.js +119 -0
- data/webpack/scenes/Subscriptions/SubscriptionConstants.js +27 -0
- data/webpack/scenes/Subscriptions/SubscriptionHelpers.js +3 -0
- data/webpack/scenes/Subscriptions/SubscriptionReducer.js +123 -0
- data/webpack/scenes/Subscriptions/SubscriptionValidations.js +25 -0
- data/webpack/scenes/Subscriptions/Subscriptions.scss +14 -0
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +275 -0
- data/webpack/scenes/Subscriptions/SubscriptionsTable.js +336 -0
- data/webpack/scenes/Subscriptions/SubscriptionsTableSchema.js +117 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsActions.js +61 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsContstants.js +7 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +246 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsReducer.js +59 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js +120 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsActions.test.js +64 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsPage.test.js +22 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsReducer.test.js +57 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/__snapshots__/UpstreamSubscriptionsPage.test.js.snap +226 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/upstreamSubscriptions.fixtures.js +162 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/index.js +20 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionValidations.test.js +66 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsActions.test.js +126 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +26 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsReducer.test.js +67 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsTable.test.js +47 -0
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +198 -0
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +419 -0
- data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +364 -0
- data/webpack/scenes/Subscriptions/index.js +27 -0
- data/webpack/scenes/Tasks/TaskActions.js +75 -0
- data/webpack/scenes/Tasks/TaskConstants.js +7 -0
- data/webpack/scenes/Tasks/__tests__/TaskActions.test.js +81 -0
- data/webpack/scenes/Tasks/__tests__/task.fixtures.js +123 -0
- data/webpack/services/api/fixtures.js +353 -0
- data/webpack/services/api/index.js +105 -0
- data/webpack/services/api/setupMocks.js +17 -0
- data/webpack/services/index.js +59 -0
- data/webpack/stories/index.js +12 -0
- data/webpack/test_setup.js +9 -0
- metadata +265 -61
- data/app/assets/javascripts/katello/providers/provider_redhat.js +0 -185
- data/app/assets/javascripts/katello/providers/redhat/index.js +0 -3
- data/app/controllers/katello/products_controller.rb +0 -106
- data/app/controllers/katello/providers_controller.rb +0 -64
- data/app/helpers/katello/providers_helper.rb +0 -93
- data/app/models/katello/subscription_product.rb +0 -6
- data/app/views/foreman/unattended/finish-katello.erb +0 -60
- data/app/views/foreman/unattended/kickstart-katello-atomic.erb +0 -51
- data/app/views/foreman/unattended/kickstart-katello.erb +0 -139
- data/app/views/foreman/unattended/snippets/_subscription_manager_registration.erb +0 -18
- data/app/views/foreman/unattended/userdata-katello.erb +0 -92
- data/app/views/katello/providers/redhat/_enable_errors.html.erb +0 -12
- data/app/views/katello/providers/redhat/_errors.html.erb +0 -19
- data/app/views/katello/providers/redhat/_repo_sets.html.erb +0 -56
- data/app/views/katello/providers/redhat/_repos.html.erb +0 -60
- data/app/views/katello/providers/redhat/_tab.html.erb +0 -9
- data/app/views/katello/providers/redhat/show.html.erb +0 -35
- data/db/seeds.d/103-provisioning_templates.rb +0 -42
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/errata-content-hosts.html +0 -28
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/errata-details.html +0 -59
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js +0 -48
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-products.controller.js +0 -36
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-repositories.controller.js +0 -36
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/views/gpg-key-details.html +0 -36
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/gpg-key.factory.js +0 -43
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/gpg-keys.routes.js +0 -76
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/new/new-gpg-key.controller.js +0 -39
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/new/views/new-gpg-key.html +0 -44
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/views/gpg-keys.html +0 -46
@@ -2,6 +2,11 @@ module Katello
|
|
2
2
|
class Api::V2::RepositoriesController < Api::V2::ApiController # rubocop:disable Metrics/ClassLength
|
3
3
|
include Katello::Concerns::FilteredAutoCompleteSearch
|
4
4
|
|
5
|
+
CONTENT_CREDENTIAL_GPG_KEY_TYPE = "gpg_key".freeze
|
6
|
+
CONTENT_CREDENTIAL_SSL_CA_CERT_TYPE = "ssl_ca_cert".freeze
|
7
|
+
CONTENT_CREDENTIAL_SSL_CLIENT_CERT_TYPE = "ssl_client_cert".freeze
|
8
|
+
CONTENT_CREDENTIAL_SSL_CLIENT_KEY_TYPE = "ssl_client_key".freeze
|
9
|
+
|
5
10
|
before_action :find_optional_organization, :only => [:index, :auto_complete_search]
|
6
11
|
before_action :find_product, :only => [:index, :auto_complete_search]
|
7
12
|
before_action :find_product_for_create, :only => [:create]
|
@@ -11,7 +16,10 @@ module Katello
|
|
11
16
|
:import_uploads, :gpg_key_content]
|
12
17
|
before_action :find_content, :only => :remove_content
|
13
18
|
before_action :find_organization_from_repo, :only => [:update]
|
14
|
-
before_action :
|
19
|
+
before_action :only => [:create, :update] { find_content_credential CONTENT_CREDENTIAL_GPG_KEY_TYPE }
|
20
|
+
before_action :only => [:create, :update] { find_content_credential CONTENT_CREDENTIAL_SSL_CA_CERT_TYPE }
|
21
|
+
before_action :only => [:create, :update] { find_content_credential CONTENT_CREDENTIAL_SSL_CLIENT_CERT_TYPE }
|
22
|
+
before_action :only => [:create, :update] { find_content_credential CONTENT_CREDENTIAL_SSL_CLIENT_KEY_TYPE }
|
15
23
|
before_action :error_on_rh_product, :only => [:create]
|
16
24
|
before_action :error_on_rh_repo, :only => [:destroy]
|
17
25
|
|
@@ -21,6 +29,9 @@ module Katello
|
|
21
29
|
def_param_group :repo do
|
22
30
|
param :url, String, :desc => N_("repository source url")
|
23
31
|
param :gpg_key_id, :number, :desc => N_("id of the gpg key that will be assigned to the new repository")
|
32
|
+
param :ssl_ca_cert_id, :number, :desc => N_("Idenifier of the SSL CA Cert")
|
33
|
+
param :ssl_client_cert_id, :number, :desc => N_("Identifier of the SSL Client Cert")
|
34
|
+
param :ssl_client_key_id, :number, :desc => N_("Identifier of the SSL Client Key")
|
24
35
|
param :unprotected, :bool, :desc => N_("true if this repository can be published via HTTP")
|
25
36
|
param :checksum_type, String, :desc => N_("checksum of the repository, currently 'sha1' & 'sha256' are supported.")
|
26
37
|
param :docker_upstream_name, String, :desc => N_("name of the upstream docker repository")
|
@@ -35,6 +46,7 @@ module Katello
|
|
35
46
|
param :deb_components, String, :desc => N_("comma separated list of repo components to be synched from deb-archive")
|
36
47
|
param :deb_architectures, String, :desc => N_("comma separated list of architectures to be synched from deb-archive")
|
37
48
|
param :ignore_global_proxy, :bool, :desc => N_("if true, will ignore the globally configured proxy when syncing.")
|
49
|
+
param :ignorable_content, Array, :desc => N_("List of content units to ignore while syncing a yum repository. Must be subset of %s") % Repository::IGNORABLE_CONTENT_UNIT_TYPES.join(",")
|
38
50
|
end
|
39
51
|
|
40
52
|
def_param_group :repo_create do
|
@@ -65,8 +77,28 @@ module Katello
|
|
65
77
|
:required => false
|
66
78
|
param_group :search, Api::V2::ApiController
|
67
79
|
def index
|
80
|
+
base_args = [index_relation.distinct, :name, :asc]
|
68
81
|
options = {:includes => [:gpg_key, :product, :environment]}
|
69
|
-
|
82
|
+
|
83
|
+
respond_to do |format|
|
84
|
+
format.csv do
|
85
|
+
options[:csv] = true
|
86
|
+
repos = scoped_search(*base_args, options)
|
87
|
+
csv_response(repos,
|
88
|
+
[:id, :name, :label, :content_type, :arch, :url, :major, :minor,
|
89
|
+
:cp_label, :content_label, :pulp_id, :container_repository_name,
|
90
|
+
:download_policy, 'relative_path', 'product.id', 'product.name',
|
91
|
+
'environment_id'],
|
92
|
+
['Id', 'Name', 'label', 'Content Type', 'Arch', 'Url', 'Major', 'Minor',
|
93
|
+
'Candlepin Label', 'Content Label', 'Pulp Id', 'Container Repository Name',
|
94
|
+
'Download Policy', 'Relative Path', 'Product Id', 'Product Name',
|
95
|
+
'Environment Id'])
|
96
|
+
end
|
97
|
+
format.any do
|
98
|
+
repos = scoped_search(*base_args, options)
|
99
|
+
respond(:collection => repos)
|
100
|
+
end
|
101
|
+
end
|
70
102
|
end
|
71
103
|
|
72
104
|
def index_relation
|
@@ -142,38 +174,28 @@ module Katello
|
|
142
174
|
param :name, String, :required => true
|
143
175
|
param_group :repo_create
|
144
176
|
param_group :repo
|
145
|
-
def create
|
177
|
+
def create
|
146
178
|
repo_params = repository_params
|
147
179
|
unless RepositoryTypeManager.creatable_by_user?(repo_params[:content_type])
|
148
180
|
msg = _("Invalid params provided - content_type must be one of %s") % RepositoryTypeManager.creatable_repository_types.keys.join(",")
|
149
181
|
fail HttpErrors::UnprocessableEntity, msg
|
150
182
|
end
|
151
183
|
|
152
|
-
gpg_key =
|
153
|
-
|
154
|
-
|
155
|
-
|
184
|
+
gpg_key = get_content_credential(repo_params, CONTENT_CREDENTIAL_GPG_KEY_TYPE)
|
185
|
+
ssl_ca_cert = get_content_credential(repo_params, CONTENT_CREDENTIAL_SSL_CA_CERT_TYPE)
|
186
|
+
ssl_client_cert = get_content_credential(repo_params, CONTENT_CREDENTIAL_SSL_CLIENT_CERT_TYPE)
|
187
|
+
ssl_client_key = get_content_credential(repo_params, CONTENT_CREDENTIAL_SSL_CLIENT_KEY_TYPE)
|
188
|
+
|
156
189
|
repo_params[:label] = labelize_params(repo_params)
|
157
190
|
repo_params[:arch] = repo_params[:arch] || 'noarch'
|
158
191
|
repo_params[:url] = nil if repo_params[:url].blank?
|
159
192
|
repo_params[:unprotected] = repo_params.key?(:unprotected) ? repo_params[:unprotected] : true
|
160
193
|
repo_params[:gpg_key] = gpg_key
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
repository
|
166
|
-
repository.upstream_username = repo_params[:upstream_username] if repo_params.key?(:upstream_username)
|
167
|
-
repository.upstream_password = repo_params[:upstream_password] if repo_params.key?(:upstream_password)
|
168
|
-
if repository.ostree?
|
169
|
-
repository.ostree_upstream_sync_policy = repo_params[:ostree_upstream_sync_policy]
|
170
|
-
repository.ostree_upstream_sync_depth = repo_params[:ostree_upstream_sync_depth]
|
171
|
-
end
|
172
|
-
if repository.deb?
|
173
|
-
repository.deb_releases = repo_params[:deb_releases] if repo_params[:deb_releases]
|
174
|
-
repository.deb_components = repo_params[:deb_components] if repo_params[:deb_components]
|
175
|
-
repository.deb_architectures = repo_params[:deb_architectures] if repo_params[:deb_architectures]
|
176
|
-
end
|
194
|
+
repo_params[:ssl_ca_cert] = ssl_ca_cert
|
195
|
+
repo_params[:ssl_client_cert] = ssl_client_cert
|
196
|
+
repo_params[:ssl_client_key] = ssl_client_key
|
197
|
+
|
198
|
+
repository = construct_repo_from_params(repo_params)
|
177
199
|
sync_task(::Actions::Katello::Repository::Create, repository, false, true)
|
178
200
|
repository = Repository.find(repository.id)
|
179
201
|
respond_for_show(:resource => repository)
|
@@ -248,6 +270,8 @@ module Katello
|
|
248
270
|
|
249
271
|
fail HttpErrors::BadRequest, _("Repository content type must be 'yum' to export.") unless @repository.content_type == 'yum'
|
250
272
|
|
273
|
+
fail HttpErrors::BadRequest, _("On demand repositories cannot be exported.") if @repository.download_policy == ::Runcible::Models::YumImporter::DOWNLOAD_ON_DEMAND
|
274
|
+
|
251
275
|
task = async_task(::Actions::Katello::Repository::Export, [@repository],
|
252
276
|
::Foreman::Cast.to_bool(params[:export_to_iso]),
|
253
277
|
params[:since].try(:to_datetime),
|
@@ -319,7 +343,7 @@ module Katello
|
|
319
343
|
param :id, :number, :required => true, :desc => N_("repository ID")
|
320
344
|
param :content, File, :required => true, :desc => N_("Content files to upload. Can be a single file or array of files.")
|
321
345
|
def upload_content
|
322
|
-
fail Katello::Errors::InvalidRepositoryContent, _("Cannot upload
|
346
|
+
fail Katello::Errors::InvalidRepositoryContent, _("Cannot upload Container Image content.") if @repository.docker?
|
323
347
|
|
324
348
|
filepaths = Array.wrap(params[:content]).compact.collect do |content|
|
325
349
|
{path: content.path, filename: content.original_filename}
|
@@ -351,7 +375,8 @@ module Katello
|
|
351
375
|
param 'id', String, :required => true
|
352
376
|
param 'size', String
|
353
377
|
param 'checksum', String
|
354
|
-
param 'name', String, :desc => N_("Needs to only be set for file repositories")
|
378
|
+
param 'name', String, :desc => N_("Needs to only be set for file repositories or docker tags")
|
379
|
+
param 'digest', String, :desc => N_("Needs to only be set for docker tags")
|
355
380
|
end
|
356
381
|
def import_uploads
|
357
382
|
generate_metadata = ::Foreman::Cast.to_bool(params.fetch(:publish_repository, true))
|
@@ -362,7 +387,7 @@ module Katello
|
|
362
387
|
end
|
363
388
|
|
364
389
|
uploads = (params[:uploads] || []).map do |upload|
|
365
|
-
upload.permit(:id, :size, :checksum, :name).to_h
|
390
|
+
upload.permit(:id, :size, :checksum, :name, :digest).to_h
|
366
391
|
end
|
367
392
|
|
368
393
|
if params.key?(:upload_ids)
|
@@ -372,16 +397,18 @@ module Katello
|
|
372
397
|
|
373
398
|
upload_ids = uploads.map { |upload| upload['id'] }
|
374
399
|
unit_keys = uploads.map do |upload|
|
375
|
-
if @repository.file?
|
400
|
+
if @repository.file? || @repository.docker?
|
376
401
|
upload.except('id')
|
377
402
|
else
|
378
403
|
upload.except('id').except('name')
|
379
404
|
end
|
380
405
|
end
|
381
406
|
|
407
|
+
unit_type_id = unit_keys[0] && unit_keys[0].include?('digest') ? 'docker_tag' : @repository.unit_type_id
|
408
|
+
|
382
409
|
begin
|
383
410
|
task = send(async ? :async_task : :sync_task, ::Actions::Katello::Repository::ImportUpload,
|
384
|
-
@repository, upload_ids, :unit_keys => unit_keys,
|
411
|
+
@repository, upload_ids, :unit_type_id => unit_type_id, :unit_keys => unit_keys,
|
385
412
|
:generate_metadata => generate_metadata, :sync_capsule => sync_capsule)
|
386
413
|
respond_for_async(resource: task)
|
387
414
|
rescue => e
|
@@ -417,25 +444,67 @@ module Katello
|
|
417
444
|
@repository = Repository.find(params[:id])
|
418
445
|
end
|
419
446
|
|
420
|
-
def
|
421
|
-
|
422
|
-
|
423
|
-
|
447
|
+
def find_content_credential(content_type)
|
448
|
+
credential_id = "#{content_type}_id".to_sym
|
449
|
+
credential_var = "@#{content_type}"
|
450
|
+
|
451
|
+
if params[credential_id]
|
452
|
+
credential_value = GpgKey.readable.where(:id => params[credential_id], :organization_id => @organization).first
|
453
|
+
instance_variable_set(credential_var, credential_value)
|
454
|
+
if instance_variable_get(credential_var).nil?
|
455
|
+
fail HttpErrors::NotFound, _("Couldn't find %{content_type} with id '%{id}'") % { :content_type => content_type, :id => params[credential_id] }
|
456
|
+
end
|
424
457
|
end
|
425
458
|
end
|
426
459
|
|
427
460
|
def repository_params
|
428
461
|
keys = [:download_policy, :mirror_on_sync, :arch, :verify_ssl_on_sync, :upstream_password, :upstream_username,
|
429
462
|
:ostree_upstream_sync_depth, :ostree_upstream_sync_policy, :ignore_global_proxy,
|
430
|
-
:deb_releases, :deb_components, :deb_architectures
|
463
|
+
:deb_releases, :deb_components, :deb_architectures, {:ignorable_content => []}
|
431
464
|
]
|
465
|
+
|
432
466
|
keys += [:label, :content_type] if params[:action] == "create"
|
433
467
|
if params[:action] == 'create' || @repository.custom?
|
434
|
-
keys += [:url, :gpg_key_id, :unprotected, :name, :checksum_type, :docker_upstream_name]
|
468
|
+
keys += [:url, :gpg_key_id, :ssl_ca_cert_id, :ssl_client_cert_id, :ssl_client_key_id, :unprotected, :name, :checksum_type, :docker_upstream_name]
|
435
469
|
end
|
436
470
|
params.require(:repository).permit(*keys).to_h
|
437
471
|
end
|
438
472
|
|
473
|
+
def get_content_credential(repo_params, content_type)
|
474
|
+
credential_value = @product.send(content_type)
|
475
|
+
|
476
|
+
unless repo_params["#{content_type}_id".to_sym].blank?
|
477
|
+
credential_value = instance_variable_get("@#{content_type}")
|
478
|
+
end
|
479
|
+
|
480
|
+
credential_value
|
481
|
+
end
|
482
|
+
|
483
|
+
def construct_repo_from_params(repo_params)
|
484
|
+
repository = @product.add_repo(Hash[repo_params.slice(:label, :name, :url, :content_type, :arch, :unprotected,
|
485
|
+
:gpg_key, :ssl_ca_cert, :ssl_client_cert, :ssl_client_key,
|
486
|
+
:checksum_type, :download_policy).to_h.map { |k, v| [k.to_sym, v] }])
|
487
|
+
repository.docker_upstream_name = repo_params[:docker_upstream_name] if repo_params[:docker_upstream_name]
|
488
|
+
repository.mirror_on_sync = ::Foreman::Cast.to_bool(repo_params[:mirror_on_sync]) if repo_params.key?(:mirror_on_sync)
|
489
|
+
repository.ignore_global_proxy = ::Foreman::Cast.to_bool(repo_params[:ignore_global_proxy]) if repo_params.key?(:ignore_global_proxy)
|
490
|
+
repository.verify_ssl_on_sync = ::Foreman::Cast.to_bool(repo_params[:verify_ssl_on_sync]) if repo_params.key?(:verify_ssl_on_sync)
|
491
|
+
repository.upstream_username = repo_params[:upstream_username] if repo_params.key?(:upstream_username)
|
492
|
+
repository.upstream_password = repo_params[:upstream_password] if repo_params.key?(:upstream_password)
|
493
|
+
repository.ignorable_content = repo_params[:ignorable_content] if repository.yum? && repo_params.key?(:ignorable_content)
|
494
|
+
|
495
|
+
if repository.ostree?
|
496
|
+
repository.ostree_upstream_sync_policy = repo_params[:ostree_upstream_sync_policy]
|
497
|
+
repository.ostree_upstream_sync_depth = repo_params[:ostree_upstream_sync_depth]
|
498
|
+
end
|
499
|
+
if repository.deb?
|
500
|
+
repository.deb_releases = repo_params[:deb_releases] if repo_params[:deb_releases]
|
501
|
+
repository.deb_components = repo_params[:deb_components] if repo_params[:deb_components]
|
502
|
+
repository.deb_architectures = repo_params[:deb_architectures] if repo_params[:deb_architectures]
|
503
|
+
end
|
504
|
+
|
505
|
+
repository
|
506
|
+
end
|
507
|
+
|
439
508
|
def error_on_rh_product
|
440
509
|
fail HttpErrors::BadRequest, _("Red Hat products cannot be manipulated.") if @product.redhat?
|
441
510
|
end
|
@@ -2,10 +2,12 @@ module Katello
|
|
2
2
|
class Api::V2::RepositorySetsController < Api::V2::ApiController
|
3
3
|
respond_to :json
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
include Katello::Concerns::FilteredAutoCompleteSearch
|
6
|
+
|
7
|
+
before_action :find_product, :except => [:index, :auto_complete_search]
|
8
|
+
before_action :find_product_or_organization, :only => [:index, :auto_complete_search]
|
7
9
|
before_action :custom_product?
|
8
|
-
before_action :find_product_content, :except => [:index]
|
10
|
+
before_action :find_product_content, :except => [:index, :auto_complete_search]
|
9
11
|
|
10
12
|
resource_description do
|
11
13
|
api_version "v2"
|
@@ -38,7 +40,7 @@ module Katello
|
|
38
40
|
repos = repos.select do |repo|
|
39
41
|
if repo[:path].include?('kickstart')
|
40
42
|
variants = ['Server', 'Client', 'ComputeNode', 'Workstation']
|
41
|
-
has_variant = variants.any? { |v| repo[:substitutions][:releasever].include
|
43
|
+
has_variant = variants.any? { |v| repo[:substitutions][:releasever].try(:include?, v) }
|
42
44
|
has_variant ? repo[:enabled] : true
|
43
45
|
else
|
44
46
|
true
|
@@ -73,22 +75,26 @@ module Katello
|
|
73
75
|
respond_for_async :resource => task
|
74
76
|
end
|
75
77
|
|
76
|
-
|
78
|
+
protected
|
79
|
+
|
80
|
+
def resource_class
|
81
|
+
Katello::Content
|
82
|
+
end
|
77
83
|
|
78
84
|
def default_sort
|
79
|
-
lambda { |relation| relation.
|
85
|
+
lambda { |relation| relation.order("#{Katello::Content.table_name}.name asc") }
|
80
86
|
end
|
81
87
|
|
82
88
|
def index_relation
|
83
89
|
if @product.nil?
|
84
|
-
relation = @organization.
|
90
|
+
relation = @organization.product_contents.displayable
|
85
91
|
else
|
86
92
|
relation = @product.displayable_product_contents
|
87
93
|
end
|
88
94
|
|
89
95
|
relation = relation.enabled(@organization) if ::Foreman::Cast.to_bool(params[:enabled])
|
90
|
-
relation = relation.
|
91
|
-
relation
|
96
|
+
relation = relation.where(Katello::Content.table_name => {:name => params[:name]}) if params[:name].present?
|
97
|
+
relation.redhat
|
92
98
|
end
|
93
99
|
|
94
100
|
def find_product_content
|
@@ -96,15 +102,16 @@ module Katello
|
|
96
102
|
fail HttpErrors::NotFound, _("Couldn't find repository set with id '%s'.") % params[:id] if @product_content.nil?
|
97
103
|
end
|
98
104
|
|
99
|
-
def
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
105
|
+
def find_product_or_organization
|
106
|
+
if params[:product_id]
|
107
|
+
find_product
|
108
|
+
else
|
109
|
+
@organization = find_organization
|
110
|
+
end
|
104
111
|
end
|
105
112
|
|
106
113
|
def find_product
|
107
|
-
@product =
|
114
|
+
@product = Product.find_by(:id => params[:product_id])
|
108
115
|
fail HttpErrors::NotFound, _("Couldn't find product with id '%s'") % params[:product_id] if @product.nil?
|
109
116
|
@organization = @product.organization
|
110
117
|
end
|
@@ -7,6 +7,7 @@ module Katello
|
|
7
7
|
before_action :find_optional_organization, :only => [:index, :available, :show]
|
8
8
|
before_action :find_organization, :only => [:upload, :delete_manifest,
|
9
9
|
:refresh_manifest, :manifest_history]
|
10
|
+
before_action :check_disconnected, only: [:refresh_manifest]
|
10
11
|
before_action :find_provider
|
11
12
|
before_action :deprecated, :only => [:create, :destroy]
|
12
13
|
|
@@ -29,15 +30,38 @@ module Katello
|
|
29
30
|
param :match_installed, :bool, :desc => N_("Return subscriptions that match installed products of the specified host")
|
30
31
|
param :no_overlap, :bool, :desc => N_("Return subscriptions which do not overlap with a currently-attached subscription")
|
31
32
|
def index
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
33
|
+
options = { resource_class: Pool, includes: [:subscription], custom_sort: name_sort }
|
34
|
+
base_args = [index_relation.distinct, nil, nil]
|
35
|
+
|
36
|
+
respond_to do |format|
|
37
|
+
format.csv do
|
38
|
+
options[:csv] = true
|
39
|
+
collection = scoped_search(*base_args, options)
|
40
|
+
csv_response(collection,
|
41
|
+
[:id, :subscription_id, :name, :cp_id, :organization_id, :sockets, :cores,
|
42
|
+
:start_date, :end_date, :available, :quantity, :account_number, :contract_number,
|
43
|
+
:support_level, :ram, :stacking_id, :multi_entitlement, :type, :product_id,
|
44
|
+
:unmapped_guest, :virt_only, :virt_who, :upstream?],
|
45
|
+
['Pool Id', 'Subscription Id', 'Name', 'Candlepin Id', 'Organization Id',
|
46
|
+
'Sockets', 'Cores', 'Start Date', 'End Date', 'Available', 'Quantity', 'Account Number',
|
47
|
+
'Contract Number', 'Support Level', 'RAM', 'Stacking Id', 'Multi Entitlement', 'Type',
|
48
|
+
'Product Id', 'Unmapped Guest', 'Virt Only', 'Requires Virt Who', 'Upstream'])
|
49
|
+
end
|
50
|
+
format.any do
|
51
|
+
collection = scoped_search(*base_args, options)
|
52
|
+
if params[:activation_key_id]
|
53
|
+
key_pools = @activation_key.get_key_pools
|
54
|
+
collection[:results] = collection[:results].map do |pool|
|
55
|
+
ActivationKeySubscriptionsPresenter.new(pool, key_pools)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
respond(:collection => collection)
|
38
59
|
end
|
39
60
|
end
|
40
|
-
|
61
|
+
end
|
62
|
+
|
63
|
+
def name_sort
|
64
|
+
lambda { |relation| relation.order("katello_subscriptions.name ASC") }
|
41
65
|
end
|
42
66
|
|
43
67
|
def index_relation
|
@@ -0,0 +1,93 @@
|
|
1
|
+
module Katello
|
2
|
+
class Api::V2::UpstreamSubscriptionsController < Api::V2::ApiController
|
3
|
+
before_action :check_disconnected
|
4
|
+
|
5
|
+
resource_description do
|
6
|
+
description "Red Hat subscriptions management platform."
|
7
|
+
api_version 'v2'
|
8
|
+
end
|
9
|
+
|
10
|
+
def_param_group :cp_search do
|
11
|
+
param :page, :number, :desc => N_("Page number, starting at 1")
|
12
|
+
param :per_page, :number, :desc => N_("Number of results per page to return.")
|
13
|
+
param :order, String, :desc => N_("The order to sort the results in. ['asc', 'desc'] Defaults to 'desc'.")
|
14
|
+
param :sort_by, String, :desc => N_("The field to sort the data by. Defaults to the created date.")
|
15
|
+
end
|
16
|
+
|
17
|
+
api :GET, "/organizations/:organization_id/upstream_subscriptions",
|
18
|
+
N_("List available subscriptions from Red Hat Subscription Management")
|
19
|
+
param :organization_id, :number, :desc => N_("Organization ID"), :required => true
|
20
|
+
param_group :cp_search
|
21
|
+
param :pool_ids, Array, desc: N_("Return only the upstream pools which map to the given local pool IDs")
|
22
|
+
param :quantities_only, :bool, desc: N_("Only returns id and quantity fields")
|
23
|
+
param :attachable, :bool, desc: N_("Return only subscriptions which can be attached to the upstream allocation")
|
24
|
+
def index
|
25
|
+
index_params = upstream_pool_params
|
26
|
+
pools = UpstreamPool.fetch_pools(index_params)
|
27
|
+
page = index_params[:page] || 1
|
28
|
+
|
29
|
+
collection = scoped_search_results(
|
30
|
+
pools[:pools], pools[:subtotal], pools[:total], page, index_params[:per_page], nil)
|
31
|
+
respond(collection: collection)
|
32
|
+
end
|
33
|
+
|
34
|
+
api :PUT, "/organizations/:organization_id/upstream_subscriptions",
|
35
|
+
N_("Update the quantity of one or more subscriptions on an upstream allocation")
|
36
|
+
param :organization_id, :number, :desc => N_("Organization ID"), :required => true
|
37
|
+
param :pools, Array, desc: N_("Array of Pools to be updated. Only pools originating upstream are accepted."), required: true do
|
38
|
+
param :id, String, desc: N_("ID of local pool to update"), required: true
|
39
|
+
param :quantity, Integer, desc: N_("Desired quantity of the pool"), required: true
|
40
|
+
end
|
41
|
+
def update
|
42
|
+
task = async_task(::Actions::Katello::UpstreamSubscriptions::UpdateEntitlements, update_params)
|
43
|
+
respond_for_async :resource => task
|
44
|
+
end
|
45
|
+
|
46
|
+
api :DELETE, "/organizations/:organization_id/upstream_subscriptions",
|
47
|
+
N_("Remove one or more subscriptions from an upstream subscription allocation")
|
48
|
+
param :organization_id, :number, :desc => N_("Organization ID"), :required => true
|
49
|
+
param :pool_ids, Array, desc: N_("Array of local pool IDs. Only pools originating upstream are accepted."), required: true
|
50
|
+
def destroy
|
51
|
+
task = async_task(::Actions::Katello::UpstreamSubscriptions::RemoveEntitlements, params[:pool_ids])
|
52
|
+
respond_for_async :resource => task
|
53
|
+
end
|
54
|
+
|
55
|
+
api :POST, "/organizations/:organization_id/upstream_subscriptions",
|
56
|
+
N_("Add subscriptions consumed by a manifest from Red Hat Subscription Management")
|
57
|
+
param :pools, Array, desc: N_("Array of pools to add"), required: true do
|
58
|
+
param :id, String, desc: N_("Pool ID"), required: true
|
59
|
+
param :quantity, :number, desc: N_("Quantity of entitlements to bind"), required: true
|
60
|
+
end
|
61
|
+
param :organization_id, :number, :desc => N_("Organization ID"), :required => true
|
62
|
+
def create
|
63
|
+
task = async_task(::Actions::Katello::UpstreamSubscriptions::BindEntitlements,
|
64
|
+
bind_entitlements_params)
|
65
|
+
respond_for_async resource: task
|
66
|
+
end
|
67
|
+
|
68
|
+
private
|
69
|
+
|
70
|
+
def update_params
|
71
|
+
params.permit(pools: [:id, :quantity])[:pools].map(&:to_h)
|
72
|
+
end
|
73
|
+
|
74
|
+
def upstream_pool_params
|
75
|
+
upstream_params = params.permit(:page, :per_page, :order, :sort_by, :quantities_only, :attachable, pool_ids: []).to_h
|
76
|
+
|
77
|
+
if params[:full_result]
|
78
|
+
upstream_params.delete(:per_page)
|
79
|
+
upstream_params.delete(:page)
|
80
|
+
elsif !params[:per_page]
|
81
|
+
upstream_params[:per_page] = Setting[:entries_per_page]
|
82
|
+
end
|
83
|
+
|
84
|
+
upstream_params
|
85
|
+
end
|
86
|
+
|
87
|
+
def bind_entitlements_params
|
88
|
+
params.permit(pools: [:id, :quantity])[:pools].map do |pool|
|
89
|
+
{ "pool" => pool[:id], "quantity" => pool[:quantity] } if pool
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|