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.



846
847
848
# File 'lib/awscli/ec2.rb', line 846

def initialize(connection)
  @conn = connection
end

Instance Method Details

#attach(gwid, vpcid) ⇒ Object



865
866
867
868
# File 'lib/awscli/ec2.rb', line 865

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

#createObject



854
855
856
857
# File 'lib/awscli/ec2.rb', line 854

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

#deattach(gwid, vpcid) ⇒ Object



870
871
872
873
# File 'lib/awscli/ec2.rb', line 870

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

#delete(gwid) ⇒ Object



859
860
861
862
863
# File 'lib/awscli/ec2.rb', line 859

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

#listObject



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

def list
  @conn.internet_gateways.table
end