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.
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() vpc = @conn.vpcs.create() 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 |
#list ⇒ Object
726 727 728 |
# File 'lib/awscli/ec2.rb', line 726 def list @conn.vpcs.table end |