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

Version Path
fog-nirvanix-1.8.2 lib/fog/hp/requests/compute/delete_security_group_rule.rb
fog-nirvanix-1.8.1 lib/fog/hp/requests/compute/delete_security_group_rule.rb
fog-parser-fix-1.6.1 lib/fog/hp/requests/compute/delete_security_group_rule.rb
fog-test-again-1.6.0 lib/fog/hp/requests/compute/delete_security_group_rule.rb
fog-parser-fix-1.6.0 lib/fog/hp/requests/compute/delete_security_group_rule.rb
fog-1.9.0 lib/fog/hp/requests/compute/delete_security_group_rule.rb
fog-maestrodev-1.8.0.20130114204828 lib/fog/hp/requests/compute/delete_security_group_rule.rb
fog-maestrodev-1.8.0.20130111070250 lib/fog/hp/requests/compute/delete_security_group_rule.rb
fog-maestrodev-1.8.0.20130109172219 lib/fog/hp/requests/compute/delete_security_group_rule.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/hp/requests/compute/delete_security_group_rule.rb
fog-sgonyea-1.8.1 lib/fog/hp/requests/compute/delete_security_group_rule.rb
fog-1.8.0 lib/fog/hp/requests/compute/delete_security_group_rule.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/hp/requests/compute/delete_security_group_rule.rb
fog-1.7.0 lib/fog/hp/requests/compute/delete_security_group_rule.rb
fog-1.6.0 lib/fog/hp/requests/compute/delete_security_group_rule.rb