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.



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)
  vpc = @conn.vpcs.create(options)
  puts "Created VPC: #{vpc.id}"
end

#delete(vpc_id) ⇒ Object



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

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



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

def list
  @conn.vpcs.table
end