Method: Fog::Compute::AWS::Real#release_address

Defined in:
lib/fog/aws/requests/compute/release_address.rb

#release_address(ip_or_allocation) ⇒ Object

Release an elastic IP address.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘requestId’<~String> - Id of request

      • ‘return’<~Boolean> - success?

Amazon API Reference

non-VPC: requires public_ip only

VPC: requires allocation_id only
[View source]

20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/fog/aws/requests/compute/release_address.rb', line 20

def release_address(ip_or_allocation)
  field = if ip_or_allocation.to_s =~ /^(\d|\.)+$/
            "PublicIp"
          else
            "AllocationId"
          end
  request(
    'Action'    => 'ReleaseAddress',
    field       => ip_or_allocation,
    :idempotent => true,
    :parser     => Fog::Parsers::Compute::AWS::Basic.new
  )
end