Sha256: 8a9c2ddf17dfad97e9238cb423744600f79af929a624efb776a76013da82fc0e

Contents?: true

Size: 1.19 KB

Versions: 3

Compression:

Stored size: 1.19 KB

Contents

unless Fog.mocking?

  module Fog
    module AWS
      class EC2

        # Delete a security group that you own
        #
        # ==== Parameters
        # * group_name<~String> - Name of the security group.
        #
        # ==== Returns
        # * response<~Fog::AWS::Response>:
        #   * body<~Hash>:
        #     * 'requestId'<~String> - Id of request
        #     * 'return'<~Boolean> - success?
        def delete_security_group(name)
          request({
            'Action' => 'DeleteSecurityGroup',
            'GroupName' => name
          }, Fog::Parsers::AWS::EC2::Basic.new)
        end

      end
    end
  end

else

  module Fog
    module AWS
      class EC2
        def delete_security_group(name)
          response = Fog::Response.new
          if @data[:security_groups][name]
            @data[:security_groups].delete(name)
            response.status = 200
            response.body = {
              'requestId' => Fog::AWS::Mock.request_id,
              'return'    => true
            }
          else
            response.status = 400
            raise(Fog::Errors.status_error(200, 400, response))
          end
          response
        end
      end
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
geemus-fog-0.0.0 lib/fog/aws/requests/ec2/delete_security_group.rb
geemus-fog-0.0.1 lib/fog/aws/requests/ec2/delete_security_group.rb
geemus-fog-0.0.3 lib/fog/aws/requests/ec2/delete_security_group.rb