class Bosh::Director::DeploymentPlan::PlacementPlanner::BruteForceIpAllocation::AllocatedIps

Public Class Methods

new() click to toggle source
# File lib/bosh/director/deployment_plan/placement_planner/bruteforce_ip_allocation.rb, line 85
def initialize
  @allocated_ips = Hash.new {|h,k| h[k] = 0 }
end

Public Instance Methods

allocate(az_name) click to toggle source
# File lib/bosh/director/deployment_plan/placement_planner/bruteforce_ip_allocation.rb, line 89
def allocate(az_name)
  @allocated_ips[az_name] += 1
end
sort_by_least_allocated_ips(az_names) click to toggle source
# File lib/bosh/director/deployment_plan/placement_planner/bruteforce_ip_allocation.rb, line 93
def sort_by_least_allocated_ips(az_names)
  az_names.sort_by do |az_name|
    @allocated_ips[az_name]
  end
end