1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Added correct description comment to describe_route_tables, disassociate_route_table, delete_route, delete_route_table, create_route, and route_table(s) model.

This commit is contained in:
Kyla Kolb 2013-08-06 13:29:51 -04:00 committed by Robert Clark
parent ec19b36c96
commit 3305c28ce0
7 changed files with 92 additions and 63 deletions

View file

@ -19,9 +19,9 @@ module Fog
super
end
# Removes an existing vpc
# Remove an existing route table
#
# vpc.destroy
# route_tables.destroy
#
# ==== Returns
#
@ -35,15 +35,14 @@ module Fog
true
end
# Create a vpc
# Create a route table
#
# >> g = AWS.vpcs.new(:cidr_block => "10.1.2.0/24")
# >> g.save
# >> routetable = connection.route_tables.new
# >> routetable.save
#
# == Returns:
#
# True or an exception depending on the result. Keep in mind that this *creates* a new vpc.
# As such, it yields an InvalidGroup.Duplicate exception if you attempt to save an existing vpc.
# True or an exception depending on the result. Keep in mind that this *creates* a new route table.
#
def save

View file

@ -11,22 +11,22 @@ module Fog
model Fog::Compute::AWS::RouteTable
# Creates a new VPC
# Creates a new route table
#
# AWS.vpcs.new
# AWS.route_tables.new
#
# ==== Returns
#
# Returns the details of the new VPC
# Returns the details of the new route table
#
#>> AWS.vpcs.new
# <Fog::AWS::VPC::VPC
#>> AWS.route_tables.new
# <Fog::Compute::AWS::RouteTable
# id=nil,
# state=nil,
# cidr_block=nil,
# dhcp_options_id=nil
# vpc_id=nil,
# routes=nil,
# associations=nil,
# tags=nil
# tenancy=nil
# >
#
@ -35,20 +35,20 @@ module Fog
super
end
# Returns an array of all VPCs that have been created
# Returns an array of all route tables that have been created
#
# AWS.vpcs.all
# AWS.route_tables.all
#
# ==== Returns
#
# Returns an array of all VPCs
# Returns an array of all route tables
#
#>> AWS.vpcs.all
# <Fog::AWS::VPC::VPCs
#>> AWS.route_tables.all
# <Fog::Compute::AWS::RouteTables
# filters={}
# [
# <Fog::AWS::VPC::VPC
# id="vpc-12345678",
# <Fog::Compute::AWS::RouteTable
# id="rtb-41e8552f",
# TODO
# >
# ]
@ -65,17 +65,17 @@ module Fog
load(data['routeTableSet'])
end
# Used to retrieve a VPC
# vpc_id is required to get the associated VPC information.
# 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.vpcs.get("vpc-12345678")
# AWS.route_tables.get("rtb-41e8552f")
#
# ==== Returns
#
#>> AWS.vpcs.get("vpc-12345678")
# <Fog::AWS::Compute::VPC
# id="vpc-12345678",
#>> AWS.route_tables.get("rtb-41e8552f")
# <Fog::Compute::AWS::RouteTable
# id="rtb-41e8552f",
# TODO
# >
#

View file

