Sha256: 0de7d7174f3d6eb526c877d95005e04f21bb27ff0128ecbbf6cb5c5ad255ddfd

Contents?: true

Size: 1.85 KB

Versions: 37

Compression:

Stored size: 1.85 KB

Contents

module Fog
  module Compute
    class AWS
      class Real

        require 'fog/aws/parsers/compute/detach_internet_gateway'
        # Detaches an Internet gateway to a VPC, enabling connectivity between the Internet and the VPC
        #
        # ==== Parameters
        # * internet_gateway_id<~String> - The ID of the Internet gateway to detach
        # * vpc_id<~String> - The ID of the VPC
        #
        # ==== 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-DetachInternetGateway.html]
        def detach_internet_gateway(internet_gateway_id, vpc_id)
          request(
            'Action'               => 'DetachInternetGateway',
            'InternetGatewayId'    => internet_gateway_id,
            'VpcId'                => vpc_id,
            :idempotent   => true,
            :parser       => Fog::Parsers::Compute::AWS::DetachInternetGateway.new
          )
        end

      end

      class Mock

        def detach_internet_gateway(internet_gateway_id, vpc_id)
          response = Excon::Response.new
          if internet_gateway_id && vpc_id
            response.status = 200
            response.body = {
              'requestId' => Fog::AWS::Mock.request_id,
              'return' => true
            }
            response
          else
            if !internet_gateway_id
              message << 'The request must contain the parameter internet_gateway_id'
            elsif !vpc_id
              message << 'The request must contain the parameter vpc_id'
            end
            raise Fog::Compute::AWS::Error.new(message)
          end
        end

      end
    end
  end
end

Version data entries

37 entries across 37 versions & 11 rubygems

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