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.
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() subnet = @conn.subnets.create() puts "Created Subnet: #{subnet.id}" end |
#delete(subnet_id) ⇒ Object
757 758 759 760 761 762 |
# File 'lib/awscli/ec2.rb', line 757 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
748 749 750 |
# File 'lib/awscli/ec2.rb', line 748 def list @conn.subnets.table end |