Sha256: 037843b06eb80efc95544a7c5cedf57ae3e3a0027c7f73eb587446ed3e8ec2d6
Contents?: true
Size: 1.2 KB
Versions: 29
Compression:
Stored size: 1.2 KB
Contents
module Fog module Compute class HP class Real # Delete a security group rule # # ==== Parameters # * id<~Integer> - id of the security group rule to delete # # {Openstack API Reference}[http://docs.openstack.org] def delete_security_group_rule(security_group_rule_id) request( :expects => 202, :method => 'DELETE', :path => "os-security-group-rules/#{security_group_rule_id}" ) end end class Mock def delete_security_group_rule(security_group_rule_id) response = Excon::Response.new sg_rule = nil self.data[:security_groups].each do |_, sgv| if sgv['rules'] sg_rule = sgv['rules'].delete_if { |r| !r.nil? && r['id'] == security_group_rule_id } break if sg_rule end end if sg_rule && !sg_rule.empty? response.status = 202 response.body = "202 Accepted\n\nThe request is accepted for processing.\n\n " response else raise Fog::Compute::HP::NotFound end end end end end end
Version data entries
29 entries across 29 versions & 4 rubygems