diff --git a/lib/fog/aws/cdn.rb b/lib/fog/aws/cdn.rb index f07ce3308..a1b4211dc 100644 --- a/lib/fog/aws/cdn.rb +++ b/lib/fog/aws/cdn.rb @@ -2,8 +2,8 @@ module Fog module AWS class CDN < Fog::Service - requires :aws_access_key_id, :aws_secret_access_key - recognizes :host, :path, :port, :scheme, :version, :persistent + requires :aws_access_key_id, :aws_secret_access_key, &inject_parameter_specs + recognizes :host, :path, :port, :scheme, :version, :persistent, &inject_parameter_specs model_path 'fog/aws/models/cdn' diff --git a/lib/fog/aws/compute.rb b/lib/fog/aws/compute.rb index b0610361c..2884ad5d0 100644 --- a/lib/fog/aws/compute.rb +++ b/lib/fog/aws/compute.rb @@ -2,8 +2,8 @@ module Fog module AWS class Compute < Fog::Service - requires :aws_access_key_id, :aws_secret_access_key - recognizes :endpoint, :region, :host, :path, :port, :scheme, :persistent + requires :aws_access_key_id, :aws_secret_access_key, &inject_parameter_specs + recognizes :endpoint, :region, :host, :path, :port, :scheme, :persistent, &inject_parameter_specs model_path 'fog/aws/models/compute' model :address diff --git a/lib/fog/aws/elb.rb b/lib/fog/aws/elb.rb index e28b8f17f..6caada1fd 100644 --- a/lib/fog/aws/elb.rb +++ b/lib/fog/aws/elb.rb @@ -2,8 +2,8 @@ module Fog module AWS class ELB < Fog::Service - requires :aws_access_key_id, :aws_secret_access_key - recognizes :region, :host, :path, :port, :scheme, :persistent + requires :aws_access_key_id, :aws_secret_access_key, &inject_parameter_specs + recognizes :region, :host, :path, :port, :scheme, :persistent, &inject_parameter_specs request_path 'fog/aws/requests/elb' request :create_load_balancer diff --git a/lib/fog/aws/iam.rb b/lib/fog/aws/iam.rb index 5ae5d43c3..29610c74f 100644 --- a/lib/fog/aws/iam.rb +++ b/lib/fog/aws/iam.rb @@ -2,8 +2,8 @@ module Fog module AWS class IAM < Fog::Service - requires :aws_access_key_id, :aws_secret_access_key - recognizes :host, :path, :port, :scheme, :persistent + requires :aws_access_key_id, :aws_secret_access_key, &inject_parameter_specs + recognizes :host, :path, :port, :scheme, :persistent, &inject_parameter_specs request_path 'fog/aws/requests/iam' request :add_user_to_group diff --git a/lib/fog/aws/simpledb.rb b/lib/fog/aws/simpledb.rb index 13018d8e6..aef73230c 100644 --- a/lib/fog/aws/simpledb.rb +++ b/lib/fog/aws/simpledb.rb @@ -2,8 +2,8 @@ module Fog module AWS class SimpleDB < Fog::Service - requires :aws_access_key_id, :aws_secret_access_key - recognizes :host, :nil_string, :path, :port, :scheme, :persistent + requires :aws_access_key_id, :aws_secret_access_key, &inject_parameter_specs + recognizes :host, :nil_string, :path, :port, :scheme, :persistent, &inject_parameter_specs request_path 'fog/aws/requests/simpledb' request :batch_put_attributes diff --git a/lib/fog/aws/storage.rb b/lib/fog/aws/storage.rb index ae5363613..5710e7968 100644 --- a/lib/fog/aws/storage.rb +++ b/lib/fog/aws/storage.rb @@ -2,8 +2,8 @@ module Fog module AWS class Storage < Fog::Service - requires :aws_access_key_id, :aws_secret_access_key - recognizes :endpoint, :region, :host, :path, :port, :scheme, :persistent + requires :aws_access_key_id, :aws_secret_access_key, &inject_parameter_specs + recognizes :endpoint, :region, :host, :path, :port, :scheme, :persistent, &inject_parameter_specs model_path 'fog/aws/models/storage' collection :directories diff --git a/lib/fog/bluebox/compute.rb b/lib/fog/bluebox/compute.rb index d543e9fc3..bcc84e4de 100644 --- a/lib/fog/bluebox/compute.rb +++ b/lib/fog/bluebox/compute.rb @@ -2,8 +2,8 @@ module Fog module Bluebox class Compute < Fog::Service - requires :bluebox_api_key, :bluebox_customer_id - recognizes :bluebox_host, :bluebox_port, :bluebox_scheme, :persistent + requires :bluebox_api_key, :bluebox_customer_id, &inject_parameter_specs + recognizes :bluebox_host, :bluebox_port, :bluebox_scheme, :persistent, &inject_parameter_specs model_path 'fog/bluebox/models/compute' model :flavor diff --git a/lib/fog/brightbox/compute.rb b/lib/fog/brightbox/compute.rb index c83046a1c..0c79d93e5 100644 --- a/lib/fog/brightbox/compute.rb +++ b/lib/fog/brightbox/compute.rb @@ -4,8 +4,8 @@ module Fog API_URL = "https://api.gb1.brightbox.com/" - requires :brightbox_client_id, :brightbox_secret - recognizes :brightbox_auth_url, :brightbox_api_url + requires :brightbox_client_id, :brightbox_secret, &inject_parameter_specs + recognizes :brightbox_auth_url, :brightbox_api_url, &inject_parameter_specs model_path 'fog/brightbox/models/compute' model :account # Singular resource, no collection diff --git a/lib/fog/go_grid/compute.rb b/lib/fog/go_grid/compute.rb index f71b85b23..b00dab4f8 100644 --- a/lib/fog/go_grid/compute.rb +++ b/lib/fog/go_grid/compute.rb @@ -2,8 +2,8 @@ module Fog module GoGrid class Compute < Fog::Service - requires :go_grid_api_key, :go_grid_shared_secret - recognizes :host, :path, :port, :scheme, :persistent + requires :go_grid_api_key, :go_grid_shared_secret, &inject_parameter_specs + recognizes :host, :path, :port, :scheme, :persistent, &inject_parameter_specs model_path 'fog/go_grid/models/compute' model :image diff --git a/lib/fog/google/storage.rb b/lib/fog/google/storage.rb index bf69a78b3..2b65ee248 100644 --- a/lib/fog/google/storage.rb +++ b/lib/fog/google/storage.rb @@ -2,8 +2,8 @@ module Fog module Google class Storage < Fog::Service - requires :google_storage_access_key_id, :google_storage_secret_access_key - recognizes :host, :port, :scheme, :persistent + requires :google_storage_access_key_id, :google_storage_secret_access_key, &inject_parameter_specs + recognizes :host, :port, :scheme, :persistent, &inject_parameter_specs model_path 'fog/google/models/storage' collection :directories diff --git a/lib/fog/linode/compute.rb b/lib/fog/linode/compute.rb index f79d89745..47d000ff7 100644 --- a/lib/fog/linode/compute.rb +++ b/lib/fog/linode/compute.rb @@ -2,8 +2,8 @@ module Fog module Linode class Compute < Fog::Service - requires :linode_api_key - recognizes :port, :scheme, :persistent + requires :linode_api_key, &inject_parameter_specs + recognizes :port, :scheme, :persistent, &inject_parameter_specs model_path 'fog/linode/models/compute' diff --git a/lib/fog/local/storage.rb b/lib/fog/local/storage.rb index c7af3f5fa..f73cf991d 100644 --- a/lib/fog/local/storage.rb +++ b/lib/fog/local/storage.rb @@ -2,7 +2,7 @@ module Fog module Local class Storage < Fog::Service - requires :local_root + requires :local_root, &inject_parameter_specs model_path 'fog/local/models/storage' collection :directories diff --git a/lib/fog/new_servers/compute.rb b/lib/fog/new_servers/compute.rb index 70aafba6a..9120fe670 100644 --- a/lib/fog/new_servers/compute.rb +++ b/lib/fog/new_servers/compute.rb @@ -4,8 +4,8 @@ module Fog module NewServers class Compute < Fog::Service - requires :new_servers_password, :new_servers_username - recognizes :host, :port, :scheme, :persistent + requires :new_servers_password, :new_servers_username, &inject_parameter_specs + recognizes :host, :port, :scheme, :persistent, &inject_parameter_specs model_path 'fog/new_servers/models/compute' diff --git a/lib/fog/rackspace.rb b/lib/fog/rackspace.rb index 571f27d35..691595b20 100644 --- a/lib/fog/rackspace.rb +++ b/lib/fog/rackspace.rb @@ -1,7 +1,6 @@ module Fog module Rackspace - include NamedParameters extend Fog::Provider service_path 'fog/rackspace' @@ -11,11 +10,6 @@ module Fog service 'servers' service 'storage' - # NOTE: might be better to rely on the caller alone to enforce parameter - # requirements... - has_named_parameters :'self.authenticate', - :required => [ :rackspace_api_key, :rackspace_username ], - :optional => [ :rackspace_auth_url ] def self.authenticate(options) rackspace_auth_url = options[:rackspace_auth_url] || "auth.api.rackspacecloud.com" connection = Fog::Connection.new("https://" + rackspace_auth_url) diff --git a/lib/fog/rackspace/cdn.rb b/lib/fog/rackspace/cdn.rb index 6bc1a12fb..8a8130824 100644 --- a/lib/fog/rackspace/cdn.rb +++ b/lib/fog/rackspace/cdn.rb @@ -2,10 +2,8 @@ module Fog module Rackspace class CDN < Fog::Service - requires :rackspace_api_key, :rackspace_username - # NOTE: recognizes clause delegates to Fog::Rackspace.authenticate's so - # we also declare those parameters that the authenticate expects... - recognizes :rackspace_auth_url, :persistent + requires :rackspace_api_key, :rackspace_username, &inject_parameter_specs + recognizes :rackspace_auth_url, :persistent, &inject_parameter_specs model_path 'fog/rackspace/models/cdn' diff --git a/lib/fog/rackspace/compute.rb b/lib/fog/rackspace/compute.rb index 43c47f3c8..562628a3d 100644 --- a/lib/fog/rackspace/compute.rb +++ b/lib/fog/rackspace/compute.rb @@ -2,10 +2,8 @@ module Fog module Rackspace class Compute < Fog::Service - requires :rackspace_api_key, :rackspace_username - # NOTE: recognizes clause delegates to Fog::Rackspace.authenticate's so - # we also declare those parameters that the authenticate expects... - recognizes :rackspace_auth_url, :persistent + requires :rackspace_api_key, :rackspace_username, &inject_parameter_specs + recognizes :rackspace_auth_url, :persistent, &inject_parameter_specs model_path 'fog/rackspace/models/compute' model :flavor diff --git a/lib/fog/rackspace/storage.rb b/lib/fog/rackspace/storage.rb index 843bdc17c..6d853f6e2 100644 --- a/lib/fog/rackspace/storage.rb +++ b/lib/fog/rackspace/storage.rb @@ -2,10 +2,8 @@ module Fog module Rackspace class Storage < Fog::Service - requires :rackspace_api_key, :rackspace_username - # NOTE: recognizes clause delegates to Fog::Rackspace.authenticate's so - # we also declare those parameters that the authenticate expects... - recognizes :rackspace_auth_url, :persistent + requires :rackspace_api_key, :rackspace_username, &inject_parameter_specs + recognizes :rackspace_auth_url, :persistent, &inject_parameter_specs model_path 'fog/rackspace/models/storage' model :directory diff --git a/lib/fog/slicehost/compute.rb b/lib/fog/slicehost/compute.rb index cb4a5df85..5a467e6bd 100644 --- a/lib/fog/slicehost/compute.rb +++ b/lib/fog/slicehost/compute.rb @@ -2,8 +2,8 @@ module Fog module Slicehost class Compute < Fog::Service - requires :slicehost_password - recognizes :host, :port, :scheme, :persistent + requires :slicehost_password, &inject_parameter_specs + recognizes :host, :port, :scheme, :persistent, &inject_parameter_specs model_path 'fog/slicehost/models/compute' model :flavor diff --git a/lib/fog/terremark/ecloud.rb b/lib/fog/terremark/ecloud.rb index 4f24a819d..fbe68ba8e 100644 --- a/lib/fog/terremark/ecloud.rb +++ b/lib/fog/terremark/ecloud.rb @@ -32,6 +32,8 @@ module Fog end class Real + # NOTE: When this vbecomes a service, take care to pass the &inject_parameter_specs + # block on call to requires and recognizes requires :terremark_ecloud_password, :terremark_ecloud_username recognizes :host, :path, :port, :scheme, :persistent diff --git a/lib/fog/vcloud.rb b/lib/fog/vcloud.rb index 17b747a51..6f6617a36 100644 --- a/lib/fog/vcloud.rb +++ b/lib/fog/vcloud.rb @@ -19,8 +19,8 @@ end module Fog class Vcloud < Fog::Service - requires :username, :password, :module, :versions_uri - recognizes :version, :persistent + requires :username, :password, :module, :versions_uri, &inject_parameter_specs + recognizes :version, :persistent, &inject_parameter_specs model_path 'fog/vcloud/models' model :vdc