Class: Awscli::EC2::RouteTable
- Inherits:
-
Object
- Object
- Awscli::EC2::RouteTable
- Defined in:
- lib/awscli/ec2.rb
Overview
> Subnet
Instance Method Summary collapse
- #associate_route_table(options) ⇒ Object
- #create(options) ⇒ Object
- #create_route(options) ⇒ Object
- #delete(options) ⇒ Object
- #delete_route(options) ⇒ Object
- #disassociate_route_table(options) ⇒ Object
-
#initialize(connection) ⇒ RouteTable
constructor
A new instance of RouteTable.
- #list(options) ⇒ Object
Constructor Details
#initialize(connection) ⇒ RouteTable
Returns a new instance of RouteTable.
788 789 790 |
# File 'lib/awscli/ec2.rb', line 788 def initialize(connection) @conn = connection end |
Instance Method Details
#associate_route_table(options) ⇒ Object
826 827 828 829 |
# File 'lib/awscli/ec2.rb', line 826 def associate_route_table() @conn.associate_route_table([:route_table_id], [:subnet_id]) puts "Associated route table: #{[:route_table_id]} with subnet: #{[:subnet_id]}" end |
#create(options) ⇒ Object
801 802 803 804 |
# File 'lib/awscli/ec2.rb', line 801 def create() @conn.create_route_table([:vpc_id]) puts "Created route table" end |
#create_route(options) ⇒ Object
806 807 808 809 810 811 812 813 814 |
# File 'lib/awscli/ec2.rb', line 806 def create_route() @conn.create_route( [:route_table_id], [:dest_cidr], [:gateway_id] || nil, [:instance_id] || nil, [:net_interface_id] || nil) puts "Created specified route" end |
#delete(options) ⇒ Object
816 817 818 819 |
# File 'lib/awscli/ec2.rb', line 816 def delete() @conn.delete_route_table([:route_table_id]) puts "Deleted route table with id #{[:route_table_id]}" end |
#delete_route(options) ⇒ Object
821 822 823 824 |
# File 'lib/awscli/ec2.rb', line 821 def delete_route() @conn.delete_route([:route_table_id], [:dest_cidr]) puts "Deleted route from routetable: #{[:route_table_id]} with destination cidr: #{[:dest_cidr]}" end |
#disassociate_route_table(options) ⇒ Object
831 832 833 834 |
# File 'lib/awscli/ec2.rb', line 831 def disassociate_route_table() @conn.disassociate_route_table([:association_id]) puts "Disassociated route talbe with association_id: #{[:association_id]}" end |
#list(options) ⇒ Object
792 793 794 795 796 797 798 799 |
# File 'lib/awscli/ec2.rb', line 792 def list() if [:route_table_id] puts @conn.describe_route_tables('route-table-id' => [:route_table_id].split(',')).body['routeTableSet'].to_yaml else Formatador.display_line("[green]#{@conn.describe_route_tables.body['routeTableSet'].map {|k| k['associationSet'].first}.map{|k| k['routeTableId']}}[/]") puts "For more info on a specific route table pass route-table-id to '--route-table-id' or '-r' of `list` subcommand" end end |