Sha256: f5993c64ac5032f0f69e385d113936051271abfc2632c58cb0226c9bb3885aac

Contents?: true

Size: 743 Bytes

Versions: 67

Compression:

Stored size: 743 Bytes

Contents

#!/usr/bin/env ruby
require 'range_operators'
require 'hybrid_platforms_conductor/executable'

executable = HybridPlatformsConductor::Executable.new(nodes_selection_options: false)

nodes_handler = executable.nodes_handler

executable.parse_options!

# Group IPs per first 3 numbers
nodes_handler.prefetch_metadata_of nodes_handler.known_nodes, :private_ips
nodes_handler.
  known_nodes.
  map { |node| nodes_handler.get_private_ips_of(node) || [] }.
  flatten.
  uniq.
  group_by { |ip| ip.split('.')[0..2].map(&:to_i) }.
  sort.
  map { |ip_root, ips| [ip_root, ips.map { |ip| ip.split('.').last.to_i }] }.
  each do |ip_root, ip_fourths|
    executable.out "Free IPs for #{ip_root.join('.')}: #{([256] + ip_fourths).missing.rangify}"
  end

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
hybrid_platforms_conductor-33.9.5 bin/free_ips
hybrid_platforms_conductor-33.9.4 bin/free_ips
hybrid_platforms_conductor-33.9.2 bin/free_ips
hybrid_platforms_conductor-33.9.1 bin/free_ips
hybrid_platforms_conductor-33.9.0 bin/free_ips
hybrid_platforms_conductor-33.8.4 bin/free_ips
hybrid_platforms_conductor-33.8.3 bin/free_ips
hybrid_platforms_conductor-33.8.2 bin/free_ips
hybrid_platforms_conductor-33.8.1 bin/free_ips
hybrid_platforms_conductor-33.8.0 bin/free_ips
hybrid_platforms_conductor-33.7.4 bin/free_ips
hybrid_platforms_conductor-33.7.3 bin/free_ips
hybrid_platforms_conductor-33.7.2 bin/free_ips
hybrid_platforms_conductor-33.7.1 bin/free_ips
hybrid_platforms_conductor-33.7.0 bin/free_ips
hybrid_platforms_conductor-33.6.0 bin/free_ips
hybrid_platforms_conductor-33.5.1 bin/free_ips
hybrid_platforms_conductor-33.5.0 bin/free_ips
hybrid_platforms_conductor-33.4.0 bin/free_ips
hybrid_platforms_conductor-33.3.0 bin/free_ips