Class: Bosh::Director::DeploymentPlan::NetworkPlanner::Planner

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/director/deployment_plan/network_planner/planner.rb

Instance Method Summary collapse

Constructor Details

#initialize(logger) ⇒ Planner

Returns a new instance of Planner.



4
5
6
# File 'lib/bosh/director/deployment_plan/network_planner/planner.rb', line 4

def initialize(logger)
  @logger = logger
end

Instance Method Details

#network_plan_with_dynamic_reservation(instance_plan, job_network) ⇒ Object



8
9
10
11
12
# File 'lib/bosh/director/deployment_plan/network_planner/planner.rb', line 8

def network_plan_with_dynamic_reservation(instance_plan, job_network)
  reservation = Bosh::Director::DesiredNetworkReservation.new_dynamic(instance_plan.instance.model, job_network.deployment_network)
  @logger.debug("Creating new dynamic reservation #{reservation} for instance '#{instance_plan.instance}'")
  Plan.new(reservation: reservation)
end

#network_plan_with_static_reservation(instance_plan, job_network, static_ip) ⇒ Object



14
15
16
17
18
# File 'lib/bosh/director/deployment_plan/network_planner/planner.rb', line 14

def network_plan_with_static_reservation(instance_plan, job_network, static_ip)
  reservation = Bosh::Director::DesiredNetworkReservation.new_static(instance_plan.instance.model, job_network.deployment_network, static_ip)
  @logger.debug("Creating new static reservation #{reservation} for instance '#{instance_plan.instance}'")
  Plan.new(reservation: reservation)
end