3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/occi/cli/helpers/discover_helper.rb', line 3
def helper_discover(options, output = nil)
found = Occi::Core::Kinds.new
case options.entity_type
when :resource
resource_type_identifiers.each { |resource_ti| found << model.get_by_id(resource_ti) }
when :link
link_type_identifiers.each { |link_ti| found << model.get_by_id(link_ti) }
else
Occi::Cli::Log.warn "Attempting to discover an " \
"unknown entity type #{options.entity_type.to_s.inspect}"
raise "Unknown entity type #{options.entity_type.to_s.inspect}, " \
"terminating discovery!"
end
helper_discover_output(found, options, output)
end
|