Class: Awscli::EC2::Vpc
- Inherits:
-
Object
- Object
- Awscli::EC2::Vpc
- Defined in:
- lib/awscli/ec2.rb
Overview
> Spot
Instance Method Summary collapse
- #create(options) ⇒ Object
- #delete(vpc_id) ⇒ Object
-
#initialize(connection) ⇒ Vpc
constructor
A new instance of Vpc.
- #list ⇒ Object
Constructor Details
#initialize(connection) ⇒ Vpc
Returns a new instance of Vpc.
734 735 736 |
# File 'lib/awscli/ec2.rb', line 734 def initialize(connection) @conn = connection end |
Instance Method Details
#create(options) ⇒ Object
742 743 744 745 |
# File 'lib/awscli/ec2.rb', line 742 def create() vpc = @conn.vpcs.create() puts "Created VPC: #{vpc.id}" end |
#delete(vpc_id) ⇒ Object
747 748 749 750 751 752 |
# File 'lib/awscli/ec2.rb', line 747 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 |
#list ⇒ Object
738 739 740 |
# File 'lib/awscli/ec2.rb', line 738 def list @conn.vpcs.table end |