From 368e378a0991506591a1c7abc5204ed942670d10 Mon Sep 17 00:00:00 2001 From: Jeremy Lenz Date: Tue, 8 Oct 2024 10:15:39 -0400 Subject: [PATCH] Fixes #37894 - Add content-view-environments list command --- lib/hammer_cli_katello.rb | 6 +++++ .../content_view_environment.rb | 27 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 lib/hammer_cli_katello/content_view_environment.rb diff --git a/lib/hammer_cli_katello.rb b/lib/hammer_cli_katello.rb index 76907eaf..66da0c2d 100644 --- a/lib/hammer_cli_katello.rb +++ b/lib/hammer_cli_katello.rb @@ -60,6 +60,12 @@ def self.exception_handler_class 'hammer_cli_katello/lifecycle_environment' ) + HammerCLI::MainCommand.lazy_subcommand("content-view-environment", + _("Manipulate content view environments"), + 'HammerCLIKatello::ContentViewEnvironment', + 'hammer_cli_katello/content_view_environment' + ) + HammerCLI::MainCommand.lazy_subcommand("product", _("Manipulate products"), 'HammerCLIKatello::Product', 'hammer_cli_katello/product' diff --git a/lib/hammer_cli_katello/content_view_environment.rb b/lib/hammer_cli_katello/content_view_environment.rb new file mode 100644 index 00000000..b418f43b --- /dev/null +++ b/lib/hammer_cli_katello/content_view_environment.rb @@ -0,0 +1,27 @@ +module HammerCLIKatello + class ContentViewEnvironment < HammerCLIKatello::Command + resource :content_view_environments + + class ListCommand < HammerCLIKatello::ListCommand + output do + field :id, _("Id") + field :label, _("Label") + from :environment do + field :name, _("Lifecycle Environment") + end + from :content_view do + field :name, _("Content View") + end + field :default, _("Default") + field :hosts_count, _("Hosts Count") + from :organization do + field :name, _("Organization") + end + end + + build_options + end + + autoload_subcommands + end +end