Class: Awscli::EC2::InternetGateways

Inherits:
Object
  • Object
show all
Defined in:
lib/awscli/ec2.rb

Overview

> NetworkInterfaces

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ InternetGateways

Returns a new instance of InternetGateways.



824
825
826
# File 'lib/awscli/ec2.rb', line 824

def initialize(connection)
  @conn = connection
end

Instance Method Details

#attach(gwid, vpcid) ⇒ Object



843
844
845
846
# File 'lib/awscli/ec2.rb', line 843

def attach(gwid, vpcid)
  @conn.internet_gateways.attach(gwid, vpcid)
  puts "Attached InternetGateway: #{gwid} to VPC: #{vpcid}"
end

#createObject



832
833
834
835
# File 'lib/awscli/ec2.rb', line 832

def create
  gw = @conn.internet_gateways.create
  puts "Created Internet Gateway: #{gw.id}"
end

#deattach(gwid, vpcid) ⇒ Object



848
849
850
851
# File 'lib/awscli/ec2.rb', line 848

def deattach(gwid, vpcid)
  @conn.internet_gateways.deattach(gwid, vpcid)
  puts "Detached InternetGateway: #{gwid} from VPC: #{vpcid}"
end

#delete(gwid) ⇒ Object



837
838
839
840
841
# File 'lib/awscli/ec2.rb', line 837

def delete(gwid)
  gw = @conn.internet_gateways.get(gwid)
  gw.destroy
  puts "Deleted Internet Gateway: #{gwid}"
end

#listObject



828
829
830
# File 'lib/awscli/ec2.rb', line 828

def list
  @conn.internet_gateways.table
end