Sha256: 1d1d9d0886d3e82a0d5f3a6118fcd5c5acf67fa380d2e9d1f770ae7f1936dfa8

Contents?: true

Size: 1.08 KB

Versions: 18

Compression:

Stored size: 1.08 KB

Contents

module HammerCLIForeman

  class Settings < HammerCLIForeman::Command

    resource :settings

    class ListCommand < HammerCLIForeman::ListCommand

      output do
        field :id, _('Id'), Fields::Id
        field :name, _('Name')
        field :full_name, _('Full name')
        field :value, _('Value')
        field :description, _('Description')
      end

      def extend_data(data)
        data['value'] = data['value'].to_s
        data
      end

      build_options
    end

    class UpdateCommand < HammerCLIForeman::UpdateCommand
      command_name 'set'

      success_message _("Setting [%{name}] updated to [%{value}].")
      failure_message _("Could not update the setting")

      build_options
    end

    class InfoCommand < HammerCLIForeman::InfoCommand
      output do
        field :id, _("Id")
        field :name, _("Name")
        field :description, _("Description")
        field :category_name, _("Category")
        field :settings_type, _("Settings type")
        field :value, _("Value")
      end

      build_options
    end


    autoload_subcommands
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
hammer_cli_foreman-3.14.0 lib/hammer_cli_foreman/settings.rb
hammer_cli_foreman-3.13.0 lib/hammer_cli_foreman/settings.rb
hammer_cli_foreman-3.12.0 lib/hammer_cli_foreman/settings.rb
hammer_cli_foreman-3.10.0 lib/hammer_cli_foreman/settings.rb
hammer_cli_foreman-3.9.0 lib/hammer_cli_foreman/settings.rb
hammer_cli_foreman-3.8.0 lib/hammer_cli_foreman/settings.rb
hammer_cli_foreman-3.7.0 lib/hammer_cli_foreman/settings.rb
hammer_cli_foreman-3.5.1 lib/hammer_cli_foreman/settings.rb
hammer_cli_foreman-3.6.0 lib/hammer_cli_foreman/settings.rb
hammer_cli_foreman-3.5.0 lib/hammer_cli_foreman/settings.rb
hammer_cli_foreman-3.4.0 lib/hammer_cli_foreman/settings.rb
hammer_cli_foreman-3.3.0 lib/hammer_cli_foreman/settings.rb
hammer_cli_foreman-3.2.0 lib/hammer_cli_foreman/settings.rb
hammer_cli_foreman-3.1.0 lib/hammer_cli_foreman/settings.rb
hammer_cli_foreman-3.0.0 lib/hammer_cli_foreman/settings.rb
hammer_cli_foreman-2.3.2 lib/hammer_cli_foreman/settings.rb
hammer_cli_foreman-2.3.1 lib/hammer_cli_foreman/settings.rb
hammer_cli_foreman-2.3.0 lib/hammer_cli_foreman/settings.rb