Skip to content

Commit

Permalink
Fixes #36589 - Added support for calling ACS bulk actions through ham…
Browse files Browse the repository at this point in the history
…mer.
  • Loading branch information
qcjames53 authored and chris1984 committed Jul 31, 2023
1 parent 05ef2c8 commit 1f29a1a
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/hammer_cli_katello/acs.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'hammer_cli_katello/acs_bulk_actions'

module HammerCLIKatello
class AcsCommand < HammerCLIKatello::Command
resource :alternate_content_sources
Expand Down Expand Up @@ -95,6 +97,11 @@ class RefreshCommand < HammerCLIKatello::SingleResourceCommand

build_options
end

autoload_subcommands

self.subcommand "bulk",
HammerCLIKatello::AcsBulkActionsCommand.desc,
HammerCLIKatello::AcsBulkActionsCommand
end
end
38 changes: 38 additions & 0 deletions lib/hammer_cli_katello/acs_bulk_actions.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1f29a1a

Please sign in to comment.