Class: Bosh::Director::DeploymentPlan::PlannerFactory

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(deployment_manifest_migrator, manifest_validator, deployment_repo, logger) ⇒ PlannerFactory

Returns a new instance of PlannerFactory.



28
29
30
31
32
33
# File 'lib/bosh/director/deployment_plan/planner_factory.rb', line 28

def initialize(deployment_manifest_migrator, manifest_validator, deployment_repo, logger)
  @deployment_manifest_migrator = deployment_manifest_migrator
  @manifest_validator = manifest_validator
  @deployment_repo = deployment_repo
  @logger = logger
end

Class Method Details

.create(logger) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/bosh/director/deployment_plan/planner_factory.rb', line 15

def self.create(logger)
  deployment_manifest_migrator = Bosh::Director::DeploymentPlan::ManifestMigrator.new
  manifest_validator = Bosh::Director::DeploymentPlan::ManifestValidator.new
  deployment_repo = Bosh::Director::DeploymentPlan::DeploymentRepo.new

  new(
    deployment_manifest_migrator,
    manifest_validator,
    deployment_repo,
    logger
  )
end

Instance Method Details

#create_from_manifest(manifest, cloud_config, runtime_config, options) ⇒ Object



40
41
42
# File 'lib/bosh/director/deployment_plan/planner_factory.rb', line 40

def create_from_manifest(manifest, cloud_config, runtime_config, options)
  parse_from_manifest(manifest, cloud_config, runtime_config, options)
end

#create_from_model(deployment_model, options = {}) ⇒ Object



35
36
37
38
# File 'lib/bosh/director/deployment_plan/planner_factory.rb', line 35

def create_from_model(deployment_model, options={})
  manifest = Manifest.load_from_text(deployment_model.manifest, deployment_model.cloud_config, deployment_model.runtime_config)
  create_from_manifest(manifest, deployment_model.cloud_config, deployment_model.runtime_config, options)
end