Class: Bosh::Director::DeploymentPlan::InstanceGroupSpecParser
- Includes:
- IpUtil, ValidationHelper, Template::PropertyHelper
- Defined in:
- lib/bosh/director/deployment_plan/instance_group_spec_parser.rb
Instance Method Summary collapse
-
#initialize(deployment, event_log, logger) ⇒ InstanceGroupSpecParser
constructor
A new instance of InstanceGroupSpecParser.
-
#parse(job_spec, options = {}) ⇒ DeploymentPlan::Job
Job as build from job_spec.
Methods included from IpUtil
#each_ip, #format_ip, #ip_to_i, #ip_to_netaddr
Methods included from ValidationHelper
Constructor Details
#initialize(deployment, event_log, logger) ⇒ InstanceGroupSpecParser
Returns a new instance of InstanceGroupSpecParser.
11 12 13 14 15 |
# File 'lib/bosh/director/deployment_plan/instance_group_spec_parser.rb', line 11 def initialize(deployment, event_log, logger) @deployment = deployment @event_log = event_log @logger = logger end |
Instance Method Details
#parse(job_spec, options = {}) ⇒ DeploymentPlan::Job
Returns Job as build from job_spec.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/bosh/director/deployment_plan/instance_group_spec_parser.rb', line 19 def parse(job_spec, = {}) @job_spec = job_spec @job = InstanceGroup.new(@logger) parse_name parse_lifecycle parse_release validate_templates parse_template parse_templates check_template_uniqueness parse_disk parse_properties parse_resource_pool check_remove_dev_tools = {} ['canaries'] = ['canaries'] if ['canaries'] ['max_in_flight'] = ['max_in_flight'] if ['max_in_flight'] parse_update_config() networks = JobNetworksParser.new(Network::VALID_DEFAULTS).parse(@job_spec, @job.name, @deployment.networks) @job.networks = networks assign_default_networks(networks) availability_zones = JobAvailabilityZoneParser.new.parse(@job_spec, @job, @deployment, networks) @job.availability_zones = availability_zones parse_migrated_from desired_instances = parse_desired_instances(availability_zones, networks) @job.desired_instances = desired_instances @job end |