Class: HammerCLIForeman::ListCommand
- Inherits:
-
HammerCLI::Apipie::ReadCommand
- Object
- HammerCLI::Apipie::ReadCommand
- HammerCLIForeman::ListCommand
show all
- Defined in:
- lib/hammer_cli_foreman/commands.rb
Direct Known Subclasses
Architecture::ListCommand, CommonParameter::ListCommand, ComputeResource::ListCommand, Domain::ListCommand, Environment::ListCommand, Fact::ListCommand, Host::FactsCommand, Host::ListCommand, Host::PuppetClassesCommand, Host::ReportsCommand, Hostgroup::ListCommand, Hostgroup::PuppetClassesCommand, Image::AvailableImagesCommand, Image::ListCommand, HammerCLIForeman::Location::ListCommand, Medium::ListCommand, Model::ListCommand, OperatingSystem::ListCommand, Organization::ListCommand, PartitionTable::ListCommand, PuppetClass::ListCommand, Report::ListCommand, SmartClassParametersBriefList, SmartProxy::ListCommand, Subnet::ListCommand, Template::ListCommand, Template::ListKindsCommand, User::ListCommand
Constant Summary
collapse
- DEFAULT_PER_PAGE =
20
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.command_name(name = nil) ⇒ Object
62
63
64
|
# File 'lib/hammer_cli_foreman/commands.rb', line 62
def self.command_name(name=nil)
super(name) || "list"
end
|
Instance Method Details
#adapter ⇒ Object
47
48
49
|
# File 'lib/hammer_cli_foreman/commands.rb', line 47
def adapter
:table
end
|
#execute ⇒ Object
66
67
68
69
70
71
72
73
74
75
76
|
# File 'lib/hammer_cli_foreman/commands.rb', line 66
def execute
if respond_to?(:page) && respond_to?(:per_page)
self.page ||= 1
self.per_page ||= HammerCLI::Settings.get(:ui, :per_page) || DEFAULT_PER_PAGE
browse_collection
else
retrieve_and_print
end
return HammerCLI::EX_OK
end
|
#extend_data(record) ⇒ Object
58
59
60
|
# File 'lib/hammer_cli_foreman/commands.rb', line 58
def extend_data(record)
record
end
|