Class: Awscli::EC2::Subnet
- Inherits:
-
Object
- Object
- Awscli::EC2::Subnet
- Defined in:
- lib/awscli/ec2.rb
Overview
> Vpc
Instance Method Summary collapse
- #create(options) ⇒ Object
- #delete(subnet_id) ⇒ Object
-
#initialize(connection) ⇒ Subnet
constructor
A new instance of Subnet.
- #list ⇒ Object
Constructor Details
#initialize(connection) ⇒ Subnet
Returns a new instance of Subnet.
756 757 758 |
# File 'lib/awscli/ec2.rb', line 756 def initialize(connection) @conn = connection end |
Instance Method Details
#create(options) ⇒ Object
764 765 766 767 |
# File 'lib/awscli/ec2.rb', line 764 def create() subnet = @conn.subnets.create() puts "Created Subnet: #{subnet.id}" end |
#delete(subnet_id) ⇒ Object
769 770 771 772 773 774 |
# File 'lib/awscli/ec2.rb', line 769 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 |
#list ⇒ Object
760 761 762 |
# File 'lib/awscli/ec2.rb', line 760 def list @conn.subnets.table end |