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

clean up by changing service abstraction into a class

This commit is contained in:
geemus 2010-09-03 01:11:45 -07:00
parent a3af5d7800
commit fd755e042b
281 changed files with 417 additions and 589 deletions

View file

@ -3,7 +3,7 @@ require File.join(File.dirname(__FILE__), '..', 'lib', 'fog')
require 'irb'
require 'yaml'
require File.join('fog', 'credentials')
Fog.credential = ARGV.first
Fog.credential = ARGV.first ? ARGV.first.to_sym : nil
Fog.bin = true
unless Fog.credentials
exit

View file

@ -27,17 +27,6 @@ require 'fog/parser'
require 'fog/service'
require 'fog/ssh'
require 'fog/aws'
require 'fog/bluebox'
require 'fog/go_grid'
require 'fog/linode'
require 'fog/local'
require 'fog/new_servers'
require 'fog/rackspace'
require 'fog/slicehost'
require 'fog/terremark'
require 'fog/vcloud'
module Fog
unless const_defined?(:VERSION)
@ -92,3 +81,14 @@ module Fog
end
end
require 'fog/aws'
require 'fog/bluebox'
require 'fog/go_grid'
require 'fog/linode'
require 'fog/local'
require 'fog/new_servers'
require 'fog/rackspace'
require 'fog/slicehost'
require 'fog/terremark'
require 'fog/vcloud'

View file

@ -1,7 +1,6 @@
module Fog
module AWS
module EC2
extend Fog::Service
class EC2 < Fog::Service
requires :aws_access_key_id, :aws_secret_access_key

View file

@ -1,7 +1,6 @@
module Fog
module AWS
module ELB
extend Fog::Service
class ELB < Fog::Service
requires :aws_access_key_id, :aws_secret_access_key

View file

@ -2,7 +2,7 @@ require 'fog/model'
module Fog
module AWS
module EC2
class EC2
class Address < Fog::Model

View file

@ -3,15 +3,7 @@ require 'fog/aws/models/ec2/address'
module Fog
module AWS
module EC2
module Collections
def addresses(attributes = {})
Fog::AWS::EC2::Addresses.new({
:connection => self
}.merge!(attributes))
end
end
class EC2
class Addresses < Fog::Collection

View file

@ -2,7 +2,7 @@ require 'fog/model'
module Fog
module AWS
module EC2
class EC2
class Flavor < Fog::Model
@ -18,4 +18,4 @@ module Fog
end
end
end
end

View file

@ -3,13 +3,7 @@ require 'fog/aws/models/ec2/flavor'
module Fog
module AWS
module EC2
module Collections
def flavors
Fog::AWS::EC2::Flavors.new(:connection => self)
end
end
class EC2
class Flavors < Fog::Collection

View file

@ -2,7 +2,7 @@ require 'fog/model'
module Fog
module AWS
module EC2
class EC2
class Image < Fog::Model

View file

@ -3,13 +3,7 @@ require 'fog/aws/models/ec2/image'
module Fog
module AWS
module EC2
module Collections
def images
Fog::AWS::EC2::Images.new(:connection => self)
end
end
class EC2
class Images < Fog::Collection

View file

@ -2,7 +2,7 @@ require 'fog/model'
module Fog
module AWS
module EC2
class EC2
class KeyPair < Fog::Model

View file

@ -3,13 +3,7 @@ require 'fog/aws/models/ec2/key_pair'
module Fog
module AWS
module EC2
module Collections
def key_pairs
Fog::AWS::EC2::KeyPairs.new(:connection => self)
end
end
class EC2
class KeyPairs < Fog::Collection

View file

@ -2,7 +2,7 @@ require 'fog/model'
module Fog
module AWS
module EC2
class EC2
class SecurityGroup < Fog::Model

View file

@ -3,13 +3,7 @@ require 'fog/aws/models/ec2/security_group'
module Fog
module AWS
module EC2
module Collections
def security_groups
Fog::AWS::EC2::SecurityGroups.new(:connection => self)
end
end
class EC2
class SecurityGroups < Fog::Collection

View file

@ -2,7 +2,7 @@ require 'fog/model'
module Fog
module AWS
module EC2
class EC2
class Server < Fog::Model

View file

@ -3,13 +3,7 @@ require 'fog/aws/models/ec2/server'
module Fog
module AWS
module EC2
module Collections
def servers
Fog::AWS::EC2::Servers.new(:connection => self)
end
end
class EC2
class Servers < Fog::Collection

View file

@ -2,7 +2,7 @@ require 'fog/model'
module Fog
module AWS
module EC2
class EC2
class Snapshot < Fog::Model
extend Fog::Deprecation

View file

@ -3,15 +3,7 @@ require 'fog/aws/models/ec2/snapshot'
module Fog
module AWS
module EC2
module Collections
def snapshots(attributes = {})
Fog::AWS::EC2::Snapshots.new({
:connection => self
}.merge!(attributes))
end
end
class EC2
class Snapshots < Fog::Collection

View file

@ -2,7 +2,7 @@ require 'fog/model'
module Fog
module AWS
module EC2
class EC2
class Volume < Fog::Model
extend Fog::Deprecation

View file

@ -3,15 +3,7 @@ require 'fog/aws/models/ec2/volume'
module Fog
module AWS
module EC2
module Collections
def volumes(attributes = {})
Fog::AWS::EC2::Volumes.new({
:connection => self
}.merge!(attributes))
end
end
class EC2
class Volumes < Fog::Collection

View file

