Sha256: ee5d504f9258ce73a18623e3c580554cfbfb845d8452fbaeff78b9f31e873425

Contents?: true

Size: 1.76 KB

Versions: 3

Compression:

Stored size: 1.76 KB

Contents

module HammerCLIForemanOpenscap
  class ScapContent < HammerCLIForeman::Command

    resource :scap_contents

    class ListCommand < HammerCLIForeman::ListCommand
      output do
        field :id, _("Id")
        field :title, _("Title")
      end
      build_options
    end

    class CreateCommand < HammerCLIForeman::CreateCommand
      success_message _("Scap content successfully created")
      failure_message _("Failed to create Scap content")

      option "--scap-file", "SCAP_FILE", _("Scap content file"),
                   :attribute_name => :option_scap_file,
                   :format => HammerCLI::Options::Normalizers::File.new
      build_options
    end

    class DeleteCommand < HammerCLIForeman::DeleteCommand
      success_message _("Scap content deleted")
      failure_message _("Could not delete Scap content")

      build_options
    end

    class InfoCommand < HammerCLIForemanOpenscap::InfoCommand
      output ListCommand.output_definition do
        field :created_at, _("Created at")
        field :original_filename, _("Original filename")

        collection :scap_content_profiles, _("Scap content profiles") do
          field :id, _("Id")
          field :profile_id, _("Profile id")
          field :title, _("Title")
        end
        HammerCLIForeman::References.taxonomies(self)
      end
      build_options
    end

    class UpdateCommand < HammerCLIForemanOpenscap::UpdateCommand
      success_message _("Scap content updated")
      failure_message _("Could not update Scap content")

      option "--scap-file", "SCAP_FILE", _("Scap content file"),
                   :attribute_name => :option_scap_file,
                   :format => HammerCLI::Options::Normalizers::File.new
      build_options
    end

    autoload_subcommands
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hammer_cli_foreman_openscap-0.1.2 lib/hammer_cli_foreman_openscap/scap_content.rb
hammer_cli_foreman_openscap-0.1.1 lib/hammer_cli_foreman_openscap/scap_content.rb
hammer_cli_foreman_openscap-0.1.0 lib/hammer_cli_foreman_openscap/scap_content.rb