Class: Bosh::Deployer::Specification
- Inherits:
-
Object
- Object
- Bosh::Deployer::Specification
- Defined in:
- lib/bosh/deployer/specification.rb
Instance Attribute Summary collapse
-
#properties ⇒ Object
Returns the value of attribute properties.
-
#spec ⇒ Object
Returns the value of attribute spec.
Class Method Summary collapse
Instance Method Summary collapse
- #delete(name) ⇒ Object
-
#director_port ⇒ String
The port the director runs on.
-
#initialize(spec, config) ⇒ Specification
constructor
A new instance of Specification.
-
#update(agent_services_ip, internal_services_ip) ⇒ Object
Update the spec with the IP of the micro bosh instance.
Constructor Details
#initialize(spec, config) ⇒ Specification
Returns a new instance of Specification.
18 19 20 21 22 |
# File 'lib/bosh/deployer/specification.rb', line 18 def initialize(spec, config) @config = config @spec = spec @properties = @spec['properties'] end |
Instance Attribute Details
#properties ⇒ Object
Returns the value of attribute properties.
16 17 18 |
# File 'lib/bosh/deployer/specification.rb', line 16 def properties @properties end |
#spec ⇒ Object
Returns the value of attribute spec.
15 16 17 |
# File 'lib/bosh/deployer/specification.rb', line 15 def spec @spec end |
Class Method Details
.load_apply_spec(dir) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/bosh/deployer/specification.rb', line 8 def self.load_apply_spec(dir) file = 'apply_spec.yml' apply_spec = File.join(dir, file) err "this isn't a micro bosh stemcell - #{file} missing" unless File.exist?(apply_spec) Psych.load_file(apply_spec) end |
.load_from_stemcell(dir, config) ⇒ Object
3 4 5 6 |
# File 'lib/bosh/deployer/specification.rb', line 3 def self.load_from_stemcell(dir, config) spec = load_apply_spec(dir) Specification.new(spec, config) end |
Instance Method Details
#delete(name) ⇒ Object
53 54 55 |
# File 'lib/bosh/deployer/specification.rb', line 53 def delete(name) @spec.delete(name) end |
#director_port ⇒ String
Returns the port the director runs on.
58 59 60 |
# File 'lib/bosh/deployer/specification.rb', line 58 def director_port @properties['director']['port'] end |
#update(agent_services_ip, internal_services_ip) ⇒ Object
Update the spec with the IP of the micro bosh instance.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/bosh/deployer/specification.rb', line 27 def update(agent_services_ip, internal_services_ip) # set the director name to what is specified in the micro_bosh.yml if config.name @properties['director'] = {} unless @properties['director'] @properties['director']['name'] = config.name end %w{blobstore nats}.each do |service| update_agent_service_address(service, agent_services_ip) update_service_address(service, internal_services_ip) end %w{registry dns}.each do |service| update_service_address(service, agent_services_ip) end %w{director redis}.each do |service| update_service_address(service, internal_services_ip) end update_properties @spec end |