class ZAWS::External::AWSCLI::Generators::Result::EC2::RouteTables

Public Class Methods

new() click to toggle source
# File lib/zaws/external/awscli/generators/result/ec2/route_tables.rb, line 8
def initialize
  @route_tables= {}
  @route_tables["RouteTables"]= []
  @route_tables["Associations"]= []
  self
end

Public Instance Methods

add(route_tables) click to toggle source
# File lib/zaws/external/awscli/generators/result/ec2/route_tables.rb, line 36
def add(route_tables)
  @route_tables["RouteTables"].concat(route_tables.get_route_tables_array)
  self
end
associate_subnets(route_table_number, subnets) click to toggle source
# File lib/zaws/external/awscli/generators/result/ec2/route_tables.rb, line 47
def associate_subnets(route_table_number, subnets)
  resize_route_tables_array(route_table_number)
  @route_tables["RouteTables"][route_table_number]["Associations"].concat(subnets.get_subnets_array)
  self
end
get_json() click to toggle source
# File lib/zaws/external/awscli/generators/result/ec2/route_tables.rb, line 59
def get_json
  @route_tables.to_json
end
get_json_single_route_table(index) click to toggle source
# File lib/zaws/external/awscli/generators/result/ec2/route_tables.rb, line 63
def get_json_single_route_table(index)
  single={"RouteTable" => @route_tables["RouteTables"][index]}
  single.to_json
end
get_route_tables_array() click to toggle source
# File lib/zaws/external/awscli/generators/result/ec2/route_tables.rb, line 68
def get_route_tables_array
  @route_tables["RouteTables"]
end
propagate_to_virtual_gateway(route_table_number, gateway) click to toggle source
# File lib/zaws/external/awscli/generators/result/ec2/route_tables.rb, line 53
def propagate_to_virtual_gateway(route_table_number, gateway)
  resize_route_tables_array(route_table_number)
  @route_tables["RouteTables"][route_table_number]["PropagatingVgws"] << gateway.get_hash
  self
end
resize_route_tables_array(index) click to toggle source
# File lib/zaws/external/awscli/generators/result/ec2/route_tables.rb, line 27
def resize_route_tables_array(index)
  while index > @route_tables["RouteTables"].length-1
    @route_tables["RouteTables"].push({})
  end
  @route_tables["RouteTables"][index]["Associations"] ||= []
  @route_tables["RouteTables"][index]["PropagatingVgws"] ||= []
  @route_tables["RouteTables"][index]["Routes"] ||= []
end
route_table_id(route_table_number, id) click to toggle source
# File lib/zaws/external/awscli/generators/result/ec2/route_tables.rb, line 21
def route_table_id(route_table_number, id)
  resize_route_tables_array(route_table_number)
  @route_tables["RouteTables"][route_table_number]["RouteTableId"]=id
  self
end
routes(route_table_number, routes) click to toggle source
# File lib/zaws/external/awscli/generators/result/ec2/route_tables.rb, line 41
def routes(route_table_number, routes)
  resize_route_tables_array(route_table_number)
  @route_tables["RouteTables"][route_table_number]["Routes"].concat(routes.get_route_array)
  self
end
vpc_id(route_table_number, vpc_id) click to toggle source
# File lib/zaws/external/awscli/generators/result/ec2/route_tables.rb, line 15
def vpc_id(route_table_number, vpc_id)
  resize_route_tables_array(route_table_number)
  @route_tables["RouteTables"][route_table_number]["VpcId"]=vpc_id
  self
end