Sha256: 5711b0f938bee6fa7570259cfc6f220afc7f038bfa7614db6b9f3f3313270c31
Contents?: true
Size: 884 Bytes
Versions: 9
Compression:
Stored size: 884 Bytes
Contents
#!/usr/bin/env ruby $:.unshift(File.join(File.dirname(__FILE__), "..", "lib")) require "poolparty/lite" list_type = ARGV.shift || "ip" json_file = ARGV[0] || PoolParty::Default.properties_hash_file raise "ERROR: no json_file given" if !json_file schema = PoolParty::Schema.new( ::File.read(json_file) ) inst_array = PoolParty::Neighborhoods.load_default.instances.instances if !inst_array || inst_array.empty? remoter_base = schema.options.remote_base remote_base = remoter_base.top_level_class.constantize(PoolParty::Remote) instances = remote_base.send :describe_instances, schema.options inst_array = instances.map {|inst| inst.send list_type.to_sym } end print_array = case list_type when "ip" inst_array.compact.map {|i| i.ip } when "internal_ip" inst_array.compact.map {|i| i.internal_ip || i.ip } else inst_array end print print_array.compact.join("\t")
Version data entries
9 entries across 9 versions & 3 rubygems