Sha256: f730429711e1cb303e65ebb142f9f3816d928b783dfdb38ca10b72b02cf4162f

Contents?: true

Size: 1.55 KB

Versions: 7

Compression:

Stored size: 1.55 KB

Contents

require 'hammer_cli'
require 'foreman_api'
require 'hammer_cli_foreman/commands'
require 'hammer_cli_foreman/associating_commands'

module HammerCLIForeman

  class Architecture < HammerCLI::Apipie::Command

    resource ForemanApi::Resources::Architecture

    class ListCommand < HammerCLIForeman::ListCommand

      output do
        from "architecture" do
          field :id, "Id"
          field :name, "Name"
        end
      end

      apipie_options
    end


    class InfoCommand < HammerCLIForeman::InfoCommand

      output ListCommand.output_definition do
        from "architecture" do
          field :operatingsystem_ids, "OS ids", Fields::List
          field :created_at, "Created at", Fields::Date
          field :updated_at, "Updated at", Fields::Date
        end
      end

    end


    class CreateCommand < HammerCLIForeman::CreateCommand
      success_message "Architecture created"
      failure_message "Could not create the architecture"

      apipie_options
    end


    class DeleteCommand < HammerCLIForeman::DeleteCommand
      success_message "Architecture deleted"
      failure_message "Could not delete the architecture"
    end


    class UpdateCommand < HammerCLIForeman::UpdateCommand
      success_message "Architecture updated"
      failure_message "Could not update the architecture"

      apipie_options
    end

    include HammerCLIForeman::AssociatingCommands::OperatingSystem

    autoload_subcommands
  end

end

HammerCLI::MainCommand.subcommand 'architecture', "Manipulate Foreman's architectures.", HammerCLIForeman::Architecture

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hammer_cli_foreman-0.0.11 lib/hammer_cli_foreman/architecture.rb
hammer_cli_foreman-0.0.10 lib/hammer_cli_foreman/architecture.rb
hammer_cli_foreman-0.0.9 lib/hammer_cli_foreman/architecture.rb
hammer_cli_foreman-0.0.8 lib/hammer_cli_foreman/architecture.rb
hammer_cli_foreman-0.0.7 lib/hammer_cli_foreman/architecture.rb
hammer_cli_foreman-0.0.6 lib/hammer_cli_foreman/architecture.rb
hammer_cli_foreman-0.0.5 lib/hammer_cli_foreman/architecture.rb