Sha256: b9b80cfccaad202fe5254f39431dbc8e57bebc4970be0ba52e429b634c658d3a

Contents?: true

Size: 1.79 KB

Versions: 40

Compression:

Stored size: 1.79 KB

Contents

require 'hammer_cli_foreman/image'

module HammerCLIForeman
  class ComputeProfile < HammerCLIForeman::Command
    resource :compute_profiles

    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.taxonomies(self)
        HammerCLIForeman::References.timestamps(self)

        collection :compute_attributes, _('Compute attributes') do
          field :id, _('Id')
          field :name, _('Name')
          field nil, _('Compute Resource'), Fields::SingleReference, :key => :compute_resource
          field :vm_attrs, _('VM attributes')
        end
      end
      build_options
    end

    class CreateCommand < HammerCLIForeman::CreateCommand
      success_message _('Compute profile created.')
      failure_message _('Could not create a compute profile')
      build_options
    end

    class UpdateCommand < HammerCLIForeman::UpdateCommand
      success_message _('Compute profile updated.')
      failure_message _('Could not update the compute profile')
      validate_options do
        any(:option_name,:option_id).required
      end
      build_options
    end

    class DeleteCommand < HammerCLIForeman::DeleteCommand
      success_message _('Compute profile deleted.')
      failure_message _('Could not delete the Compute profile')
      validate_options do
        any(:option_name,:option_id).required
      end
      build_options
    end

    lazy_subcommand('values', _("Create update and delete Compute profile values"),
                    'HammerCLIForeman::ComputeAttribute', 'hammer_cli_foreman/compute_attribute'
    )

    autoload_subcommands
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
hammer_cli_foreman-3.14.0 lib/hammer_cli_foreman/compute_profile.rb
hammer_cli_foreman-3.13.0 lib/hammer_cli_foreman/compute_profile.rb
hammer_cli_foreman-3.12.0 lib/hammer_cli_foreman/compute_profile.rb
hammer_cli_foreman-3.10.0 lib/hammer_cli_foreman/compute_profile.rb
hammer_cli_foreman-3.9.0 lib/hammer_cli_foreman/compute_profile.rb
hammer_cli_foreman-3.8.0 lib/hammer_cli_foreman/compute_profile.rb
hammer_cli_foreman-3.7.0 lib/hammer_cli_foreman/compute_profile.rb
hammer_cli_foreman-3.5.1 lib/hammer_cli_foreman/compute_profile.rb
hammer_cli_foreman-3.6.0 lib/hammer_cli_foreman/compute_profile.rb
hammer_cli_foreman-3.5.0 lib/hammer_cli_foreman/compute_profile.rb
hammer_cli_foreman-3.4.0 lib/hammer_cli_foreman/compute_profile.rb
hammer_cli_foreman-3.3.0 lib/hammer_cli_foreman/compute_profile.rb
hammer_cli_foreman-3.2.0 lib/hammer_cli_foreman/compute_profile.rb
hammer_cli_foreman-3.1.0 lib/hammer_cli_foreman/compute_profile.rb
hammer_cli_foreman-3.0.0 lib/hammer_cli_foreman/compute_profile.rb
hammer_cli_foreman-2.3.2 lib/hammer_cli_foreman/compute_profile.rb
hammer_cli_foreman-2.3.1 lib/hammer_cli_foreman/compute_profile.rb
hammer_cli_foreman-2.3.0 lib/hammer_cli_foreman/compute_profile.rb
hammer_cli_foreman-2.1.3 lib/hammer_cli_foreman/compute_profile.rb
hammer_cli_foreman-2.2.0 lib/hammer_cli_foreman/compute_profile.rb