diff --git a/lib/fog/aws.rb b/lib/fog/aws.rb index dac4f06a5..ab75faf98 100644 --- a/lib/fog/aws.rb +++ b/lib/fog/aws.rb @@ -1,32 +1,209 @@ -require 'fog/aws/version' +require 'fog/core' +require 'fog/xml' +require 'fog/json' + +require File.expand_path('../aws/version', __FILE__) +require File.expand_path('../aws/credential_fetcher', __FILE__) +require File.expand_path('../aws/region_methods', __FILE__) +require File.expand_path('../aws/signaturev4', __FILE__) module Fog - module AWS + module CDN + autoload :AWS, File.expand_path('../aws/cdn', __FILE__) end -end -require File.expand_path('../aws/core', __FILE__) + module Compute + autoload :AWS, File.expand_path('../aws/compute', __FILE__) + end -require File.expand_path('../aws/auto_scaling', __FILE__) -require File.expand_path('../aws/beanstalk', __FILE__) -require File.expand_path('../aws/cdn', __FILE__) -require File.expand_path('../aws/cloud_formation', __FILE__) -require File.expand_path('../aws/cloud_watch', __FILE__) -require File.expand_path('../aws/compute', __FILE__) -require File.expand_path('../aws/data_pipeline', __FILE__) -require File.expand_path('../aws/dns', __FILE__) -require File.expand_path('../aws/dynamodb', __FILE__) -require File.expand_path('../aws/elasticache', __FILE__) -require File.expand_path('../aws/elb', __FILE__) -require File.expand_path('../aws/emr', __FILE__) -require File.expand_path('../aws/federation', __FILE__) -require File.expand_path('../aws/glacier', __FILE__) -require File.expand_path('../aws/iam', __FILE__) -require File.expand_path('../aws/rds', __FILE__) -require File.expand_path('../aws/redshift', __FILE__) -require File.expand_path('../aws/ses', __FILE__) -require File.expand_path('../aws/simpledb', __FILE__) -require File.expand_path('../aws/sns', __FILE__) -require File.expand_path('../aws/sqs', __FILE__) -require File.expand_path('../aws/storage', __FILE__) -require File.expand_path('../aws/sts', __FILE__) + module DNS + autoload :AWS, File.expand_path('../aws/dns', __FILE__) + end + + module Storage + autoload :AWS, File.expand_path('../aws/storage', __FILE__) + end + + module AWS + extend Fog::Provider + + autoload :Mock, File.expand_path('../aws/mock', __FILE__) + autoload :Errors, File.expand_path('../aws/errors', __FILE__) + + # Services + autoload :AutoScaling, File.expand_path('../aws/auto_scaling', __FILE__) + autoload :ElasticBeanstalk, File.expand_path('../aws/beanstalk', __FILE__) + autoload :CloudFormation, File.expand_path('../aws/cloud_formation', __FILE__) + autoload :CloudWatch, File.expand_path('../aws/cloud_watch', __FILE__) + autoload :DataPipeline, File.expand_path('../aws/data_pipeline', __FILE__) + autoload :DynamoDB, File.expand_path('../aws/dynamodb', __FILE__) + autoload :Elasticache, File.expand_path('../aws/elasticache', __FILE__) + autoload :ELB, File.expand_path('../aws/elb', __FILE__) + autoload :EMR, File.expand_path('../aws/emr', __FILE__) + autoload :Federation, File.expand_path('../aws/federation', __FILE__) + autoload :Glacier, File.expand_path('../aws/glacier', __FILE__) + autoload :IAM, File.expand_path('../aws/iam', __FILE__) + autoload :RDS, File.expand_path('../aws/rds', __FILE__) + autoload :Redshift, File.expand_path('../aws/redshift', __FILE__) + autoload :SES, File.expand_path('../aws/ses', __FILE__) + autoload :SimpleDB, File.expand_path('../aws/simpledb', __FILE__) + autoload :SNS, File.expand_path('../aws/sns', __FILE__) + autoload :SQS, File.expand_path('../aws/sqs', __FILE__) + autoload :STS, File.expand_path('../aws/sts', __FILE__) + + service(:auto_scaling, 'AutoScaling') + service(:beanstalk, 'ElasticBeanstalk') + service(:cdn, 'CDN') + service(:compute, 'Compute') + service(:cloud_formation, 'CloudFormation') + service(:cloud_watch, 'CloudWatch') + service(:data_pipeline, 'DataPipeline') + service(:dynamodb, 'DynamoDB') + service(:dns, 'DNS') + service(:elasticache, 'Elasticache') + service(:elb, 'ELB') + service(:emr, 'EMR') + service(:federation, 'Federation') + service(:glacier, 'Glacier') + service(:iam, 'IAM') + service(:rds, 'RDS') + service(:redshift, 'Redshift') + service(:ses, 'SES') + service(:simpledb, 'SimpleDB') + service(:sns, 'SNS') + service(:sqs, 'SQS') + service(:sts, 'STS') + service(:storage, 'Storage') + + def self.indexed_param(key, values) + params = {} + unless key.include?('%d') + key << '.%d' + end + [*values].each_with_index do |value, index| + if value.respond_to?('keys') + k = format(key, index + 1) + value.each do | vkey, vvalue | + params["#{k}.#{vkey}"] = vvalue + end + else + params[format(key, index + 1)] = value + end + end + params + end + + def self.serialize_keys(key, value, options = {}) + case value + when Hash + value.each do | k, v | + options.merge!(serialize_keys("#{key}.#{k}", v)) + end + return options + when Array + value.each_with_index do | it, idx | + options.merge!(serialize_keys("#{key}.member.#{(idx + 1)}", it)) + end + return options + else + return {key => value} + end + end + + def self.indexed_request_param(name, values) + idx = -1 + Array(values).reduce({}) do |params, value| + params["#{name}.#{idx += 1}"] = value + params + end + end + + def self.indexed_filters(filters) + params = {} + filters.keys.each_with_index do |key, key_index| + key_index += 1 + params[format('Filter.%d.Name', key_index)] = key + [*filters[key]].each_with_index do |value, value_index| + value_index += 1 + params[format('Filter.%d.Value.%d', key_index, value_index)] = value + end + end + params + end + + def self.escape(string) + string.gsub(/([^a-zA-Z0-9_.\-~]+)/) { + "%" + $1.unpack("H2" * $1.bytesize).join("%").upcase + } + end + + def self.signed_params_v4(params, headers, options={}) + date = Fog::Time.now + + params = params.merge('Version' => options[:version]) + + headers = headers.merge('Host' => options[:host], 'x-amz-date' => date.to_iso8601_basic) + headers['x-amz-security-token'] = options[:aws_session_token] if options[:aws_session_token] + + body = '' + for key in params.keys.sort + unless (value = params[key]).nil? + body << "#{key}=#{escape(value.to_s)}&" + end + end + body.chop! + + headers['Authorization'] = options[:signer].sign({:method => options[:method], :headers => headers, :body => body, :query => {}, :path => options[:path]}, date) + + return body, headers + end + + def self.signed_params(params, options = {}) + params.merge!({ + 'AWSAccessKeyId' => options[:aws_access_key_id], + 'SignatureMethod' => 'HmacSHA256', + 'SignatureVersion' => '2', + 'Timestamp' => Time.now.utc.strftime("%Y-%m-%dT%H:%M:%SZ"), + 'Version' => options[:version] + }) + + params.merge!({ + 'SecurityToken' => options[:aws_session_token] + }) if options[:aws_session_token] + + body = '' + for key in params.keys.sort + unless (value = params[key]).nil? + body << "#{key}=#{escape(value.to_s)}&" + end + end + string_to_sign = "POST\n#{options[:host]}:#{options[:port]}\n#{options[:path]}\n" << body.chop + signed_string = options[:hmac].sign(string_to_sign) + body << "Signature=#{escape(Base64.encode64(signed_string).chomp!)}" + + body + end + + def self.parse_security_group_options(group_name, options) + options ||= Hash.new + if group_name.is_a?(Hash) + options = group_name + elsif group_name + if options.key?('GroupName') + raise Fog::Compute::AWS::Error, 'Arguments specified both group_name and GroupName in options' + end + options = options.clone + options['GroupName'] = group_name + end + name_specified = options.key?('GroupName') && !options['GroupName'].nil? + group_id_specified = options.key?('GroupId') && !options['GroupId'].nil? + unless name_specified || group_id_specified + raise Fog::Compute::AWS::Error, 'Neither GroupName nor GroupId specified' + end + if name_specified && group_id_specified + options.delete('GroupName') + end + options + end + end +end \ No newline at end of file diff --git a/lib/fog/aws/auto_scaling.rb b/lib/fog/aws/auto_scaling.rb index 75cda1646..f7d7c8d54 100644 --- a/lib/fog/aws/auto_scaling.rb +++ b/lib/fog/aws/auto_scaling.rb @@ -1,5 +1,3 @@ -require 'fog/aws/core' - module Fog module AWS class AutoScaling < Fog::Service diff --git a/lib/fog/aws/beanstalk.rb b/lib/fog/aws/beanstalk.rb index 144677a2e..32bd62cd1 100644 --- a/lib/fog/aws/beanstalk.rb +++ b/lib/fog/aws/beanstalk.rb @@ -1,5 +1,3 @@ -require 'fog/aws/core' - module Fog module AWS class ElasticBeanstalk < Fog::Service diff --git a/lib/fog/aws/cdn.rb b/lib/fog/aws/cdn.rb index 68106a004..d1ee35608 100644 --- a/lib/fog/aws/cdn.rb +++ b/lib/fog/aws/cdn.rb @@ -1,5 +1,3 @@ -require 'fog/aws/core' - module Fog module CDN class AWS < Fog::Service diff --git a/lib/fog/aws/cloud_formation.rb b/lib/fog/aws/cloud_formation.rb index 55b54c299..a5d11af8c 100644 --- a/lib/fog/aws/cloud_formation.rb +++ b/lib/fog/aws/cloud_formation.rb @@ -1,5 +1,3 @@ -require 'fog/aws/core' - module Fog module AWS class CloudFormation < Fog::Service diff --git a/lib/fog/aws/cloud_watch.rb b/lib/fog/aws/cloud_watch.rb index 8000ca129..423aa494b 100644 --- a/lib/fog/aws/cloud_watch.rb +++ b/lib/fog/aws/cloud_watch.rb @@ -1,5 +1,3 @@ -require 'fog/aws/core' - module Fog module AWS class CloudWatch < Fog::Service diff --git a/lib/fog/aws/compute.rb b/lib/fog/aws/compute.rb index c859e1e0d..151af4199 100644 --- a/lib/fog/aws/compute.rb +++ b/lib/fog/aws/compute.rb @@ -1,5 +1,3 @@ -require 'fog/aws/core' - module Fog module Compute class AWS < Fog::Service diff --git a/lib/fog/aws/core.rb b/lib/fog/aws/core.rb deleted file mode 100644 index bb7e3aaca..000000000 --- a/lib/fog/aws/core.rb +++ /dev/null @@ -1,344 +0,0 @@ -require 'fog/core' -require 'fog/xml' -require 'fog/json' -require 'fog/aws/credential_fetcher' -require 'fog/aws/region_methods' -require 'fog/aws/signaturev4' - -module Fog - module AWS - extend Fog::Provider - - service(:auto_scaling, 'AutoScaling') - service(:beanstalk, 'ElasticBeanstalk') - service(:cdn, 'CDN') - service(:compute, 'Compute') - service(:cloud_formation, 'CloudFormation') - service(:cloud_watch, 'CloudWatch') - service(:data_pipeline, 'DataPipeline') - service(:dynamodb, 'DynamoDB') - service(:dns, 'DNS') - service(:elasticache, 'Elasticache') - service(:elb, 'ELB') - service(:emr, 'EMR') - service(:federation, 'Federation') - service(:glacier, 'Glacier') - service(:iam, 'IAM') - service(:rds, 'RDS') - service(:redshift, 'Redshift') - service(:ses, 'SES') - service(:simpledb, 'SimpleDB') - service(:sns, 'SNS') - service(:sqs, 'SQS') - service(:sts, 'STS') - service(:storage, 'Storage') - - def self.indexed_param(key, values) - params = {} - unless key.include?('%d') - key << '.%d' - end - [*values].each_with_index do |value, index| - if value.respond_to?('keys') - k = format(key, index + 1) - value.each do | vkey, vvalue | - params["#{k}.#{vkey}"] = vvalue - end - else - params[format(key, index + 1)] = value - end - end - params - end - - def self.serialize_keys(key, value, options = {}) - case value - when Hash - value.each do | k, v | - options.merge!(serialize_keys("#{key}.#{k}", v)) - end - return options - when Array - value.each_with_index do | it, idx | - options.merge!(serialize_keys("#{key}.member.#{(idx + 1)}", it)) - end - return options - else - return {key => value} - end - end - - def self.indexed_request_param(name, values) - idx = -1 - Array(values).reduce({}) do |params, value| - params["#{name}.#{idx += 1}"] = value - params - end - end - - def self.indexed_filters(filters) - params = {} - filters.keys.each_with_index do |key, key_index| - key_index += 1 - params[format('Filter.%d.Name', key_index)] = key - [*filters[key]].each_with_index do |value, value_index| - value_index += 1 - params[format('Filter.%d.Value.%d', key_index, value_index)] = value - end - end - params - end - - def self.escape(string) - string.gsub(/([^a-zA-Z0-9_.\-~]+)/) { - "%" + $1.unpack("H2" * $1.bytesize).join("%").upcase - } - end - - def self.signed_params_v4(params, headers, options={}) - date = Fog::Time.now - - params = params.merge('Version' => options[:version]) - - headers = headers.merge('Host' => options[:host], 'x-amz-date' => date.to_iso8601_basic) - headers['x-amz-security-token'] = options[:aws_session_token] if options[:aws_session_token] - - body = '' - for key in params.keys.sort - unless (value = params[key]).nil? - body << "#{key}=#{escape(value.to_s)}&" - end - end - body.chop! - - headers['Authorization'] = options[:signer].sign({:method => options[:method], :headers => headers, :body => body, :query => {}, :path => options[:path]}, date) - - return body, headers - end - - def self.signed_params(params, options = {}) - params.merge!({ - 'AWSAccessKeyId' => options[:aws_access_key_id], - 'SignatureMethod' => 'HmacSHA256', - 'SignatureVersion' => '2', - 'Timestamp' => Time.now.utc.strftime("%Y-%m-%dT%H:%M:%SZ"), - 'Version' => options[:version] - }) - - params.merge!({ - 'SecurityToken' => options[:aws_session_token] - }) if options[:aws_session_token] - - body = '' - for key in params.keys.sort - unless (value = params[key]).nil? - body << "#{key}=#{escape(value.to_s)}&" - end - end - string_to_sign = "POST\n#{options[:host]}:#{options[:port]}\n#{options[:path]}\n" << body.chop - signed_string = options[:hmac].sign(string_to_sign) - body << "Signature=#{escape(Base64.encode64(signed_string).chomp!)}" - - body - end - - class Mock - def self.arn(vendor, account_id, path, region = nil) - "arn:aws:#{vendor}:#{region}:#{account_id}:#{path}" - end - - def self.availability_zone(region) - "#{region}#{Fog::Mock.random_selection('abcd', 1)}" - end - - def self.box_usage - sprintf("%0.10f", rand / 100).to_f - end - - def self.console_output - # "[ 0.000000] Linux version 2.6.18-xenU-ec2-v1.2 (root@domU-12-31-39-07-51-82) (gcc version 4.1.2 20070626 (Red Hat 4.1.2-13)) #2 SMP Wed Aug 19 09:04:38 EDT 2009" - Base64.decode64("WyAwLjAwMDAwMF0gTGludXggdmVyc2lvbiAyLjYuMTgteGVuVS1lYzItdjEu\nMiAocm9vdEBkb21VLTEyLTMxLTM5LTA3LTUxLTgyKSAoZ2NjIHZlcnNpb24g\nNC4xLjIgMjAwNzA2MjYgKFJlZCBIYXQgNC4xLjItMTMpKSAjMiBTTVAgV2Vk\nIEF1ZyAxOSAwOTowNDozOCBFRFQgMjAwOQ==\n") - end - - def self.dns_name_for(ip_address) - "ec2-#{ip_address.gsub('.','-')}.compute-1.amazonaws.com" - end - - def self.private_dns_name_for(ip_address) - "ip-#{ip_address.gsub('.','-')}.ec2.internal" - end - - def self.image - path = [] - (rand(3) + 2).times do - path << Fog::Mock.random_letters(rand(9) + 8) - end - { - "imageOwnerId" => Fog::Mock.random_letters(rand(5) + 4), - "blockDeviceMapping" => [], - "productCodes" => [], - "kernelId" => kernel_id, - "ramdiskId" => ramdisk_id, - "imageState" => "available", - "imageId" => image_id, - "architecture" => "i386", - "isPublic" => true, - "imageLocation" => path.join('/'), - "imageType" => "machine", - "rootDeviceType" => ["ebs","instance-store"][rand(2)], - "rootDeviceName" => "/dev/sda1" - } - end - - def self.image_id - "ami-#{Fog::Mock.random_hex(8)}" - end - - def self.key_fingerprint - fingerprint = [] - 20.times do - fingerprint << Fog::Mock.random_hex(2) - end - fingerprint.join(':') - end - - def self.instance_id - "i-#{Fog::Mock.random_hex(8)}" - end - - def self.ip_address - Fog::Mock.random_ip - end - - def self.private_ip_address - ip_address.gsub(/^\d{1,3}\./,"10.") - end - - def self.kernel_id - "aki-#{Fog::Mock.random_hex(8)}" - end - - def self.key_material - OpenSSL::PKey::RSA.generate(1024).to_s - end - - def self.owner_id - Fog::Mock.random_numbers(12) - end - - def self.ramdisk_id - "ari-#{Fog::Mock.random_hex(8)}" - end - - def self.request_id - request_id = [] - request_id << Fog::Mock.random_hex(8) - 3.times do - request_id << Fog::Mock.random_hex(4) - end - request_id << Fog::Mock.random_hex(12) - request_id.join('-') - end - class << self - alias_method :reserved_instances_id, :request_id - alias_method :reserved_instances_offering_id, :request_id - alias_method :sqs_message_id, :request_id - alias_method :sqs_sender_id, :request_id - end - - def self.reservation_id - "r-#{Fog::Mock.random_hex(8)}" - end - - def self.snapshot_id - "snap-#{Fog::Mock.random_hex(8)}" - end - - def self.volume_id - "vol-#{Fog::Mock.random_hex(8)}" - end - - def self.security_group_id - "sg-#{Fog::Mock.random_hex(8)}" - end - - def self.network_acl_id - "acl-#{Fog::Mock.random_hex(8)}" - end - def self.network_acl_association_id - "aclassoc-#{Fog::Mock.random_hex(8)}" - end - def self.network_interface_id - "eni-#{Fog::Mock.random_hex(8)}" - end - def self.internet_gateway_id - "igw-#{Fog::Mock.random_hex(8)}" - end - def self.dhcp_options_id - "dopt-#{Fog::Mock.random_hex(8)}" - end - def self.vpc_id - "vpc-#{Fog::Mock.random_hex(8)}" - end - def self.subnet_id - "subnet-#{Fog::Mock.random_hex(8)}" - end - def self.zone_id - "zone-#{Fog::Mock.random_hex(8)}" - end - def self.change_id - Fog::Mock.random_letters_and_numbers(14) - end - def self.nameservers - [ - 'ns-2048.awsdns-64.com', - 'ns-2049.awsdns-65.net', - 'ns-2050.awsdns-66.org', - 'ns-2051.awsdns-67.co.uk' - ] - end - - def self.key_id(length=21) - #Probably close enough - Fog::Mock.random_selection('ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',length) - end - - def self.rds_address(db_name,region) - "#{db_name}.#{Fog::Mock.random_letters(rand(12) + 4)}.#{region}.rds.amazonaws.com" - end - end - - def self.parse_security_group_options(group_name, options) - options ||= Hash.new - if group_name.is_a?(Hash) - options = group_name - elsif group_name - if options.key?('GroupName') - raise Fog::Compute::AWS::Error, 'Arguments specified both group_name and GroupName in options' - end - options = options.clone - options['GroupName'] = group_name - end - name_specified = options.key?('GroupName') && !options['GroupName'].nil? - group_id_specified = options.key?('GroupId') && !options['GroupId'].nil? - unless name_specified || group_id_specified - raise Fog::Compute::AWS::Error, 'Neither GroupName nor GroupId specified' - end - if name_specified && group_id_specified - options.delete('GroupName') - end - options - end - - module Errors - def self.match_error(error) - matcher = lambda {|s| s.match(/(?:.*(.*)<\/Code>)(?:.*(.*)<\/Message>)/m)} - [error.message, error.response.body].each(&Proc.new {|s| - match = matcher.call(s) - return {:code => match[1].split('.').last, :message => match[2]} if match - }) - {} # we did not match the message or response body - end - end - end -end diff --git a/lib/fog/aws/credential_fetcher.rb b/lib/fog/aws/credential_fetcher.rb index fe23625cf..3e5ffc290 100644 --- a/lib/fog/aws/credential_fetcher.rb +++ b/lib/fog/aws/credential_fetcher.rb @@ -1,5 +1,3 @@ -require "fog/json" - module Fog module AWS module CredentialFetcher diff --git a/lib/fog/aws/data_pipeline.rb b/lib/fog/aws/data_pipeline.rb index d898167b3..5490730f3 100644 --- a/lib/fog/aws/data_pipeline.rb +++ b/lib/fog/aws/data_pipeline.rb @@ -1,5 +1,3 @@ -require 'fog/aws/core' - module Fog module AWS class DataPipeline < Fog::Service diff --git a/lib/fog/aws/dns.rb b/lib/fog/aws/dns.rb index 8d5491572..a240bebab 100644 --- a/lib/fog/aws/dns.rb +++ b/lib/fog/aws/dns.rb @@ -1,5 +1,3 @@ -require 'fog/aws/core' - module Fog module DNS class AWS < Fog::Service diff --git a/lib/fog/aws/dynamodb.rb b/lib/fog/aws/dynamodb.rb index eb9ffd188..09c358834 100644 --- a/lib/fog/aws/dynamodb.rb +++ b/lib/fog/aws/dynamodb.rb @@ -1,5 +1,3 @@ -require 'fog/aws/core' - module Fog module AWS class DynamoDB < Fog::Service diff --git a/lib/fog/aws/elasticache.rb b/lib/fog/aws/elasticache.rb index c5f7cd085..abdd9e39e 100644 --- a/lib/fog/aws/elasticache.rb +++ b/lib/fog/aws/elasticache.rb @@ -1,5 +1,3 @@ -require 'fog/aws/core' - module Fog module AWS class Elasticache < Fog::Service diff --git a/lib/fog/aws/elb.rb b/lib/fog/aws/elb.rb index c46e4b07e..5ea5320fd 100644 --- a/lib/fog/aws/elb.rb +++ b/lib/fog/aws/elb.rb @@ -1,5 +1,3 @@ -require 'fog/aws/core' - module Fog module AWS class ELB < Fog::Service diff --git a/lib/fog/aws/emr.rb b/lib/fog/aws/emr.rb index f7916b61d..7227d1fca 100644 --- a/lib/fog/aws/emr.rb +++ b/lib/fog/aws/emr.rb @@ -1,5 +1,3 @@ -require 'fog/aws/core' - module Fog module AWS class EMR < Fog::Service diff --git a/lib/fog/aws/errors.rb b/lib/fog/aws/errors.rb new file mode 100644 index 000000000..24e3bafe4 --- /dev/null +++ b/lib/fog/aws/errors.rb @@ -0,0 +1,14 @@ +module Fog + module AWS + module Errors + def self.match_error(error) + matcher = lambda {|s| s.match(/(?:.*(.*)<\/Code>)(?:.*(.*)<\/Message>)/m)} + [error.message, error.response.body].each(&Proc.new {|s| + match = matcher.call(s) + return {:code => match[1].split('.').last, :message => match[2]} if match + }) + {} # we did not match the message or response body + end + end + end +end \ No newline at end of file diff --git a/lib/fog/aws/federation.rb b/lib/fog/aws/federation.rb index c720c8783..1c42fb22a 100644 --- a/lib/fog/aws/federation.rb +++ b/lib/fog/aws/federation.rb @@ -1,5 +1,3 @@ -require 'fog/aws/core' - module Fog module AWS class Federation < Fog::Service diff --git a/lib/fog/aws/glacier.rb b/lib/fog/aws/glacier.rb index c1ecb91df..6a4a290b8 100644 --- a/lib/fog/aws/glacier.rb +++ b/lib/fog/aws/glacier.rb @@ -1,5 +1,3 @@ -require 'fog/aws/core' - module Fog module AWS class Glacier < Fog::Service diff --git a/lib/fog/aws/iam.rb b/lib/fog/aws/iam.rb index 788ee40b7..4c6bc0176 100644 --- a/lib/fog/aws/iam.rb +++ b/lib/fog/aws/iam.rb @@ -1,5 +1,3 @@ -require 'fog/aws/core' - module Fog module AWS class IAM < Fog::Service diff --git a/lib/fog/aws/mock.rb b/lib/fog/aws/mock.rb new file mode 100644 index 000000000..9565d9ad6 --- /dev/null +++ b/lib/fog/aws/mock.rb @@ -0,0 +1,170 @@ +module Fog + module AWS + class Mock + def self.arn(vendor, account_id, path, region = nil) + "arn:aws:#{vendor}:#{region}:#{account_id}:#{path}" + end + + def self.availability_zone(region) + "#{region}#{Fog::Mock.random_selection('abcd', 1)}" + end + + def self.box_usage + sprintf("%0.10f", rand / 100).to_f + end + + def self.console_output + # "[ 0.000000] Linux version 2.6.18-xenU-ec2-v1.2 (root@domU-12-31-39-07-51-82) (gcc version 4.1.2 20070626 (Red Hat 4.1.2-13)) #2 SMP Wed Aug 19 09:04:38 EDT 2009" + Base64.decode64("WyAwLjAwMDAwMF0gTGludXggdmVyc2lvbiAyLjYuMTgteGVuVS1lYzItdjEu\nMiAocm9vdEBkb21VLTEyLTMxLTM5LTA3LTUxLTgyKSAoZ2NjIHZlcnNpb24g\nNC4xLjIgMjAwNzA2MjYgKFJlZCBIYXQgNC4xLjItMTMpKSAjMiBTTVAgV2Vk\nIEF1ZyAxOSAwOTowNDozOCBFRFQgMjAwOQ==\n") + end + + def self.dns_name_for(ip_address) + "ec2-#{ip_address.gsub('.','-')}.compute-1.amazonaws.com" + end + + def self.private_dns_name_for(ip_address) + "ip-#{ip_address.gsub('.','-')}.ec2.internal" + end + + def self.image + path = [] + (rand(3) + 2).times do + path << Fog::Mock.random_letters(rand(9) + 8) + end + { + "imageOwnerId" => Fog::Mock.random_letters(rand(5) + 4), + "blockDeviceMapping" => [], + "productCodes" => [], + "kernelId" => kernel_id, + "ramdiskId" => ramdisk_id, + "imageState" => "available", + "imageId" => image_id, + "architecture" => "i386", + "isPublic" => true, + "imageLocation" => path.join('/'), + "imageType" => "machine", + "rootDeviceType" => ["ebs","instance-store"][rand(2)], + "rootDeviceName" => "/dev/sda1" + } + end + + def self.image_id + "ami-#{Fog::Mock.random_hex(8)}" + end + + def self.key_fingerprint + fingerprint = [] + 20.times do + fingerprint << Fog::Mock.random_hex(2) + end + fingerprint.join(':') + end + + def self.instance_id + "i-#{Fog::Mock.random_hex(8)}" + end + + def self.ip_address + Fog::Mock.random_ip + end + + def self.private_ip_address + ip_address.gsub(/^\d{1,3}\./,"10.") + end + + def self.kernel_id + "aki-#{Fog::Mock.random_hex(8)}" + end + + def self.key_material + OpenSSL::PKey::RSA.generate(1024).to_s + end + + def self.owner_id + Fog::Mock.random_numbers(12) + end + + def self.ramdisk_id + "ari-#{Fog::Mock.random_hex(8)}" + end + + def self.request_id + request_id = [] + request_id << Fog::Mock.random_hex(8) + 3.times do + request_id << Fog::Mock.random_hex(4) + end + request_id << Fog::Mock.random_hex(12) + request_id.join('-') + end + + class << self + alias_method :reserved_instances_id, :request_id + alias_method :reserved_instances_offering_id, :request_id + alias_method :sqs_message_id, :request_id + alias_method :sqs_sender_id, :request_id + end + + def self.reservation_id + "r-#{Fog::Mock.random_hex(8)}" + end + + def self.snapshot_id + "snap-#{Fog::Mock.random_hex(8)}" + end + + def self.volume_id + "vol-#{Fog::Mock.random_hex(8)}" + end + + def self.security_group_id + "sg-#{Fog::Mock.random_hex(8)}" + end + + def self.network_acl_id + "acl-#{Fog::Mock.random_hex(8)}" + end + def self.network_acl_association_id + "aclassoc-#{Fog::Mock.random_hex(8)}" + end + def self.network_interface_id + "eni-#{Fog::Mock.random_hex(8)}" + end + def self.internet_gateway_id + "igw-#{Fog::Mock.random_hex(8)}" + end + def self.dhcp_options_id + "dopt-#{Fog::Mock.random_hex(8)}" + end + def self.vpc_id + "vpc-#{Fog::Mock.random_hex(8)}" + end + def self.subnet_id + "subnet-#{Fog::Mock.random_hex(8)}" + end + def self.zone_id + "zone-#{Fog::Mock.random_hex(8)}" + end + def self.change_id + Fog::Mock.random_letters_and_numbers(14) + end + def self.nameservers + [ + 'ns-2048.awsdns-64.com', + 'ns-2049.awsdns-65.net', + 'ns-2050.awsdns-66.org', + 'ns-2051.awsdns-67.co.uk' + ] + end + + def self.key_id(length=21) + #Probably close enough + Fog::Mock.random_selection('ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',length) + end + + def self.rds_address(db_name,region) + "#{db_name}.#{Fog::Mock.random_letters(rand(12) + 4)}.#{region}.rds.amazonaws.com" + end + end + end +end \ No newline at end of file diff --git a/lib/fog/aws/models/auto_scaling/activity.rb b/lib/fog/aws/models/auto_scaling/activity.rb index 032f4e6fb..bb31c62e9 100644 --- a/lib/fog/aws/models/auto_scaling/activity.rb +++ b/lib/fog/aws/models/auto_scaling/activity.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class AutoScaling diff --git a/lib/fog/aws/models/auto_scaling/configuration.rb b/lib/fog/aws/models/auto_scaling/configuration.rb index bd0548667..8ca8da523 100644 --- a/lib/fog/aws/models/auto_scaling/configuration.rb +++ b/lib/fog/aws/models/auto_scaling/configuration.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class AutoScaling diff --git a/lib/fog/aws/models/auto_scaling/group.rb b/lib/fog/aws/models/auto_scaling/group.rb index f19315cae..4054ad60c 100644 --- a/lib/fog/aws/models/auto_scaling/group.rb +++ b/lib/fog/aws/models/auto_scaling/group.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class AutoScaling diff --git a/lib/fog/aws/models/auto_scaling/instance.rb b/lib/fog/aws/models/auto_scaling/instance.rb index 8e05ac8eb..25d055e86 100644 --- a/lib/fog/aws/models/auto_scaling/instance.rb +++ b/lib/fog/aws/models/auto_scaling/instance.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class AutoScaling diff --git a/lib/fog/aws/models/auto_scaling/policy.rb b/lib/fog/aws/models/auto_scaling/policy.rb index 780eb71de..e620aa5ae 100644 --- a/lib/fog/aws/models/auto_scaling/policy.rb +++ b/lib/fog/aws/models/auto_scaling/policy.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class AutoScaling diff --git a/lib/fog/aws/models/beanstalk/application.rb b/lib/fog/aws/models/beanstalk/application.rb index a59db50a6..0d2778d26 100644 --- a/lib/fog/aws/models/beanstalk/application.rb +++ b/lib/fog/aws/models/beanstalk/application.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class ElasticBeanstalk diff --git a/lib/fog/aws/models/beanstalk/applications.rb b/lib/fog/aws/models/beanstalk/applications.rb index f37fe6a71..a4f0f95cc 100644 --- a/lib/fog/aws/models/beanstalk/applications.rb +++ b/lib/fog/aws/models/beanstalk/applications.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/beanstalk/application' module Fog diff --git a/lib/fog/aws/models/beanstalk/environment.rb b/lib/fog/aws/models/beanstalk/environment.rb index 786579916..fb1bd3768 100644 --- a/lib/fog/aws/models/beanstalk/environment.rb +++ b/lib/fog/aws/models/beanstalk/environment.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class ElasticBeanstalk diff --git a/lib/fog/aws/models/beanstalk/environments.rb b/lib/fog/aws/models/beanstalk/environments.rb index 9f3a3dcd2..fdefaf785 100644 --- a/lib/fog/aws/models/beanstalk/environments.rb +++ b/lib/fog/aws/models/beanstalk/environments.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/beanstalk/environment' module Fog diff --git a/lib/fog/aws/models/beanstalk/event.rb b/lib/fog/aws/models/beanstalk/event.rb index 9952d297b..aaa85dca9 100644 --- a/lib/fog/aws/models/beanstalk/event.rb +++ b/lib/fog/aws/models/beanstalk/event.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class ElasticBeanstalk diff --git a/lib/fog/aws/models/beanstalk/events.rb b/lib/fog/aws/models/beanstalk/events.rb index 0eb77eeef..0079c9293 100644 --- a/lib/fog/aws/models/beanstalk/events.rb +++ b/lib/fog/aws/models/beanstalk/events.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/beanstalk/event' module Fog diff --git a/lib/fog/aws/models/beanstalk/template.rb b/lib/fog/aws/models/beanstalk/template.rb index eee306b76..381334608 100644 --- a/lib/fog/aws/models/beanstalk/template.rb +++ b/lib/fog/aws/models/beanstalk/template.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class ElasticBeanstalk diff --git a/lib/fog/aws/models/beanstalk/templates.rb b/lib/fog/aws/models/beanstalk/templates.rb index b94e176b6..6d632d910 100644 --- a/lib/fog/aws/models/beanstalk/templates.rb +++ b/lib/fog/aws/models/beanstalk/templates.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/beanstalk/template' module Fog diff --git a/lib/fog/aws/models/beanstalk/version.rb b/lib/fog/aws/models/beanstalk/version.rb index 98c5708a8..b2b712ae1 100644 --- a/lib/fog/aws/models/beanstalk/version.rb +++ b/lib/fog/aws/models/beanstalk/version.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class ElasticBeanstalk diff --git a/lib/fog/aws/models/beanstalk/versions.rb b/lib/fog/aws/models/beanstalk/versions.rb index be56a0537..eb3ecfd70 100644 --- a/lib/fog/aws/models/beanstalk/versions.rb +++ b/lib/fog/aws/models/beanstalk/versions.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/beanstalk/version' module Fog diff --git a/lib/fog/aws/models/cdn/distribution.rb b/lib/fog/aws/models/cdn/distribution.rb index 1c99bfd3d..d7e568c5d 100644 --- a/lib/fog/aws/models/cdn/distribution.rb +++ b/lib/fog/aws/models/cdn/distribution.rb @@ -1,4 +1,3 @@ -require 'fog/core/model' require 'fog/aws/models/cdn/invalidations' require 'fog/aws/models/cdn/distribution_helper' diff --git a/lib/fog/aws/models/cdn/distribution_helper.rb b/lib/fog/aws/models/cdn/distribution_helper.rb index 5217da2a5..b815df099 100644 --- a/lib/fog/aws/models/cdn/distribution_helper.rb +++ b/lib/fog/aws/models/cdn/distribution_helper.rb @@ -1,5 +1,3 @@ -require 'fog/core/collection' - module Fog module CDN class AWS diff --git a/lib/fog/aws/models/cdn/distributions.rb b/lib/fog/aws/models/cdn/distributions.rb index 458a3b6ea..8346bc7e7 100644 --- a/lib/fog/aws/models/cdn/distributions.rb +++ b/lib/fog/aws/models/cdn/distributions.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/cdn/distribution' require 'fog/aws/models/cdn/distributions_helper' diff --git a/lib/fog/aws/models/cdn/distributions_helper.rb b/lib/fog/aws/models/cdn/distributions_helper.rb index 7895df0f9..4e497729c 100644 --- a/lib/fog/aws/models/cdn/distributions_helper.rb +++ b/lib/fog/aws/models/cdn/distributions_helper.rb @@ -1,5 +1,3 @@ -require 'fog/core/collection' - module Fog module CDN class AWS diff --git a/lib/fog/aws/models/cdn/invalidation.rb b/lib/fog/aws/models/cdn/invalidation.rb index 1b1d4d5ab..772774493 100644 --- a/lib/fog/aws/models/cdn/invalidation.rb +++ b/lib/fog/aws/models/cdn/invalidation.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module CDN class AWS diff --git a/lib/fog/aws/models/cdn/invalidations.rb b/lib/fog/aws/models/cdn/invalidations.rb index 2d9be24c7..2cc608d92 100644 --- a/lib/fog/aws/models/cdn/invalidations.rb +++ b/lib/fog/aws/models/cdn/invalidations.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/cdn/invalidation' module Fog diff --git a/lib/fog/aws/models/cdn/streaming_distribution.rb b/lib/fog/aws/models/cdn/streaming_distribution.rb index 15f4e0f7b..fed23271a 100644 --- a/lib/fog/aws/models/cdn/streaming_distribution.rb +++ b/lib/fog/aws/models/cdn/streaming_distribution.rb @@ -1,4 +1,3 @@ -require 'fog/core/model' require 'fog/aws/models/cdn/invalidations' require 'fog/aws/models/cdn/distribution_helper' diff --git a/lib/fog/aws/models/cdn/streaming_distributions.rb b/lib/fog/aws/models/cdn/streaming_distributions.rb index 1c2e27036..7e367f09a 100644 --- a/lib/fog/aws/models/cdn/streaming_distributions.rb +++ b/lib/fog/aws/models/cdn/streaming_distributions.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/cdn/streaming_distribution' require 'fog/aws/models/cdn/distributions_helper' diff --git a/lib/fog/aws/models/cloud_watch/alarm.rb b/lib/fog/aws/models/cloud_watch/alarm.rb index 60ce9bf4d..0f3192e69 100644 --- a/lib/fog/aws/models/cloud_watch/alarm.rb +++ b/lib/fog/aws/models/cloud_watch/alarm.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class CloudWatch diff --git a/lib/fog/aws/models/cloud_watch/alarm_data.rb b/lib/fog/aws/models/cloud_watch/alarm_data.rb index 772e6b36b..cc0ad8672 100644 --- a/lib/fog/aws/models/cloud_watch/alarm_data.rb +++ b/lib/fog/aws/models/cloud_watch/alarm_data.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/cloud_watch/alarm_datum' module Fog diff --git a/lib/fog/aws/models/cloud_watch/alarm_datum.rb b/lib/fog/aws/models/cloud_watch/alarm_datum.rb index ae20e81dc..88f2ef570 100644 --- a/lib/fog/aws/models/cloud_watch/alarm_datum.rb +++ b/lib/fog/aws/models/cloud_watch/alarm_datum.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class CloudWatch diff --git a/lib/fog/aws/models/cloud_watch/alarm_histories.rb b/lib/fog/aws/models/cloud_watch/alarm_histories.rb index 7a00d016a..0983b38db 100644 --- a/lib/fog/aws/models/cloud_watch/alarm_histories.rb +++ b/lib/fog/aws/models/cloud_watch/alarm_histories.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/cloud_watch/alarm_history' module Fog diff --git a/lib/fog/aws/models/cloud_watch/alarm_history.rb b/lib/fog/aws/models/cloud_watch/alarm_history.rb index 4c16db39c..a9f45cd90 100644 --- a/lib/fog/aws/models/cloud_watch/alarm_history.rb +++ b/lib/fog/aws/models/cloud_watch/alarm_history.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class CloudWatch diff --git a/lib/fog/aws/models/cloud_watch/alarms.rb b/lib/fog/aws/models/cloud_watch/alarms.rb index 47bb1629f..70ade0674 100644 --- a/lib/fog/aws/models/cloud_watch/alarms.rb +++ b/lib/fog/aws/models/cloud_watch/alarms.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/cloud_watch/alarm' module Fog diff --git a/lib/fog/aws/models/cloud_watch/metric.rb b/lib/fog/aws/models/cloud_watch/metric.rb index f923e674d..df064b08d 100644 --- a/lib/fog/aws/models/cloud_watch/metric.rb +++ b/lib/fog/aws/models/cloud_watch/metric.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class CloudWatch diff --git a/lib/fog/aws/models/cloud_watch/metric_statistic.rb b/lib/fog/aws/models/cloud_watch/metric_statistic.rb index eddd6d7ca..95d046246 100644 --- a/lib/fog/aws/models/cloud_watch/metric_statistic.rb +++ b/lib/fog/aws/models/cloud_watch/metric_statistic.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class CloudWatch diff --git a/lib/fog/aws/models/cloud_watch/metric_statistics.rb b/lib/fog/aws/models/cloud_watch/metric_statistics.rb index 76fe47776..51104cd1d 100644 --- a/lib/fog/aws/models/cloud_watch/metric_statistics.rb +++ b/lib/fog/aws/models/cloud_watch/metric_statistics.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/cloud_watch/metric_statistic' module Fog diff --git a/lib/fog/aws/models/cloud_watch/metrics.rb b/lib/fog/aws/models/cloud_watch/metrics.rb index 0c0e6275a..1daeb8e2a 100644 --- a/lib/fog/aws/models/cloud_watch/metrics.rb +++ b/lib/fog/aws/models/cloud_watch/metrics.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/cloud_watch/metric' module Fog diff --git a/lib/fog/aws/models/compute/address.rb b/lib/fog/aws/models/compute/address.rb index c35b87245..af8381418 100644 --- a/lib/fog/aws/models/compute/address.rb +++ b/lib/fog/aws/models/compute/address.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module Compute class AWS diff --git a/lib/fog/aws/models/compute/addresses.rb b/lib/fog/aws/models/compute/addresses.rb index 7447cbd80..6e50c8691 100644 --- a/lib/fog/aws/models/compute/addresses.rb +++ b/lib/fog/aws/models/compute/addresses.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/compute/address' module Fog diff --git a/lib/fog/aws/models/compute/dhcp_option.rb b/lib/fog/aws/models/compute/dhcp_option.rb index fb5e39b76..35cb81480 100644 --- a/lib/fog/aws/models/compute/dhcp_option.rb +++ b/lib/fog/aws/models/compute/dhcp_option.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module Compute class AWS diff --git a/lib/fog/aws/models/compute/dhcp_options.rb b/lib/fog/aws/models/compute/dhcp_options.rb index 9690f1c51..f41ba8964 100644 --- a/lib/fog/aws/models/compute/dhcp_options.rb +++ b/lib/fog/aws/models/compute/dhcp_options.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/compute/dhcp_option' module Fog diff --git a/lib/fog/aws/models/compute/flavor.rb b/lib/fog/aws/models/compute/flavor.rb index e305e18fe..4754efb7b 100644 --- a/lib/fog/aws/models/compute/flavor.rb +++ b/lib/fog/aws/models/compute/flavor.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module Compute class AWS diff --git a/lib/fog/aws/models/compute/flavors.rb b/lib/fog/aws/models/compute/flavors.rb index bbc10da66..aa8414220 100644 --- a/lib/fog/aws/models/compute/flavors.rb +++ b/lib/fog/aws/models/compute/flavors.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/compute/flavor' module Fog diff --git a/lib/fog/aws/models/compute/image.rb b/lib/fog/aws/models/compute/image.rb index 7255644c2..1f73db95d 100644 --- a/lib/fog/aws/models/compute/image.rb +++ b/lib/fog/aws/models/compute/image.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module Compute class AWS diff --git a/lib/fog/aws/models/compute/images.rb b/lib/fog/aws/models/compute/images.rb index c2453608d..915af9f75 100644 --- a/lib/fog/aws/models/compute/images.rb +++ b/lib/fog/aws/models/compute/images.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/compute/image' module Fog diff --git a/lib/fog/aws/models/compute/internet_gateway.rb b/lib/fog/aws/models/compute/internet_gateway.rb index 0c923d320..6c0ebacc2 100644 --- a/lib/fog/aws/models/compute/internet_gateway.rb +++ b/lib/fog/aws/models/compute/internet_gateway.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module Compute class AWS diff --git a/lib/fog/aws/models/compute/internet_gateways.rb b/lib/fog/aws/models/compute/internet_gateways.rb index 073d5cad5..551db5882 100644 --- a/lib/fog/aws/models/compute/internet_gateways.rb +++ b/lib/fog/aws/models/compute/internet_gateways.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/compute/internet_gateway' module Fog diff --git a/lib/fog/aws/models/compute/key_pair.rb b/lib/fog/aws/models/compute/key_pair.rb index 1ba3d6e13..e42cc900e 100644 --- a/lib/fog/aws/models/compute/key_pair.rb +++ b/lib/fog/aws/models/compute/key_pair.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module Compute class AWS diff --git a/lib/fog/aws/models/compute/key_pairs.rb b/lib/fog/aws/models/compute/key_pairs.rb index 8abec12d6..6bc3091ac 100644 --- a/lib/fog/aws/models/compute/key_pairs.rb +++ b/lib/fog/aws/models/compute/key_pairs.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/compute/key_pair' module Fog diff --git a/lib/fog/aws/models/compute/network_acl.rb b/lib/fog/aws/models/compute/network_acl.rb index afe12f6fe..32a0206db 100644 --- a/lib/fog/aws/models/compute/network_acl.rb +++ b/lib/fog/aws/models/compute/network_acl.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module Compute class AWS diff --git a/lib/fog/aws/models/compute/network_acls.rb b/lib/fog/aws/models/compute/network_acls.rb index 4abbf543f..5ad8ef6bf 100644 --- a/lib/fog/aws/models/compute/network_acls.rb +++ b/lib/fog/aws/models/compute/network_acls.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/compute/network_acl' module Fog diff --git a/lib/fog/aws/models/compute/network_interface.rb b/lib/fog/aws/models/compute/network_interface.rb index 098a6aaa4..342186a3c 100644 --- a/lib/fog/aws/models/compute/network_interface.rb +++ b/lib/fog/aws/models/compute/network_interface.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module Compute class AWS diff --git a/lib/fog/aws/models/compute/network_interfaces.rb b/lib/fog/aws/models/compute/network_interfaces.rb index 80ead12b4..c624eed87 100644 --- a/lib/fog/aws/models/compute/network_interfaces.rb +++ b/lib/fog/aws/models/compute/network_interfaces.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/compute/network_interface' module Fog diff --git a/lib/fog/aws/models/compute/route_table.rb b/lib/fog/aws/models/compute/route_table.rb index 0d48e14a0..cd1f705a0 100644 --- a/lib/fog/aws/models/compute/route_table.rb +++ b/lib/fog/aws/models/compute/route_table.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module Compute class AWS diff --git a/lib/fog/aws/models/compute/route_tables.rb b/lib/fog/aws/models/compute/route_tables.rb index 7e3d2c005..e7e3c9552 100644 --- a/lib/fog/aws/models/compute/route_tables.rb +++ b/lib/fog/aws/models/compute/route_tables.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/compute/route_table' module Fog diff --git a/lib/fog/aws/models/compute/security_group.rb b/lib/fog/aws/models/compute/security_group.rb index 900de0868..b2af636e8 100644 --- a/lib/fog/aws/models/compute/security_group.rb +++ b/lib/fog/aws/models/compute/security_group.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module Compute class AWS diff --git a/lib/fog/aws/models/compute/security_groups.rb b/lib/fog/aws/models/compute/security_groups.rb index 0f92c0ec9..296dffd29 100644 --- a/lib/fog/aws/models/compute/security_groups.rb +++ b/lib/fog/aws/models/compute/security_groups.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/compute/security_group' module Fog diff --git a/lib/fog/aws/models/compute/servers.rb b/lib/fog/aws/models/compute/servers.rb index 731f39516..330bfbe03 100644 --- a/lib/fog/aws/models/compute/servers.rb +++ b/lib/fog/aws/models/compute/servers.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/compute/server' module Fog diff --git a/lib/fog/aws/models/compute/snapshot.rb b/lib/fog/aws/models/compute/snapshot.rb index 7b512f1e8..7de36ba40 100644 --- a/lib/fog/aws/models/compute/snapshot.rb +++ b/lib/fog/aws/models/compute/snapshot.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module Compute class AWS diff --git a/lib/fog/aws/models/compute/snapshots.rb b/lib/fog/aws/models/compute/snapshots.rb index 9a131ae84..1305ce7e6 100644 --- a/lib/fog/aws/models/compute/snapshots.rb +++ b/lib/fog/aws/models/compute/snapshots.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/compute/snapshot' module Fog diff --git a/lib/fog/aws/models/compute/spot_requests.rb b/lib/fog/aws/models/compute/spot_requests.rb index 21fe0a16e..5aac83553 100644 --- a/lib/fog/aws/models/compute/spot_requests.rb +++ b/lib/fog/aws/models/compute/spot_requests.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/compute/spot_request' module Fog diff --git a/lib/fog/aws/models/compute/subnet.rb b/lib/fog/aws/models/compute/subnet.rb index d515fab25..7dae6c3f6 100644 --- a/lib/fog/aws/models/compute/subnet.rb +++ b/lib/fog/aws/models/compute/subnet.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module Compute class AWS diff --git a/lib/fog/aws/models/compute/subnets.rb b/lib/fog/aws/models/compute/subnets.rb index 80f2e35f9..10e9e2cde 100644 --- a/lib/fog/aws/models/compute/subnets.rb +++ b/lib/fog/aws/models/compute/subnets.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/compute/subnet' module Fog diff --git a/lib/fog/aws/models/compute/tag.rb b/lib/fog/aws/models/compute/tag.rb index e9eae788b..b0bdfaf84 100644 --- a/lib/fog/aws/models/compute/tag.rb +++ b/lib/fog/aws/models/compute/tag.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module Compute class AWS diff --git a/lib/fog/aws/models/compute/tags.rb b/lib/fog/aws/models/compute/tags.rb index 1f982741b..07dbc7a16 100644 --- a/lib/fog/aws/models/compute/tags.rb +++ b/lib/fog/aws/models/compute/tags.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/compute/tag' module Fog diff --git a/lib/fog/aws/models/compute/volume.rb b/lib/fog/aws/models/compute/volume.rb index 5b587377f..b139ff18e 100644 --- a/lib/fog/aws/models/compute/volume.rb +++ b/lib/fog/aws/models/compute/volume.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module Compute class AWS diff --git a/lib/fog/aws/models/compute/volumes.rb b/lib/fog/aws/models/compute/volumes.rb index 73c990a97..145eabdf6 100644 --- a/lib/fog/aws/models/compute/volumes.rb +++ b/lib/fog/aws/models/compute/volumes.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/compute/volume' module Fog diff --git a/lib/fog/aws/models/compute/vpc.rb b/lib/fog/aws/models/compute/vpc.rb index ebf2350cb..95772508f 100644 --- a/lib/fog/aws/models/compute/vpc.rb +++ b/lib/fog/aws/models/compute/vpc.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module Compute class AWS diff --git a/lib/fog/aws/models/compute/vpcs.rb b/lib/fog/aws/models/compute/vpcs.rb index 625fcf37c..e06786e65 100644 --- a/lib/fog/aws/models/compute/vpcs.rb +++ b/lib/fog/aws/models/compute/vpcs.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/compute/vpc' module Fog diff --git a/lib/fog/aws/models/data_pipeline/pipeline.rb b/lib/fog/aws/models/data_pipeline/pipeline.rb index 54f516db0..d20beb55d 100644 --- a/lib/fog/aws/models/data_pipeline/pipeline.rb +++ b/lib/fog/aws/models/data_pipeline/pipeline.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class DataPipeline diff --git a/lib/fog/aws/models/data_pipeline/pipelines.rb b/lib/fog/aws/models/data_pipeline/pipelines.rb index 5ef0420db..3669ec6c1 100644 --- a/lib/fog/aws/models/data_pipeline/pipelines.rb +++ b/lib/fog/aws/models/data_pipeline/pipelines.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/data_pipeline/pipeline' module Fog diff --git a/lib/fog/aws/models/dns/record.rb b/lib/fog/aws/models/dns/record.rb index f1ee6b534..2aee4fb16 100644 --- a/lib/fog/aws/models/dns/record.rb +++ b/lib/fog/aws/models/dns/record.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module DNS class AWS diff --git a/lib/fog/aws/models/dns/records.rb b/lib/fog/aws/models/dns/records.rb index 945f5536d..1aa9ed887 100644 --- a/lib/fog/aws/models/dns/records.rb +++ b/lib/fog/aws/models/dns/records.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/dns/record' module Fog diff --git a/lib/fog/aws/models/dns/zone.rb b/lib/fog/aws/models/dns/zone.rb index aee0edefd..491ba9fc1 100644 --- a/lib/fog/aws/models/dns/zone.rb +++ b/lib/fog/aws/models/dns/zone.rb @@ -1,4 +1,3 @@ -require 'fog/core/model' # require 'fog/aws/models/dns/records' module Fog diff --git a/lib/fog/aws/models/dns/zones.rb b/lib/fog/aws/models/dns/zones.rb index b3a8c4203..69568d13a 100644 --- a/lib/fog/aws/models/dns/zones.rb +++ b/lib/fog/aws/models/dns/zones.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/dns/zone' module Fog diff --git a/lib/fog/aws/models/elasticache/cluster.rb b/lib/fog/aws/models/elasticache/cluster.rb index 37254e636..0b3a4082d 100644 --- a/lib/fog/aws/models/elasticache/cluster.rb +++ b/lib/fog/aws/models/elasticache/cluster.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class Elasticache diff --git a/lib/fog/aws/models/elasticache/clusters.rb b/lib/fog/aws/models/elasticache/clusters.rb index 41f8dcd7c..e8b536c4f 100644 --- a/lib/fog/aws/models/elasticache/clusters.rb +++ b/lib/fog/aws/models/elasticache/clusters.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/elasticache/cluster' module Fog diff --git a/lib/fog/aws/models/elasticache/parameter_group.rb b/lib/fog/aws/models/elasticache/parameter_group.rb index 2d31c0130..256193b81 100644 --- a/lib/fog/aws/models/elasticache/parameter_group.rb +++ b/lib/fog/aws/models/elasticache/parameter_group.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class Elasticache diff --git a/lib/fog/aws/models/elasticache/parameter_groups.rb b/lib/fog/aws/models/elasticache/parameter_groups.rb index caa8c1f98..76249197f 100644 --- a/lib/fog/aws/models/elasticache/parameter_groups.rb +++ b/lib/fog/aws/models/elasticache/parameter_groups.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/elasticache/parameter_group' module Fog diff --git a/lib/fog/aws/models/elasticache/security_group.rb b/lib/fog/aws/models/elasticache/security_group.rb index 45623b8b4..d67b661b5 100644 --- a/lib/fog/aws/models/elasticache/security_group.rb +++ b/lib/fog/aws/models/elasticache/security_group.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class Elasticache diff --git a/lib/fog/aws/models/elasticache/security_groups.rb b/lib/fog/aws/models/elasticache/security_groups.rb index e2d81f10b..311dbeea6 100644 --- a/lib/fog/aws/models/elasticache/security_groups.rb +++ b/lib/fog/aws/models/elasticache/security_groups.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/elasticache/security_group' module Fog diff --git a/lib/fog/aws/models/elasticache/subnet_group.rb b/lib/fog/aws/models/elasticache/subnet_group.rb index 589a31f40..bb9d68c15 100644 --- a/lib/fog/aws/models/elasticache/subnet_group.rb +++ b/lib/fog/aws/models/elasticache/subnet_group.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class Elasticache diff --git a/lib/fog/aws/models/elasticache/subnet_groups.rb b/lib/fog/aws/models/elasticache/subnet_groups.rb index e457a0f07..64818aae9 100644 --- a/lib/fog/aws/models/elasticache/subnet_groups.rb +++ b/lib/fog/aws/models/elasticache/subnet_groups.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/elasticache/subnet_group' module Fog diff --git a/lib/fog/aws/models/elb/backend_server_description.rb b/lib/fog/aws/models/elb/backend_server_description.rb index f7daebf95..78a5e7def 100644 --- a/lib/fog/aws/models/elb/backend_server_description.rb +++ b/lib/fog/aws/models/elb/backend_server_description.rb @@ -1,4 +1,3 @@ -require 'fog/core/model' module Fog module AWS class ELB diff --git a/lib/fog/aws/models/elb/listener.rb b/lib/fog/aws/models/elb/listener.rb index d99950989..6de8aa464 100644 --- a/lib/fog/aws/models/elb/listener.rb +++ b/lib/fog/aws/models/elb/listener.rb @@ -1,4 +1,3 @@ -require 'fog/core/model' module Fog module AWS class ELB diff --git a/lib/fog/aws/models/elb/load_balancer.rb b/lib/fog/aws/models/elb/load_balancer.rb index 81885d2f2..61c36d779 100644 --- a/lib/fog/aws/models/elb/load_balancer.rb +++ b/lib/fog/aws/models/elb/load_balancer.rb @@ -1,4 +1,3 @@ -require 'fog/core/model' module Fog module AWS class ELB diff --git a/lib/fog/aws/models/elb/policy.rb b/lib/fog/aws/models/elb/policy.rb index 5a289dc1d..fd6251a91 100644 --- a/lib/fog/aws/models/elb/policy.rb +++ b/lib/fog/aws/models/elb/policy.rb @@ -1,4 +1,3 @@ -require 'fog/core/model' module Fog module AWS class ELB diff --git a/lib/fog/aws/models/glacier/archive.rb b/lib/fog/aws/models/glacier/archive.rb index c8c0b7ab3..b6ad11a09 100644 --- a/lib/fog/aws/models/glacier/archive.rb +++ b/lib/fog/aws/models/glacier/archive.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class Glacier diff --git a/lib/fog/aws/models/glacier/archives.rb b/lib/fog/aws/models/glacier/archives.rb index 59c058ee9..1592d750a 100644 --- a/lib/fog/aws/models/glacier/archives.rb +++ b/lib/fog/aws/models/glacier/archives.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/glacier/archive' module Fog diff --git a/lib/fog/aws/models/glacier/job.rb b/lib/fog/aws/models/glacier/job.rb index 54caa5118..d99b4416e 100644 --- a/lib/fog/aws/models/glacier/job.rb +++ b/lib/fog/aws/models/glacier/job.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class Glacier diff --git a/lib/fog/aws/models/glacier/jobs.rb b/lib/fog/aws/models/glacier/jobs.rb index 724b8a3d3..d5e1e1a9e 100644 --- a/lib/fog/aws/models/glacier/jobs.rb +++ b/lib/fog/aws/models/glacier/jobs.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/glacier/job' module Fog diff --git a/lib/fog/aws/models/glacier/vault.rb b/lib/fog/aws/models/glacier/vault.rb index 120966885..35d5549c2 100644 --- a/lib/fog/aws/models/glacier/vault.rb +++ b/lib/fog/aws/models/glacier/vault.rb @@ -1,4 +1,3 @@ -require 'fog/core/model' require 'fog/aws/models/glacier/archives' require 'fog/aws/models/glacier/jobs' diff --git a/lib/fog/aws/models/glacier/vaults.rb b/lib/fog/aws/models/glacier/vaults.rb index de7629b9a..2e90adce3 100644 --- a/lib/fog/aws/models/glacier/vaults.rb +++ b/lib/fog/aws/models/glacier/vaults.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/glacier/vault' module Fog diff --git a/lib/fog/aws/models/iam/access_key.rb b/lib/fog/aws/models/iam/access_key.rb index d3928eff2..7075673dd 100644 --- a/lib/fog/aws/models/iam/access_key.rb +++ b/lib/fog/aws/models/iam/access_key.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class IAM diff --git a/lib/fog/aws/models/iam/access_keys.rb b/lib/fog/aws/models/iam/access_keys.rb index 8031f0889..2a834b9b6 100644 --- a/lib/fog/aws/models/iam/access_keys.rb +++ b/lib/fog/aws/models/iam/access_keys.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/iam/access_key' module Fog diff --git a/lib/fog/aws/models/iam/policies.rb b/lib/fog/aws/models/iam/policies.rb index 8c80e7e06..5a1c89d04 100644 --- a/lib/fog/aws/models/iam/policies.rb +++ b/lib/fog/aws/models/iam/policies.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/iam/policy' module Fog diff --git a/lib/fog/aws/models/iam/policy.rb b/lib/fog/aws/models/iam/policy.rb index 652b691bf..9db765847 100644 --- a/lib/fog/aws/models/iam/policy.rb +++ b/lib/fog/aws/models/iam/policy.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class IAM diff --git a/lib/fog/aws/models/iam/role.rb b/lib/fog/aws/models/iam/role.rb index 9efb2c135..37387b6c6 100644 --- a/lib/fog/aws/models/iam/role.rb +++ b/lib/fog/aws/models/iam/role.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class IAM diff --git a/lib/fog/aws/models/iam/roles.rb b/lib/fog/aws/models/iam/roles.rb index c3f567746..2ae6ede00 100644 --- a/lib/fog/aws/models/iam/roles.rb +++ b/lib/fog/aws/models/iam/roles.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/iam/role' module Fog diff --git a/lib/fog/aws/models/iam/user.rb b/lib/fog/aws/models/iam/user.rb index 04695abdf..470a5e33e 100644 --- a/lib/fog/aws/models/iam/user.rb +++ b/lib/fog/aws/models/iam/user.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class IAM diff --git a/lib/fog/aws/models/iam/users.rb b/lib/fog/aws/models/iam/users.rb index cfbc625ad..93d295d74 100644 --- a/lib/fog/aws/models/iam/users.rb +++ b/lib/fog/aws/models/iam/users.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/iam/user' module Fog diff --git a/lib/fog/aws/models/rds/event_subscription.rb b/lib/fog/aws/models/rds/event_subscription.rb index b0dd87ee4..4a2f3cb45 100644 --- a/lib/fog/aws/models/rds/event_subscription.rb +++ b/lib/fog/aws/models/rds/event_subscription.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class RDS diff --git a/lib/fog/aws/models/rds/event_subscriptions.rb b/lib/fog/aws/models/rds/event_subscriptions.rb index 130d5a5ab..f8da353f7 100644 --- a/lib/fog/aws/models/rds/event_subscriptions.rb +++ b/lib/fog/aws/models/rds/event_subscriptions.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/rds/event_subscription' module Fog diff --git a/lib/fog/aws/models/rds/instance_option.rb b/lib/fog/aws/models/rds/instance_option.rb index e38abde52..2ff6f3c7b 100644 --- a/lib/fog/aws/models/rds/instance_option.rb +++ b/lib/fog/aws/models/rds/instance_option.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class RDS diff --git a/lib/fog/aws/models/rds/instance_options.rb b/lib/fog/aws/models/rds/instance_options.rb index 1e6c3d4d2..8c00ecfc9 100644 --- a/lib/fog/aws/models/rds/instance_options.rb +++ b/lib/fog/aws/models/rds/instance_options.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/rds/instance_option' module Fog diff --git a/lib/fog/aws/models/rds/log_file.rb b/lib/fog/aws/models/rds/log_file.rb index 58a66ec54..811fe95a9 100644 --- a/lib/fog/aws/models/rds/log_file.rb +++ b/lib/fog/aws/models/rds/log_file.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class RDS diff --git a/lib/fog/aws/models/rds/log_files.rb b/lib/fog/aws/models/rds/log_files.rb index 9e94f0e53..f013c5ae8 100644 --- a/lib/fog/aws/models/rds/log_files.rb +++ b/lib/fog/aws/models/rds/log_files.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/rds/log_file' module Fog diff --git a/lib/fog/aws/models/rds/parameter.rb b/lib/fog/aws/models/rds/parameter.rb index 23b539fbd..103a8309b 100644 --- a/lib/fog/aws/models/rds/parameter.rb +++ b/lib/fog/aws/models/rds/parameter.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class RDS diff --git a/lib/fog/aws/models/rds/parameter_group.rb b/lib/fog/aws/models/rds/parameter_group.rb index cbceb938b..290f4eef4 100644 --- a/lib/fog/aws/models/rds/parameter_group.rb +++ b/lib/fog/aws/models/rds/parameter_group.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class RDS diff --git a/lib/fog/aws/models/rds/parameter_groups.rb b/lib/fog/aws/models/rds/parameter_groups.rb index 8e74d9d3f..d74e15a3a 100644 --- a/lib/fog/aws/models/rds/parameter_groups.rb +++ b/lib/fog/aws/models/rds/parameter_groups.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/rds/parameter_group' module Fog diff --git a/lib/fog/aws/models/rds/parameters.rb b/lib/fog/aws/models/rds/parameters.rb index bded209e0..ca88a9a02 100644 --- a/lib/fog/aws/models/rds/parameters.rb +++ b/lib/fog/aws/models/rds/parameters.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/rds/parameter' module Fog diff --git a/lib/fog/aws/models/rds/security_group.rb b/lib/fog/aws/models/rds/security_group.rb index 4ab35b06e..5960177be 100644 --- a/lib/fog/aws/models/rds/security_group.rb +++ b/lib/fog/aws/models/rds/security_group.rb @@ -1,6 +1,3 @@ -require 'fog/core/model' -require 'fog/core/current_machine' - module Fog module AWS class RDS diff --git a/lib/fog/aws/models/rds/security_groups.rb b/lib/fog/aws/models/rds/security_groups.rb index 13e74e22c..87e8c8483 100644 --- a/lib/fog/aws/models/rds/security_groups.rb +++ b/lib/fog/aws/models/rds/security_groups.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/rds/security_group' module Fog diff --git a/lib/fog/aws/models/rds/server.rb b/lib/fog/aws/models/rds/server.rb index 1269e3e2e..0befed478 100644 --- a/lib/fog/aws/models/rds/server.rb +++ b/lib/fog/aws/models/rds/server.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class RDS diff --git a/lib/fog/aws/models/rds/servers.rb b/lib/fog/aws/models/rds/servers.rb index d2925dd35..0f6f62dba 100644 --- a/lib/fog/aws/models/rds/servers.rb +++ b/lib/fog/aws/models/rds/servers.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/rds/server' module Fog diff --git a/lib/fog/aws/models/rds/snapshot.rb b/lib/fog/aws/models/rds/snapshot.rb index 0b809a76d..b179a010e 100644 --- a/lib/fog/aws/models/rds/snapshot.rb +++ b/lib/fog/aws/models/rds/snapshot.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class RDS diff --git a/lib/fog/aws/models/rds/snapshots.rb b/lib/fog/aws/models/rds/snapshots.rb index d059d06de..edf4dd70b 100644 --- a/lib/fog/aws/models/rds/snapshots.rb +++ b/lib/fog/aws/models/rds/snapshots.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/rds/snapshot' module Fog diff --git a/lib/fog/aws/models/rds/subnet_group.rb b/lib/fog/aws/models/rds/subnet_group.rb index 37735f386..5b39b5768 100644 --- a/lib/fog/aws/models/rds/subnet_group.rb +++ b/lib/fog/aws/models/rds/subnet_group.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class RDS diff --git a/lib/fog/aws/models/rds/subnet_groups.rb b/lib/fog/aws/models/rds/subnet_groups.rb index b1c76e1f0..1cd3695b0 100644 --- a/lib/fog/aws/models/rds/subnet_groups.rb +++ b/lib/fog/aws/models/rds/subnet_groups.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/rds/subnet_group' module Fog diff --git a/lib/fog/aws/models/sns/subscriptions.rb b/lib/fog/aws/models/sns/subscriptions.rb index 249ce327e..b6ead2fbf 100644 --- a/lib/fog/aws/models/sns/subscriptions.rb +++ b/lib/fog/aws/models/sns/subscriptions.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/sns/subscription' module Fog diff --git a/lib/fog/aws/models/sns/topic.rb b/lib/fog/aws/models/sns/topic.rb index d18d85293..7d0197de2 100644 --- a/lib/fog/aws/models/sns/topic.rb +++ b/lib/fog/aws/models/sns/topic.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module AWS class SNS diff --git a/lib/fog/aws/models/sns/topics.rb b/lib/fog/aws/models/sns/topics.rb index 82d2f3f14..bc87fe01c 100644 --- a/lib/fog/aws/models/sns/topics.rb +++ b/lib/fog/aws/models/sns/topics.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/sns/topic' module Fog diff --git a/lib/fog/aws/models/storage/directories.rb b/lib/fog/aws/models/storage/directories.rb index cf1c0f0aa..83617f67d 100644 --- a/lib/fog/aws/models/storage/directories.rb +++ b/lib/fog/aws/models/storage/directories.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/storage/directory' module Fog diff --git a/lib/fog/aws/models/storage/directory.rb b/lib/fog/aws/models/storage/directory.rb index 814902a68..3ac4bdf2f 100644 --- a/lib/fog/aws/models/storage/directory.rb +++ b/lib/fog/aws/models/storage/directory.rb @@ -1,4 +1,3 @@ -require 'fog/core/model' require 'fog/aws/models/storage/files' require 'fog/aws/models/storage/versions' diff --git a/lib/fog/aws/models/storage/file.rb b/lib/fog/aws/models/storage/file.rb index e1723c6fd..70cbb28cd 100644 --- a/lib/fog/aws/models/storage/file.rb +++ b/lib/fog/aws/models/storage/file.rb @@ -1,4 +1,3 @@ -require 'fog/core/model' require 'fog/aws/models/storage/versions' module Fog diff --git a/lib/fog/aws/models/storage/files.rb b/lib/fog/aws/models/storage/files.rb index a7c2fc26e..45d687ea4 100644 --- a/lib/fog/aws/models/storage/files.rb +++ b/lib/fog/aws/models/storage/files.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/storage/file' module Fog diff --git a/lib/fog/aws/models/storage/version.rb b/lib/fog/aws/models/storage/version.rb index 9186394ff..88a2b7b79 100644 --- a/lib/fog/aws/models/storage/version.rb +++ b/lib/fog/aws/models/storage/version.rb @@ -1,5 +1,3 @@ -require 'fog/core/model' - module Fog module Storage class AWS diff --git a/lib/fog/aws/models/storage/versions.rb b/lib/fog/aws/models/storage/versions.rb index 2a400d8c2..01e0c2c78 100644 --- a/lib/fog/aws/models/storage/versions.rb +++ b/lib/fog/aws/models/storage/versions.rb @@ -1,4 +1,3 @@ -require 'fog/core/collection' require 'fog/aws/models/storage/version' module Fog diff --git a/lib/fog/aws/rds.rb b/lib/fog/aws/rds.rb index 4a3abeda8..18630a546 100644 --- a/lib/fog/aws/rds.rb +++ b/lib/fog/aws/rds.rb @@ -1,5 +1,3 @@ -require 'fog/aws/core' - module Fog module AWS class RDS < Fog::Service diff --git a/lib/fog/aws/redshift.rb b/lib/fog/aws/redshift.rb index 791426031..73a9a8bad 100644 --- a/lib/fog/aws/redshift.rb +++ b/lib/fog/aws/redshift.rb @@ -1,5 +1,3 @@ -require 'fog/aws/core' - module Fog module AWS class Redshift < Fog::Service diff --git a/lib/fog/aws/ses.rb b/lib/fog/aws/ses.rb index 7fd34f27f..7b833fde8 100644 --- a/lib/fog/aws/ses.rb +++ b/lib/fog/aws/ses.rb @@ -1,5 +1,3 @@ -require 'fog/aws/core' - module Fog module AWS class SES < Fog::Service diff --git a/lib/fog/aws/signaturev4.rb b/lib/fog/aws/signaturev4.rb index aa71e0220..f516bf3ae 100644 --- a/lib/fog/aws/signaturev4.rb +++ b/lib/fog/aws/signaturev4.rb @@ -1,10 +1,10 @@ -require 'fog/aws/core' - # See http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html + module Fog module AWS class SignatureV4 ALGORITHM = 'AWS4-HMAC-SHA256' + def initialize(aws_access_key_id, secret_key, region, service) @region = region @service = service @@ -115,7 +115,6 @@ DATA def signed_headers(headers) headers.keys.map {|key| key.to_s.downcase}.sort.join(';') end - end end end diff --git a/lib/fog/aws/simpledb.rb b/lib/fog/aws/simpledb.rb index fa13597dd..f69581255 100644 --- a/lib/fog/aws/simpledb.rb +++ b/lib/fog/aws/simpledb.rb @@ -1,5 +1,3 @@ -require 'fog/aws/core' - module Fog module AWS class SimpleDB < Fog::Service diff --git a/lib/fog/aws/sns.rb b/lib/fog/aws/sns.rb index e112c9295..dee901405 100644 --- a/lib/fog/aws/sns.rb +++ b/lib/fog/aws/sns.rb @@ -1,5 +1,3 @@ -require 'fog/aws/core' - module Fog module AWS class SNS < Fog::Service diff --git a/lib/fog/aws/sqs.rb b/lib/fog/aws/sqs.rb index 508f2118b..7c02c8876 100644 --- a/lib/fog/aws/sqs.rb +++ b/lib/fog/aws/sqs.rb @@ -1,5 +1,3 @@ -require 'fog/aws/core' - module Fog module AWS class SQS < Fog::Service diff --git a/lib/fog/aws/storage.rb b/lib/fog/aws/storage.rb index 8094d6274..db69c6170 100644 --- a/lib/fog/aws/storage.rb +++ b/lib/fog/aws/storage.rb @@ -1,5 +1,3 @@ -require 'fog/aws/core' - module Fog module Storage class AWS < Fog::Service diff --git a/lib/fog/aws/sts.rb b/lib/fog/aws/sts.rb index 43e931dc1..f2f309aee 100644 --- a/lib/fog/aws/sts.rb +++ b/lib/fog/aws/sts.rb @@ -1,5 +1,3 @@ -require 'fog/aws/core' - module Fog module AWS class STS < Fog::Service