Sha256: 27bc92801a07db873374a984d312d92009cebd053c7d0ffdc601dbcf43042119

Contents?: true

Size: 1.65 KB

Versions: 10

Compression:

Stored size: 1.65 KB

Contents

require 'hammer_cli_foreman/external_usergroup'

module HammerCLIForeman

  class Usergroup < HammerCLIForeman::Command

    resource :usergroups

    class ListCommand < HammerCLIForeman::ListCommand
      output do
        field :id, _("Id")
        field :name, _("Name")
      end

      build_options
    end

    class InfoCommand < HammerCLIForeman::InfoCommand
      output ListCommand.output_definition do
        HammerCLIForeman::References.users(self)
        HammerCLIForeman::References.usergroups(self)
        HammerCLIForeman::References.external_usergroups(self)
        HammerCLIForeman::References.roles(self)
        HammerCLIForeman::References.timestamps(self)
      end

      build_options
    end

    class CreateCommand < HammerCLIForeman::CreateCommand
      success_message _("User group [%<name>s] created")
      failure_message _("Could not create the user group")

      build_options
    end

    class UpdateCommand < HammerCLIForeman::UpdateCommand
      success_message _("User group [%<name>s] updated")
      failure_message _("Could not update the user group")

      build_options
    end

    class DeleteCommand < HammerCLIForeman::DeleteCommand
      success_message _("User group [%<name>s] deleted")
      failure_message _("Could not delete the user group")

      build_options
    end

    HammerCLIForeman::AssociatingCommands::Role.extend_command(self)
    HammerCLIForeman::AssociatingCommands::User.extend_command(self)
    HammerCLIForeman::AssociatingCommands::Usergroup.extend_command(self)

    autoload_subcommands
    subcommand 'external', HammerCLIForeman::ExternalUsergroup.desc, HammerCLIForeman::ExternalUsergroup
  end

end



Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
hammer_cli_foreman-0.7.0 lib/hammer_cli_foreman/usergroup.rb
hammer_cli_foreman-0.6.2 lib/hammer_cli_foreman/usergroup.rb
hammer_cli_foreman-0.6.1 lib/hammer_cli_foreman/usergroup.rb
hammer_cli_foreman-0.6.0 lib/hammer_cli_foreman/usergroup.rb
hammer_cli_foreman-0.5.1 lib/hammer_cli_foreman/usergroup.rb
hammer_cli_foreman-0.5.0 lib/hammer_cli_foreman/usergroup.rb
hammer_cli_foreman-0.4.0 lib/hammer_cli_foreman/usergroup.rb
hammer_cli_foreman-0.3.0 lib/hammer_cli_foreman/usergroup.rb
hammer_cli_foreman-0.2.0 lib/hammer_cli_foreman/usergroup.rb
hammer_cli_foreman-0.1.4 lib/hammer_cli_foreman/usergroup.rb