Sha256: 5459d83abe84d4dc341eaa6b89daf2483967c9b9ab14c84072b4747299331082
Contents?: true
Size: 1.29 KB
Versions: 15
Compression:
Stored size: 1.29 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_index = sgv['rules'].find_index { |r| !r.nil? && r['id'] == security_group_rule_id } if sg_rule_index sg_rule = sgv['rules'].delete_at sg_rule_index end 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
15 entries across 15 versions & 7 rubygems