Sha256: 500fee045a7c326e98462ece7e6ffe4e1c43aec496530dc67481e9b2c499d408

Contents?: true

Size: 1.63 KB

Versions: 4

Compression:

Stored size: 1.63 KB

Contents

module HammerCLIForeman

  class Model < HammerCLIForeman::Command

    resource :models

    class ListCommand < HammerCLIForeman::ListCommand

      output do
        field :id, _("Id")
        field :name, _("Name")
        field :vendor_class, _("Vendor class")
        field :hardware_model, _("HW model")
      end

      build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
    end


    class InfoCommand < HammerCLIForeman::InfoCommand
      output ListCommand.output_definition do
        field :info, _("Info")
        HammerCLIForeman::References.timestamps(self)
      end

      build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
    end


    class CreateCommand < HammerCLIForeman::CreateCommand
      success_message _("Hardware model created.")
      failure_message _("Could not create the hardware model")

      build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
    end

    class DeleteCommand < HammerCLIForeman::DeleteCommand
      success_message _("Hardware model deleted.")
      failure_message _("Could not delete the hardware model")

      build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
    end


    class UpdateCommand < HammerCLIForeman::UpdateCommand
      success_message _("Hardware model updated.")
      failure_message _("Could not update the hardware model")

      build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
    end


    autoload_subcommands
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hammer_cli_foreman-2.5.2 lib/hammer_cli_foreman/model.rb
hammer_cli_foreman-2.5.1 lib/hammer_cli_foreman/model.rb
hammer_cli_foreman-2.5.0 lib/hammer_cli_foreman/model.rb
hammer_cli_foreman-2.4.0 lib/hammer_cli_foreman/model.rb