class Fog::Compute::AWS::InternetGateway

Public Class Methods

new(attributes={}) click to toggle source
# File lib/fog/aws/models/compute/internet_gateway.rb, line 13
def initialize(attributes={})
  super
end

Public Instance Methods

attach(vpc_id) click to toggle source

Attaches an existing internet gateway

internet_gateway.attach(igw-id, vpc-id)

Returns

True or false depending on the result

# File lib/fog/aws/models/compute/internet_gateway.rb, line 25
def attach(vpc_id)
  requires :id
  connection.attach_internet_gateway(id, vpc_id)
  #reload
end
destroy() click to toggle source

Removes an existing internet gateway

internet_gateway.destroy

Returns

True or false depending on the result

# File lib/fog/aws/models/compute/internet_gateway.rb, line 56
def destroy
  requires :id

  connection.delete_internet_gateway(id)
  true
end
detach(vpc_id) click to toggle source

Detaches an existing internet gateway

internet_gateway.detach(igw-id, vpc-id)

Returns

True or false depending on the result

# File lib/fog/aws/models/compute/internet_gateway.rb, line 40
def detach(vpc_id)
  requires :id
  connection.detach_internet_gateway(id, vpc_id)
  reload
end
save() click to toggle source

Create an internet gateway

>> g = AWS.internet_gateways.new()
>> g.save

Returns:

requestId and a internetGateway object

# File lib/fog/aws/models/compute/internet_gateway.rb, line 73
def save
  data = connection.create_internet_gateway.body['internetGatewaySet'].first
puts data.inspect
  new_attributes = data.reject {|key,value| key == 'requestId'}
  merge_attributes(new_attributes)
  true

  true
end