Class: Awscli::EC2::Vpc

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

Overview

> Spot

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ Vpc

Returns a new instance of Vpc.



722
723
724
# File 'lib/awscli/ec2.rb', line 722

def initialize(connection)
  @conn = connection
end

Instance Method Details

#create(options) ⇒ Object



730
731
732
733
# File 'lib/awscli/ec2.rb', line 730

def create(options)
  vpc = @conn.vpcs.create(options)
  puts "Created VPC: #{vpc.id}"
end

#delete(vpc_id) ⇒ Object



735
736
737
738
739
740
# File 'lib/awscli/ec2.rb', line 735

def delete(vpc_id)
  vpc = @conn.vpcs.get(vpc_id)
  abort "cannot find vpc: #{vpc_id}" unless vpc
  vpc.destroy
  puts "Deleted VPC : #{vpc_id}"
end

#listObject



726
727
728
# File 'lib/awscli/ec2.rb', line 726

def list
  @conn.vpcs.table
end