Module: Bosh::AwsCloud::Helpers
- Included in:
- Cloud, InstanceManager, Network, NetworkConfigurator, ResourceWait, Stemcell, StemcellCreator, VolumeProperties
- Defined in:
- lib/cloud/aws/helpers.rb
Instance Method Summary collapse
-
#cloud_error(message) ⇒ Object
Raises CloudError exception.
- #default_ephemeral_disk_mapping ⇒ Object
- #ebs_ephemeral_disk_mapping(volume_size_in_gb, volume_type, iops = nil) ⇒ Object
- #extract_security_groups(networks_spec) ⇒ Object
Instance Method Details
#cloud_error(message) ⇒ Object
Raises CloudError exception
28 29 30 31 32 33 |
# File 'lib/cloud/aws/helpers.rb', line 28 def cloud_error() if @logger @logger.error() end raise Bosh::Clouds::CloudError, end |
#default_ephemeral_disk_mapping ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/cloud/aws/helpers.rb', line 4 def default_ephemeral_disk_mapping [ { :device_name => '/dev/sdb', :virtual_name => 'ephemeral0', }, ] end |
#ebs_ephemeral_disk_mapping(volume_size_in_gb, volume_type, iops = nil) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/cloud/aws/helpers.rb', line 13 def ebs_ephemeral_disk_mapping(volume_size_in_gb, volume_type, iops = nil) ebs = { volume_size: volume_size_in_gb, volume_type: volume_type, delete_on_termination: true, } ebs[:iops] = iops if iops [{device_name: '/dev/sdb', ebs: ebs}] end |
#extract_security_groups(networks_spec) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/cloud/aws/helpers.rb', line 35 def extract_security_groups(networks_spec) networks_spec. values. select { |network_spec| network_spec.has_key? "cloud_properties" }. map { |network_spec| network_spec["cloud_properties"] }. select { |cloud_properties| cloud_properties.has_key? "security_groups" }. map { |cloud_properties| Array(cloud_properties["security_groups"]) }. flatten. sort. uniq end |