diff --git a/lib/hammer_cli_katello/acs.rb b/lib/hammer_cli_katello/acs.rb index 6e952eb3..3cf56d1b 100644 --- a/lib/hammer_cli_katello/acs.rb +++ b/lib/hammer_cli_katello/acs.rb @@ -1,3 +1,5 @@ +require 'hammer_cli_katello/acs_bulk_actions' + module HammerCLIKatello class AcsCommand < HammerCLIKatello::Command resource :alternate_content_sources @@ -95,6 +97,11 @@ class RefreshCommand < HammerCLIKatello::SingleResourceCommand build_options end + autoload_subcommands + + self.subcommand "bulk", + HammerCLIKatello::AcsBulkActionsCommand.desc, + HammerCLIKatello::AcsBulkActionsCommand end end diff --git a/lib/hammer_cli_katello/acs_bulk_actions.rb b/lib/hammer_cli_katello/acs_bulk_actions.rb new file mode 100644 index 00000000..d9af90d0 --- /dev/null +++ b/lib/hammer_cli_katello/acs_bulk_actions.rb @@ -0,0 +1,38 @@ +module HammerCLIKatello + class AcsBulkActionsCommand < HammerCLIKatello::Command + desc 'Modify alternate content sources in bulk' + resource :alternate_content_sources_bulk_actions + + class RefreshAllCommand < HammerCLIKatello::SingleResourceCommand + action :refresh_all_alternate_content_sources + command_name 'refresh-all' + desc _("Refresh all alternate content sources") + success_message _("Successfully refreshed all alternate content sources") + failure_message _("Could not refresh all alternate content sources") + + build_options + end + + class RefreshCommand < HammerCLIKatello::SingleResourceCommand + action :refresh_alternate_content_sources + command_name 'refresh' + desc _("Refresh alternate content sources") + success_message _("Successfully refreshed specified alternate content sources") + failure_message _("Could not refresh the specified alternate content sources") + + build_options + end + + class DestroyCommand < HammerCLIKatello::SingleResourceCommand + action :destroy_alternate_content_sources + command_name 'destroy' + desc _("Destroy alternate content sources") + success_message _("Sucessfully destroyed specified alternate content sources") + failure_message _("Could not destroy the specified alternate content sources") + + build_options + end + + autoload_subcommands + end +end