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, options = {}) ⇒ InternetGateways

Returns a new instance of InternetGateways.



798
799
800
# File 'lib/awscli/ec2.rb', line 798

def initialize connection, options = {}
  @@conn = connection
end

Instance Method Details

#attach(gwid, vpcid) ⇒ Object



817
818
819
820
# File 'lib/awscli/ec2.rb', line 817

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

#createObject



806
807
808
809
# File 'lib/awscli/ec2.rb', line 806

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

#deattach(gwid, vpcid) ⇒ Object



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

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

#delete(gwid) ⇒ Object



811
812
813
814
815
# File 'lib/awscli/ec2.rb', line 811

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

#listObject



802
803
804
# File 'lib/awscli/ec2.rb', line 802

def list
  @@conn.internet_gateways.table
end