@ -3,13 +3,7 @@ require 'fog/aws/models/s3/directory'
module Fog
module AWS
module S3
module Collections
def directories
Fog::AWS::S3::Directories.new(:connection => self)
end
end
class S3
class Directories < Fog::Collection

View file

@ -3,7 +3,7 @@ require 'fog/aws/models/s3/files'
module Fog
module AWS
module S3
class S3
class Directory < Fog::Model
extend Fog::Deprecation

View file

@ -2,7 +2,7 @@ require 'fog/model'
module Fog
module AWS
module S3
class S3
class File < Fog::Model

View file

@ -3,13 +3,7 @@ require 'fog/aws/models/s3/file'
module Fog
module AWS
module S3
module Collections
def files
Fog::AWS::S3::Files.new(:connection => self)
end
end
class S3
class Files < Fog::Collection

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/allocate_address'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
# Associate an elastic IP address with an instance

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/attach_volume'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
# Add permissions to a security group

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/create_image'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/create_key_pair'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
# Create a new security group

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/create_snapshot'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/create_volume'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
# Delete a key pair that you own

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
# Delete a security group that you own

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
# Delete a snapshot of an EBS volume that you own

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
# Delete an EBS volume

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/deregister_image'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/describe_addresses'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/describe_availability_zones'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/describe_images'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/describe_instances'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/describe_key_pairs'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/describe_regions'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/describe_reserved_instances'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/describe_security_groups'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/describe_snapshots'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/describe_volumes'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/detach_volume'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
# Disassociate an elastic IP address from its instance (if any)

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/get_console_output'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
# Modify image attributes

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
# Modify snapshot attributes

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
# Reboot specified instances

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/register_image'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
# Release an elastic IP address.

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
# Remove permissions from a security group

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/run_instances'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/start_stop_instances'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/start_stop_instances'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module EC2
class EC2
class Real
require 'fog/aws/parsers/ec2/terminate_instances'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module ELB
class ELB
class Real
require 'fog/aws/parsers/elb/create_load_balancer'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module ELB
class ELB
class Real
require 'fog/aws/parsers/elb/delete_load_balancer'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module ELB
class ELB
class Real
require 'fog/aws/parsers/elb/deregister_instances_from_load_balancer'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module ELB
class ELB
class Real
require 'fog/aws/parsers/elb/describe_instance_health'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module ELB
class ELB
class Real
require 'fog/aws/parsers/elb/describe_load_balancers'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module ELB
class ELB
class Real
require 'fog/aws/parsers/elb/disable_availability_zones_for_load_balancer'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module ELB
class ELB
class Real
require 'fog/aws/parsers/elb/enable_availability_zones_for_load_balancer'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module ELB
class ELB
class Real
require 'fog/aws/parsers/elb/register_instances_with_load_balancer'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module S3
class S3
class Real
require 'fog/aws/parsers/s3/copy_object'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module S3
class S3
class Real
# Delete an S3 bucket

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module S3
class S3
class Real
# Delete an object from S3
@ -42,4 +42,4 @@ module Fog
end
end
end
end
end

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module S3
class S3
class Real
require 'fog/aws/parsers/s3/get_bucket'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module S3
class S3
class Real
require 'fog/aws/parsers/s3/access_control_list'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module S3
class S3
class Real
require 'fog/aws/parsers/s3/get_bucket_location'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module S3
class S3
class Real
require 'fog/aws/parsers/s3/get_bucket_logging'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module S3
class S3
class Real
require 'fog/aws/parsers/s3/get_bucket_object_versions'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module S3
class S3
class Real
require 'fog/aws/parsers/s3/get_bucket_versioning'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module S3
class S3
class Real
# Get an object from S3

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module S3
class S3
class Real
require 'fog/aws/parsers/s3/access_control_list'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module S3
class S3
class Real
# Get torrent for an S3 object

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module S3
class S3
class Real
# Get an expiring object url from S3

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module S3
class S3
class Real
require 'fog/aws/parsers/s3/get_request_payment'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module S3
class S3
class Real
require 'fog/aws/parsers/s3/get_service'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module S3
class S3
class Real
# Get headers for an object from S3

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module S3
class S3
class Real
# Create an S3 bucket

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module S3
class S3
class Real
# Change access control list for an S3 bucket

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module S3
class S3
class Real
# Change logging status for an S3 bucket

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module S3
class S3
class Real
# Change versioning status for an S3 bucket

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module S3
class S3
class Real
# Create an object in an S3 bucket

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module S3
class S3
class Real
# Get an expiring object url from S3 for putting an object

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module S3
class S3
class Real
# Change who pays for requests to an S3 bucket

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module SimpleDB
class SimpleDB
class Real
# Put items attributes into a SimpleDB domain

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module SimpleDB
class SimpleDB
class Real
# Create a SimpleDB domain

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module SimpleDB
class SimpleDB
class Real
# List metadata for SimpleDB domain

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module SimpleDB
class SimpleDB
class Real
# Delete a SimpleDB domain

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module SimpleDB
class SimpleDB
class Real
require 'fog/aws/parsers/simpledb/domain_metadata'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module SimpleDB
class SimpleDB
class Real
require 'fog/aws/parsers/simpledb/get_attributes'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module SimpleDB
class SimpleDB
class Real
require 'fog/aws/parsers/simpledb/list_domains'

View file

@ -1,6 +1,6 @@
module Fog
module AWS
module SimpleDB
class SimpleDB
class Real
# Put item attributes into a SimpleDB domain

Some files were not shown because too many files have changed in this diff Show more