Method: Deltacloud::Drivers::Eucalyptus::EucalyptusDriver#delete_firewall_rule

Defined in:
lib/deltacloud/drivers/eucalyptus/eucalyptus_driver.rb

#delete_firewall_rule(credentials, opts = {}) ⇒ Object



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/deltacloud/drivers/eucalyptus/eucalyptus_driver.rb', line 166

def delete_firewall_rule(credentials, opts={})
  ec2 = new_client(credentials)
  firewall = opts[:firewall]
  protocol, from_port, to_port, addresses, groups = firewall_rule_params(opts[:rule_id])
  unless groups.nil?
    groups.each_index do |i|
      ec2.revoke_security_group_named_ingress(firewall, groups[i]['owner'], groups[i]['group_name'])
    end
  end
  unless addresses.nil?
    addresses.each do |ip|
      ec2.revoke_security_group_IP_ingress(firewall, from_port, to_port, protocol, ip )
    end
  end
end