Class: Awscli::EC2::Subnet

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

Overview

> Vpc

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ Subnet

Returns a new instance of Subnet.



744
745
746
# File 'lib/awscli/ec2.rb', line 744

def initialize(connection)
  @conn = connection
end

Instance Method Details

#create(options) ⇒ Object



752
753
754
755
# File 'lib/awscli/ec2.rb', line 752

def create(options)
  subnet = @conn.subnets.create(options)
  puts "Created Subnet: #{subnet.id}"
end

#delete(subnet_id) ⇒ Object



757
758
759
760
761
762
# File 'lib/awscli/ec2.rb', line 757

def delete(subnet_id)
  subnet = @conn.subnets.get(subnet_id)
  abort "Cannot find subnet: #{subnet_id}" unless subnet
  subnet.destroy
  puts "Deleted subnet: #{subnet_id}"
end

#listObject



748
749
750
# File 'lib/awscli/ec2.rb', line 748

def list
  @conn.subnets.table
end