Sha256: 153d2b16d8683ecaf1e7b526eb52d3ece1dde5a4d681b5e9bf90c5093803759f

Contents?: true

Size: 1.71 KB

Versions: 36

Compression:

Stored size: 1.71 KB

Contents

module Fog
  module Compute
    class AWS
      class Real

        require 'fog/aws/parsers/compute/delete_internet_gateway'
        #Deletes an Internet gateway from your AWS account. The gateway must not be attached to a VPC
        #
        # ==== Parameters
        # * internet_gateway_id<~String> - The ID of the InternetGateway you want to delete.
        #
        # === Returns
        # * response<~Excon::Response>:
        # * body<~Hash>:
        # * 'requestId'<~String> - Id of request
        # * 'return'<~Boolean> - Returns true if the request succeeds.
        #
        # {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DeleteInternetGateway.html]
        def delete_internet_gateway(internet_gateway_id)
          request(
            'Action' => 'DeleteInternetGateway',
            'InternetGatewayId' => internet_gateway_id,
            :parser => Fog::Parsers::Compute::AWS::DeleteInternetGateway.new
          )
        end
      end
      
      class Mock
        def delete_internet_gateway(internet_gateway_id)
          Excon::Response.new.tap do |response|
            if internet_gateway_id
              response.status = 200
              self.data[:internet_gateways].reject! { |v| v['internetGatewayId'] == internet_gateway_id }
            
              response.body = {
                'requestId' => Fog::AWS::Mock.request_id,
                'return' => true
              }
            else
              message = 'MissingParameter => '
              message << 'The request must contain the parameter internet_gateway_id'
              raise Fog::Compute::AWS::Error.new(message)
            end
          end
        end
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 11 rubygems

Version Path
gapinc-fog-1.12.1.2.1 lib/fog/aws/requests/compute/delete_internet_gateway.rb
fog-1.15.0 lib/fog/aws/requests/compute/delete_internet_gateway.rb
gapinc-fog-1.14.0 lib/fog/aws/requests/compute/delete_internet_gateway.rb
fog-maestrodev-1.14.0.20130806165225 lib/fog/aws/requests/compute/delete_internet_gateway.rb
fog-1.14.0 lib/fog/aws/requests/compute/delete_internet_gateway.rb
fog-1.13.0 lib/fog/aws/requests/compute/delete_internet_gateway.rb
gapinc-fog-1.12.1.2 lib/fog/aws/requests/compute/delete_internet_gateway.rb
gapinc-fog-1.12.1.1 lib/fog/aws/requests/compute/delete_internet_gateway.rb
gapinc-fog-1.12.1a lib/fog/aws/requests/compute/delete_internet_gateway.rb
gapinc-fog-1.12.1 lib/fog/aws/requests/compute/delete_internet_gateway.rb
fog-1.12.1 lib/fog/aws/requests/compute/delete_internet_gateway.rb
fog-1.12.0 lib/fog/aws/requests/compute/delete_internet_gateway.rb
hpfog-0.0.20 lib/fog/aws/requests/compute/delete_internet_gateway.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/lib/fog/aws/requests/compute/delete_internet_gateway.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/lib/fog/aws/requests/compute/delete_internet_gateway.rb
fog-nirvanix-1.8.2 lib/fog/aws/requests/compute/delete_internet_gateway.rb
fog-1.11.1 lib/fog/aws/requests/compute/delete_internet_gateway.rb
fog-1.11.0 lib/fog/aws/requests/compute/delete_internet_gateway.rb
fog-nirvanix-1.8.1 lib/fog/aws/requests/compute/delete_internet_gateway.rb
fog-1.10.1 lib/fog/aws/requests/compute/delete_internet_gateway.rb