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.
766 767 768 |
# File 'lib/awscli/ec2.rb', line 766 def initialize(connection) @conn = connection end |
Instance Method Details
#create(options) ⇒ Object
774 775 776 777 |
# File 'lib/awscli/ec2.rb', line 774 def create() subnet = @conn.subnets.create() puts "Created Subnet: #{subnet.id}" end |
#delete(subnet_id) ⇒ Object
779 780 781 782 783 784 |
# File 'lib/awscli/ec2.rb', line 779 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
770 771 772 |
# File 'lib/awscli/ec2.rb', line 770 def list @conn.subnets.table end |