Sha256: fbbebb4227ee00c6ec09629678ccaecf04166671e231b2dd2f153183fe7b9767

Contents?: true

Size: 1.98 KB

Versions: 7

Compression:

Stored size: 1.98 KB

Contents

module HammerCLIForeman

  class PartitionTable < HammerCLIForeman::Command

    resource :ptables

    class ListCommand < HammerCLIForeman::ListCommand

      output do
        field :id, _("Id")
        field :name, _("Name")
        field :os_family, _("OS Family")
      end

      build_options
    end


    class InfoCommand < HammerCLIForeman::InfoCommand
      output ListCommand.output_definition do
        field :locked, _("Locked"), Fields::Boolean
        HammerCLIForeman::References.operating_systems(self)
        HammerCLIForeman::References.timestamps(self)
      end

      build_options
    end


    class DumpCommand < HammerCLIForeman::InfoCommand
      command_name "dump"
      desc _("View partition table content.")

      def print_data(partition_table)
        puts partition_table["layout"]
      end

      build_options
    end


    class CreateCommand < HammerCLIForeman::CreateCommand

      option "--file", "LAYOUT", _("Path to a file that contains the partition layout"), :attribute_name => :option_layout,
        :required => true, :format => HammerCLI::Options::Normalizers::File.new

      success_message _("Partition table created")
      failure_message _("Could not create the partition table")

      build_options :without => [:layout]
    end


    class UpdateCommand < HammerCLIForeman::UpdateCommand
      option "--file", "LAYOUT", _("Path to a file that contains the partition layout"), :attribute_name => :option_layout,
        :format => HammerCLI::Options::Normalizers::File.new

      success_message _("Partition table updated")
      failure_message _("Could not update the partition table")

      build_options :without => [:layout]
    end


    class DeleteCommand < HammerCLIForeman::DeleteCommand
      success_message _("Partition table deleted")
      failure_message _("Could not delete the partition table")

      build_options
    end


    HammerCLIForeman::AssociatingCommands::OperatingSystem.extend_command(self)


    autoload_subcommands
  end

end


Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hammer_cli_foreman-0.11.0 lib/hammer_cli_foreman/partition_table.rb
hammer_cli_foreman-0.10.2 lib/hammer_cli_foreman/partition_table.rb
hammer_cli_foreman-0.10.1 lib/hammer_cli_foreman/partition_table.rb
hammer_cli_foreman-0.10.0 lib/hammer_cli_foreman/partition_table.rb
hammer_cli_foreman-0.9.0 lib/hammer_cli_foreman/partition_table.rb
hammer_cli_foreman-0.8.0 lib/hammer_cli_foreman/partition_table.rb
hammer_cli_foreman-0.7.0 lib/hammer_cli_foreman/partition_table.rb