@ -5,7 +5,22 @@ module Fog
require 'fog/aws/parsers/compute/basic'
# Creates a route table within a VPC.
#
# ==== Parameters
# * RouteTableId<~String> - The ID of the route table for the route.
# * DestinationCidrBlock<~String> - The CIDR address block used for the destination match. Routing decisions are based on the most specific match.
# * GatewayId<~String> - The ID of an Internet gateway attached to your VPC.
# * InstanceId<~String> - he ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.
# * NetworkInterfaceId<~String> - The ID of a network interface.
#
# === Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'requestId'<~String> - Id of the request
# * 'return'<~Boolean> - Returns true if the request succeeds. Otherwise, returns an error.
#
# {Amazon API Reference}[http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-CreateRoute.html]
def create_route(route_table_id, destination_cidr_block, internet_gateway_id=nil, instance_id=nil)
if internet_gateway_id
request(

View file

@ -5,7 +5,19 @@ module Fog
require 'fog/aws/parsers/compute/basic'
# Deletes the specified route from the specified route table.
#
# ==== Parameters
# * RouteTableId<~String> - The ID of the route table.
# * DestinationCidrBlock<~String> - The CIDR range for the route. The value you specify must match the CIDR for the route exactly.
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'requestId'<~String> - The ID of the request.
# * 'return'<~Boolean> - Returns true if the request succeeds. Otherwise, returns an error.
#
# {Amazon API Reference}[http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DeleteRoute.html]
def delete_route(route_table_id, destination_cidr_block)
request(
'Action' => 'DeleteRoute',

View file

@ -5,18 +5,18 @@ module Fog
require 'fog/aws/parsers/compute/basic'
# Delete an EBS volume
# Deletes the specified route table.
#
# ==== Parameters
# * volume_id<~String> - Id of volume to delete.
# * RouteTableId<~String> - The ID of the route table.
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'requestId'<~String> - Id of request
# * 'return'<~Boolean> - success?
# * 'requestId'<~String> - The ID of request.
# * 'return'<~Boolean> - Returns true if the request succeeds. Otherwise, returns an error.
#
# {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DeleteVolume.html]
# {Amazon API Reference}[http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DeleteRouteTable.html]
def delete_route_table(route_table_id)
request(
'Action' => 'DeleteRouteTable',

View file

@ -5,30 +5,39 @@ module Fog
require 'fog/aws/parsers/compute/describe_route_tables'
# Describe all or specified volumes.
# Describe one or more of your route tables.
#
# ==== Parameters
# * RouteTableId<~String> - One or more route table IDs.
# * filters<~Hash> - List of filters to limit results with
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'volumeSet'<~Array>:
# * 'availabilityZone'<~String> - Availability zone for volume
# * 'createTime'<~Time> - Timestamp for creation
# * 'size'<~Integer> - Size in GiBs for volume
# * 'snapshotId'<~String> - Snapshot volume was created from, if any
# * 'status'<~String> - State of volume
# * 'volumeId'<~String> - Reference to volume
# * 'attachmentSet'<~Array>:
# * 'attachmentTime'<~Time> - Timestamp for attachment
# * 'deleteOnTermination'<~Boolean> - Whether or not to delete volume on instance termination
# * 'device'<~String> - How value is exposed to instance
# * 'instanceId'<~String> - Reference to attached instance
# * 'status'<~String> - Attachment state
# * 'volumeId'<~String> - Reference to volume
# * 'requestId'<~String> - The ID of the request.
# * 'routeTableSet'<~Array>:
# * 'routeTableId'<~String> - The route table's ID.
# * 'vpcId'<~String> - The ID of the VPC for the route table.
# * 'routeSet'<~Array>:
# * 'destinationCidrBlock'<~String> - The CIDR address block used for the destination match.
# * 'gatewayId'<~String> - The ID of a gateway attached to your VPC.
# * 'instanceId'<~String> - The ID of a NAT instance in your VPC.
# * 'instanceOwnerId'<~String> - The owner of the instance.
# * 'networkInterfaceId'<~String> - The network interface ID.
# * 'state'<~String> - The state of the route. The blackhole state indicates that the route's target isn't available.
# * 'origin'<~String> - Describes how the route was created.
# * 'associationSet'<~Array>:
# * 'RouteTableAssociationId'<~String> - An identifier representing the association between a route table and a subnet.
# * 'routeTableId'<~String> - The ID of the route table.
# * 'subnetId'<~String> - The ID of the subnet.
# * 'main'<~Boolean> - Indicates whether this is the main route table.
# * 'propagatingVgwSet'<~Array>:
# * 'gatewayID'<~String> - The ID of the virtual private gateway (VGW).
# * 'tagSet'<~Array>:
# * 'key'<~String> - The tag key.
# * 'value'<~String> - The tag value.
#
# {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeVolumes.html]
# {Amazon API Reference}[http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeRouteTables.html]
def describe_route_tables(filters = {})
unless filters.is_a?(Hash)
Fog::Logger.deprecation("describe_route_tables with #{filters.class} param is deprecated, use describe_route_tables('route-table-id' => []) instead [light_black](#{caller.first})[/]")

View file

@ -5,24 +5,18 @@ module Fog
require 'fog/aws/parsers/compute/disassociate_route_table'
# Attach an Amazon EBS volume with a running instance, exposing as specified device
# Disassociates a subnet from a route table.
#
# ==== Parameters
# * instance_id<~String> - Id of instance to associate volume with
# * volume_id<~String> - Id of amazon EBS volume to associate with instance
# * device<~String> - Specifies how the device is exposed to the instance (e.g. "/dev/sdh")
#
# * AssociationId<~String> - The association ID representing the current association between the route table and subnet.
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'attachTime'<~Time> - Time of attachment was initiated at
# * 'device'<~String> - Device as it is exposed to the instance
# * 'instanceId'<~String> - Id of instance for volume
# * 'requestId'<~String> - Id of request
# * 'status'<~String> - Status of volume
# * 'volumeId'<~String> - Reference to volume
# * 'requestId'<~String> - The ID of the request.
# * 'return'<~Boolean> - Returns true if the request succeeds. Otherwise, returns an error.
#
# {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-AttachVolume.html]
# {Amazon API Reference}[http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DisassociateRouteTable.html]
def disassociate_route_table(association_id)
request(
'Action' => 'DisassociateRouteTable',