Class: Fog::Compute::AWS::RouteTables

Inherits:
Fog::Collection show all
Defined in:
lib/fog/aws/models/compute/route_tables.rb

Instance Attribute Summary

Attributes inherited from Fog::Collection

#service

Instance Method Summary collapse

Methods inherited from Fog::Collection

#clear, #create, #destroy, #inspect, #load, model, #model, #new, #reload, #table, #to_json

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Fog::Core::DeprecatedConnectionAccessors

#connection, #connection=, #prepare_service_value

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one

Constructor Details

#initialize(attributes) ⇒ RouteTables

Creates a new route table

AWS.route_tables.new

Returns

Returns the details of the new route table

>> AWS.route_tables.new <Fog::Compute::AWS::RouteTable id=nil, vpc_id=nil, routes=nil, associations=nil, tags=nil >



32
33
34
35
# File 'lib/fog/aws/models/compute/route_tables.rb', line 32

def initialize(attributes)
  self.filters ||= {}
  super
end

Instance Method Details

#all(filters = filters) ⇒ Object

Returns an array of all route tables that have been created

AWS.route_tables.all

Returns

Returns an array of all route tables

>> AWS.route_tables.all <Fog::Compute::AWS::RouteTables filters={} [ <Fog::Compute::AWS::RouteTable id=“rtb-41e8552f”, TODO > ] >



57
58
59
60
61
62
63
64
65
# File 'lib/fog/aws/models/compute/route_tables.rb', line 57

def all(filters = filters)
  unless filters.is_a?(Hash)
    Fog::Logger.warning("all with #{filters.class} param is deprecated, use all('route-table-id' => []) instead [light_black](#{caller.first})[/]")
    filters = {'route-table-id' => [*filters]}
  end
  self.filters = filters
  data = service.describe_route_tables(filters).body
  load(data['routeTableSet'])
end

#get(route_table_id) ⇒ Object

Used to retrieve a route table route_table_id is required to get the associated route table information.

You can run the following command to get the details: AWS.route_tables.get(“rtb-41e8552f”)

Returns

>> AWS.route_tables.get(“rtb-41e8552f”) <Fog::Compute::AWS::RouteTable id=“rtb-41e8552f”, TODO >



82
83
84
85
86
# File 'lib/fog/aws/models/compute/route_tables.rb', line 82

def get(route_table_id)
  if route_table_id
    self.class.new(:service => service).all('route-table-id' => route_table_id).first
  end
end