Sha256: bf6a4ecb7e643576b77e61d2de07e2922a3b3fdca8abf4db6758aa4d82a9f309

Contents?: true

Size: 1.49 KB

Versions: 36

Compression:

Stored size: 1.49 KB

Contents

module Fog
  module AWS
    class Compute
      class Real
        require 'fog/aws/parsers/compute/move_address_to_vpc'

        # Move address to VPC scope
        #
        # === Returns
        # * response<~Excon::Response>:
        #   * body<~<Hash>:
        #     * 'allocationId'<~String> - The allocation ID for the Elastic IP address
        #     * 'requestId'<~String> - Id of the request
        #     * 'status'<~String> - The status of the move of the IP address (MoveInProgress | InVpc | InClassic)

        def move_address_to_vpc(public_ip)
          request(
            'Action' => 'MoveAddressToVpc',
            'PublicIp' => public_ip,
            :idempotent => true,
            :parser => Fog::Parsers::AWS::Compute::MoveAddressToVpc.new
          )
        end
      end

      class Mock
        def move_address_to_vpc(public_ip)
          response      = Excon::Response.new
          allocation_id = "eip-#{Fog::Mock.random_hex(8)}"

          address = self.data[:addresses][public_ip]

          if address
            address['domain']       = 'vpc'
            address['allocationId'] = allocation_id

            response.status = 200
            response.body = {
              'requestId'    => Fog::AWS::Mock.request_id,
              'allocationId' => allocation_id,
              'status'       => "InVpc"
            }

            response
          else
            raise Fog::AWS::Compute::NotFound.new("Address does not exist")
          end
        end
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
fog-aws-3.29.0 lib/fog/aws/requests/compute/move_address_to_vpc.rb
fog-aws-3.28.0 lib/fog/aws/requests/compute/move_address_to_vpc.rb
fog-aws-3.27.0 lib/fog/aws/requests/compute/move_address_to_vpc.rb
fog-aws-3.26.0 lib/fog/aws/requests/compute/move_address_to_vpc.rb
fog-aws-3.25.0 lib/fog/aws/requests/compute/move_address_to_vpc.rb
fog-aws-3.24.0 lib/fog/aws/requests/compute/move_address_to_vpc.rb
fog-aws-3.23.0 lib/fog/aws/requests/compute/move_address_to_vpc.rb
fog-aws-3.22.0 lib/fog/aws/requests/compute/move_address_to_vpc.rb
fog-aws-3.21.1 lib/fog/aws/requests/compute/move_address_to_vpc.rb
fog-aws-3.21.0 lib/fog/aws/requests/compute/move_address_to_vpc.rb
fog-aws-3.20.0 lib/fog/aws/requests/compute/move_address_to_vpc.rb
fog-aws-3.19.0 lib/fog/aws/requests/compute/move_address_to_vpc.rb
fog-aws-3.18.0 lib/fog/aws/requests/compute/move_address_to_vpc.rb
fog-aws-3.17.0 lib/fog/aws/requests/compute/move_address_to_vpc.rb
fog-aws-3.16.0 lib/fog/aws/requests/compute/move_address_to_vpc.rb
fog-aws-3.15.0 lib/fog/aws/requests/compute/move_address_to_vpc.rb
fog-aws-3.14.0 lib/fog/aws/requests/compute/move_address_to_vpc.rb
fog-aws-3.13.0 lib/fog/aws/requests/compute/move_address_to_vpc.rb
fog-aws-3.12.0 lib/fog/aws/requests/compute/move_address_to_vpc.rb
fog-aws-3.11.0 lib/fog/aws/requests/compute/move_address_to_vpc.rb