class Bosh::Director::DeploymentPlan::LinkPath

Attributes

deployment[R]
job[R]
manual_spec[R]
name[R]
path[R]
skip[R]
template[R]

Public Class Methods

new(deployment_plan, job_name, template_name) click to toggle source
# File lib/bosh/director/deployment_plan/links/link_path.rb, line 6
def initialize(deployment_plan, job_name, template_name)
  @deployment_plan = deployment_plan
  @consumes_job_name = job_name
  @consumes_template_name = template_name
  @deployment = nil
  @job = nil
  @template = nil
  @name = nil
  @path = nil
  @skip = false
  @manual_spec = nil
end

Public Instance Methods

parse(link_info) click to toggle source
# File lib/bosh/director/deployment_plan/links/link_path.rb, line 19
def parse(link_info)
  # in case the link was explicitly set to the string 'nil', do not add it
  # to the link paths, even if the link provider exist, since the user intent
  # was explicitly set to not consume any link

  if link_info["skip_link"] && link_info["skip_link"] == true
    @skip = true
    return
  end

  if link_info.has_key?("from")
    link_path = fulfill_explicit_link(link_info)
  elsif link_info.has_key?("instances") || link_info.has_key?('properties')
    @manual_spec = {}
    @manual_spec['instances'] = link_info['instances']
    @manual_spec['properties'] = link_info['properties']
    return
  else
    link_path = fulfill_implicit_link(link_info)
  end
  if link_path != nil
    @deployment, @job, @template, @name = link_path.values_at(:deployment, :job, :template, :name)
    @path = "#{link_path[:deployment]}.#{link_path[:job]}.#{link_path[:template]}.#{link_path[:name]}"
  else
    @skip = true
  end
end
to_s() click to toggle source
# File lib/bosh/director/deployment_plan/links/link_path.rb, line 47
def to_s
  "#{deployment}.#{job}.#{template}.#{name}"
end

Private Instance Methods