Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[compute|aws] fix helpers to use Fog::AWS

  • Loading branch information...
commit 768fcafaa9092c70719cc0b8cab4cd50da7ca345 1 parent 6eae9b6
@geemus geemus authored
Showing with 49 additions and 49 deletions.
  1. +1 −1  lib/fog/aws/cloud_formation.rb
  2. +1 −1  lib/fog/aws/elb.rb
  3. +1 −1  lib/fog/aws/iam.rb
  4. +1 −1  lib/fog/aws/rds.rb
  5. +1 −1  lib/fog/aws/requests/cloud_formation/create_stack.rb
  6. +5 −5 lib/fog/aws/requests/elb/create_load_balancer.rb
  7. +4 −4 lib/fog/aws/requests/elb/create_load_balancer_listeners.rb
  8. +1 −1  lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb
  9. +1 −1  lib/fog/aws/requests/elb/deregister_instances_from_load_balancer.rb
  10. +1 −1  lib/fog/aws/requests/elb/describe_instance_health.rb
  11. +1 −1  lib/fog/aws/requests/elb/describe_load_balancers.rb
  12. +1 −1  lib/fog/aws/requests/elb/disable_availability_zones_for_load_balancer.rb
  13. +1 −1  lib/fog/aws/requests/elb/enable_availability_zones_for_load_balancer.rb
  14. +1 −1  lib/fog/aws/requests/elb/register_instances_with_load_balancer.rb
  15. +1 −1  lib/fog/aws/requests/elb/set_load_balancer_policies_of_listener.rb
  16. +1 −1  lib/fog/aws/requests/rds/create_db_instance.rb
  17. +1 −1  lib/fog/aws/requests/rds/modify_db_instance.rb
  18. +3 −3 lib/fog/aws/requests/rds/modify_db_parameter_group.rb
  19. +2 −2 lib/fog/aws/requests/ses/send_email.rb
  20. +1 −1  lib/fog/aws/requests/ses/send_raw_email.rb
  21. +2 −2 lib/fog/aws/simpledb.rb
  22. +1 −1  lib/fog/compute/aws.rb
  23. +1 −1  lib/fog/compute/requests/aws/describe_addresses.rb
  24. +1 −1  lib/fog/compute/requests/aws/describe_availability_zones.rb
  25. +1 −1  lib/fog/compute/requests/aws/describe_images.rb
  26. +1 −1  lib/fog/compute/requests/aws/describe_instances.rb
  27. +1 −1  lib/fog/compute/requests/aws/describe_key_pairs.rb
  28. +1 −1  lib/fog/compute/requests/aws/describe_regions.rb
  29. +1 −1  lib/fog/compute/requests/aws/describe_reserved_instances.rb
  30. +1 −1  lib/fog/compute/requests/aws/describe_reserved_instances_offerings.rb
  31. +1 −1  lib/fog/compute/requests/aws/describe_security_groups.rb
  32. +1 −1  lib/fog/compute/requests/aws/describe_snapshots.rb
  33. +1 −1  lib/fog/compute/requests/aws/describe_tags.rb
  34. +1 −1  lib/fog/compute/requests/aws/describe_volumes.rb
  35. +3 −3 lib/fog/compute/requests/aws/modify_image_attributes.rb
  36. +1 −1  lib/fog/compute/requests/aws/stop_instances.rb
View
2  lib/fog/aws/cloud_formation.rb
@@ -80,7 +80,7 @@ def request(params)
idempotent = params.delete(:idempotent)
parser = params.delete(:parser)
- body = AWS.signed_params(
+ body = Fog::AWS.signed_params(
params,
{
:aws_access_key_id => @aws_access_key_id,
View
2  lib/fog/aws/elb.rb
@@ -100,7 +100,7 @@ def request(params)
idempotent = params.delete(:idempotent)
parser = params.delete(:parser)
- body = AWS.signed_params(
+ body = Fog::AWS.signed_params(
params,
{
:aws_access_key_id => @aws_access_key_id,
View
2  lib/fog/aws/iam.rb
@@ -93,7 +93,7 @@ def request(params)
idempotent = params.delete(:idempotent)
parser = params.delete(:parser)
- body = AWS.signed_params(
+ body = Fog::AWS.signed_params(
params,
{
:aws_access_key_id => @aws_access_key_id,
View
2  lib/fog/aws/rds.rb
@@ -115,7 +115,7 @@ def request(params)
idempotent = params.delete(:idempotent)
parser = params.delete(:parser)
- body = AWS.signed_params(
+ body = Fog::AWS.signed_params(
params,
{
:aws_access_key_id => @aws_access_key_id,
View
2  lib/fog/aws/requests/cloud_formation/create_stack.rb
@@ -36,7 +36,7 @@ def create_stack(stack_name, options = {})
end
if options['NotificationARNs']
- params.merge!(AWS.indexed_param("NotificationARNs.member", [*options['NotificationARNs']]))
+ params.merge!(Fog::AWS.indexed_param("NotificationARNs.member", [*options['NotificationARNs']]))
end
if options['Parameters']
View
10 lib/fog/aws/requests/elb/create_load_balancer.rb
@@ -23,7 +23,7 @@ class Real
# * 'CreateLoadBalancerResult'<~Hash>:
# * 'DNSName'<~String> - DNS name for the newly created ELB
def create_load_balancer(availability_zones, lb_name, listeners)
- params = AWS.indexed_param('AvailabilityZones.member', [*availability_zones])
+ params = Fog::AWS.indexed_param('AvailabilityZones.member', [*availability_zones])
listener_protocol = []
listener_lb_port = []
@@ -36,10 +36,10 @@ def create_load_balancer(availability_zones, lb_name, listeners)
listener_ssl_certificate_id.push(listener['SSLCertificateId'])
end
- params.merge!(AWS.indexed_param('Listeners.member.%d.Protocol', listener_protocol))
- params.merge!(AWS.indexed_param('Listeners.member.%d.LoadBalancerPort', listener_lb_port))
- params.merge!(AWS.indexed_param('Listeners.member.%d.InstancePort', listener_instance_port))
- params.merge!(AWS.indexed_param('Listeners.member.%d.SSLCertificateId', listener_ssl_certificate_id))
+ params.merge!(Fog::AWS.indexed_param('Listeners.member.%d.Protocol', listener_protocol))
+ params.merge!(Fog::AWS.indexed_param('Listeners.member.%d.LoadBalancerPort', listener_lb_port))
+ params.merge!(Fog::AWS.indexed_param('Listeners.member.%d.InstancePort', listener_instance_port))
+ params.merge!(Fog::AWS.indexed_param('Listeners.member.%d.SSLCertificateId', listener_ssl_certificate_id))
request({
'Action' => 'CreateLoadBalancer',
View
8 lib/fog/aws/requests/elb/create_load_balancer_listeners.rb
@@ -33,10 +33,10 @@ def create_load_balancer_listeners(lb_name, listeners)
listener_ssl_certificate_id.push(listener['SSLCertificateId'])
end
- params.merge!(AWS.indexed_param('Listeners.member.%d.Protocol', listener_protocol))
- params.merge!(AWS.indexed_param('Listeners.member.%d.LoadBalancerPort', listener_lb_port))
- params.merge!(AWS.indexed_param('Listeners.member.%d.InstancePort', listener_instance_port))
- params.merge!(AWS.indexed_param('Listeners.member.%d.SSLCertificateId', listener_ssl_certificate_id))
+ params.merge!(Fog::AWS.indexed_param('Listeners.member.%d.Protocol', listener_protocol))
+ params.merge!(Fog::AWS.indexed_param('Listeners.member.%d.LoadBalancerPort', listener_lb_port))
+ params.merge!(Fog::AWS.indexed_param('Listeners.member.%d.InstancePort', listener_instance_port))
+ params.merge!(Fog::AWS.indexed_param('Listeners.member.%d.SSLCertificateId', listener_ssl_certificate_id))
request({
'Action' => 'CreateLoadBalancerListeners',
View
2  lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb
@@ -16,7 +16,7 @@ class Real
# * 'ResponseMetadata'<~Hash>:
# * 'RequestId'<~String> - Id of request
def delete_load_balancer_listeners(lb_name, load_balancer_ports)
- params = AWS.indexed_param('LoadBalancerPorts.memeber.%d', load_balancer_ports)
+ params = Fog::AWS.indexed_param('LoadBalancerPorts.memeber.%d', load_balancer_ports)
request({
'Action' => 'DeleteLoadBalancerListeners',
View
2  lib/fog/aws/requests/elb/deregister_instances_from_load_balancer.rb
@@ -20,7 +20,7 @@ class Real
# * 'Instances'<~Array> - array of hashes describing instances currently enabled
# * 'InstanceId'<~String>
def deregister_instances_from_load_balancer(instance_ids, lb_name)
- params = AWS.indexed_param('Instances.member.%d.InstanceId', [*instance_ids])
+ params = Fog::AWS.indexed_param('Instances.member.%d.InstanceId', [*instance_ids])
request({
'Action' => 'DeregisterInstancesFromLoadBalancer',
'LoadBalancerName' => lb_name,
View
2  lib/fog/aws/requests/elb/describe_instance_health.rb
@@ -23,7 +23,7 @@ class Real
# * 'InstanceId'<~String>
# * 'ReasonCode'<~String>
def describe_instance_health(lb_name, instance_ids = [])
- params = AWS.indexed_param('Instances.member.%d.InstanceId', [*instance_ids])
+ params = Fog::AWS.indexed_param('Instances.member.%d.InstanceId', [*instance_ids])
request({
'Action' => 'DescribeInstanceHealth',
'LoadBalancerName' => lb_name,
View
2  lib/fog/aws/requests/elb/describe_load_balancers.rb
@@ -43,7 +43,7 @@ class Real
# * 'GroupName'<~String> - Name of the source security group to use with inbound security group rules
# * 'OwnerAlias'<~String> - Owner of the source security group
def describe_load_balancers(lb_name = [])
- params = AWS.indexed_param('LoadBalancerNames.member', [*lb_name])
+ params = Fog::AWS.indexed_param('LoadBalancerNames.member', [*lb_name])
request({
'Action' => 'DescribeLoadBalancers',
:parser => Fog::Parsers::AWS::ELB::DescribeLoadBalancers.new
View
2  lib/fog/aws/requests/elb/disable_availability_zones_for_load_balancer.rb
@@ -19,7 +19,7 @@ class Real
# * 'DisableAvailabilityZonesForLoadBalancerResult'<~Hash>:
# * 'AvailabilityZones'<~Array> - array of strings describing instances currently enabled
def disable_availability_zones_for_load_balancer(availability_zones, lb_name)
- params = AWS.indexed_param('AvailabilityZones.member', [*availability_zones])
+ params = Fog::AWS.indexed_param('AvailabilityZones.member', [*availability_zones])
request({
'Action' => 'DisableAvailabilityZonesForLoadBalancer',
'LoadBalancerName' => lb_name,
View
2  lib/fog/aws/requests/elb/enable_availability_zones_for_load_balancer.rb
@@ -19,7 +19,7 @@ class Real
# * 'EnableAvailabilityZonesForLoadBalancerResult'<~Hash>:
# * 'AvailabilityZones'<~Array> - array of strings describing instances currently enabled
def enable_availability_zones_for_load_balancer(availability_zones, lb_name)
- params = AWS.indexed_param('AvailabilityZones.member', [*availability_zones])
+ params = Fog::AWS.indexed_param('AvailabilityZones.member', [*availability_zones])
request({
'Action' => 'EnableAvailabilityZonesForLoadBalancer',
'LoadBalancerName' => lb_name,
View
2  lib/fog/aws/requests/elb/register_instances_with_load_balancer.rb
@@ -20,7 +20,7 @@ class Real
# * 'Instances'<~Array> - array of hashes describing instances currently enabled
# * 'InstanceId'<~String>
def register_instances_with_load_balancer(instance_ids, lb_name)
- params = AWS.indexed_param('Instances.member.%d.InstanceId', [*instance_ids])
+ params = Fog::AWS.indexed_param('Instances.member.%d.InstanceId', [*instance_ids])
request({
'Action' => 'RegisterInstancesWithLoadBalancer',
'LoadBalancerName' => lb_name,
View
2  lib/fog/aws/requests/elb/set_load_balancer_policies_of_listener.rb
@@ -25,7 +25,7 @@ class Real
def set_load_balancer_policies_of_listener(lb_name, load_balancer_port, policy_names)
params = {'LoadBalancerPort' => load_balancer_port}
if policy_names.any?
- params.merge!(AWS.indexed_param('PolicyNames.member', policy_names))
+ params.merge!(Fog::AWS.indexed_param('PolicyNames.member', policy_names))
else
params['PolicyNames'] = ''
end
View
2  lib/fog/aws/requests/rds/create_db_instance.rb
@@ -32,7 +32,7 @@ class Real
def create_db_instance(db_name, options={})
if security_groups = options.delete('DBSecurityGroups')
- options.merge!(AWS.indexed_param('DBSecurityGroups.member.%d', [*security_groups]))
+ options.merge!(Fog::AWS.indexed_param('DBSecurityGroups.member.%d', [*security_groups]))
end
request({
View
2  lib/fog/aws/requests/rds/modify_db_instance.rb
@@ -29,7 +29,7 @@ class Real
def modify_db_instance(db_name, apply_immediately, options={})
if security_groups = options.delete('DBSecurityGroups')
- options.merge!(AWS.indexed_param('DBSecurityGroups.member.%d', [*security_groups]))
+ options.merge!(Fog::AWS.indexed_param('DBSecurityGroups.member.%d', [*security_groups]))
end
request({
View
6 lib/fog/aws/requests/rds/modify_db_parameter_group.rb
@@ -29,9 +29,9 @@ def modify_db_parameter_group(group_name, parameters)
parameter_apply_methods.push(parameter['ApplyMethod'])
end
params = {}
- params.merge!(AWS.indexed_param('Parameters.member.%d.ParameterName', parameter_names))
- params.merge!(AWS.indexed_param('Parameters.member.%d.ParameterValue', parameter_values))
- params.merge!(AWS.indexed_param('Parameters.member.%d.ApplyMethod', parameter_apply_methods))
+ params.merge!(Fog::AWS.indexed_param('Parameters.member.%d.ParameterName', parameter_names))
+ params.merge!(Fog::AWS.indexed_param('Parameters.member.%d.ParameterValue', parameter_values))
+ params.merge!(Fog::AWS.indexed_param('Parameters.member.%d.ApplyMethod', parameter_apply_methods))
request({
'Action' => 'ModifyDBParameterGroup',
View
4 lib/fog/aws/requests/ses/send_email.rb
@@ -40,7 +40,7 @@ def send_email(source, destination, message, options = {})
}
for key, values in destination
- params.merge!(AWS.indexed_param("Destination.#{key}.member", [*values]))
+ params.merge!(Fog::AWS.indexed_param("Destination.#{key}.member", [*values]))
end
for key, value in message['Subject']
@@ -54,7 +54,7 @@ def send_email(source, destination, message, options = {})
end
if options.has_key?('ReplyToAddresses')
- params.merge!(AWS.indexed_param("ReplyToAddresses.member", [*options['ReplyToAddresses']]))
+ params.merge!(Fog::AWS.indexed_param("ReplyToAddresses.member", [*options['ReplyToAddresses']]))
end
if options.has_key?('ReturnPath')
View
2  lib/fog/aws/requests/ses/send_raw_email.rb
@@ -22,7 +22,7 @@ class Real
def send_raw_email(raw_message, options = {})
params = {}
if options.has_key?('Destinations')
- params.merge!(AWS.indexed_param('Destinations.member', [*options['Destinations']]))
+ params.merge!(Fog::AWS.indexed_param('Destinations.member', [*options['Destinations']]))
end
if options.has_key?('Source')
params['Source'] = options['Source']
View
4 lib/fog/aws/simpledb.rb
@@ -121,7 +121,7 @@ def encode_attributes(attributes, replace_attributes = [], expected_attributes =
end
def encode_attribute_names(attributes)
- AWS.indexed_param('AttributeName', attributes.map {|attribute| attributes.to_s})
+ Fog::AWS.indexed_param('AttributeName', attributes.map {|attribute| attributes.to_s})
end
def encode_batch_attributes(items, replace_attributes = Hash.new([]))
@@ -155,7 +155,7 @@ def request(params)
idempotent = params.delete(:idempotent)
parser = params.delete(:parser)
- body = AWS.signed_params(
+ body = Fog::AWS.signed_params(
params,
{
:aws_access_key_id => @aws_access_key_id,
View
2  lib/fog/compute/aws.rb
@@ -241,7 +241,7 @@ def request(params)
idempotent = params.delete(:idempotent)
parser = params.delete(:parser)
- body = AWS.signed_params(
+ body = Fog::AWS.signed_params(
params,
{
:aws_access_key_id => @aws_access_key_id,
View
2  lib/fog/compute/requests/aws/describe_addresses.rb
@@ -24,7 +24,7 @@ def describe_addresses(filters = {})
Formatador.display_line("[yellow][WARN] describe_addresses with #{filters.class} param is deprecated, use describe_addresses('public-ip' => []) instead[/] [light_black](#{caller.first})[/]")
filters = {'public-ip' => [*filters]}
end
- params = AWS.indexed_filters(filters)
+ params = Fog::AWS.indexed_filters(filters)
request({
'Action' => 'DescribeAddresses',
:idempotent => true,
View
2  lib/fog/compute/requests/aws/describe_availability_zones.rb
@@ -25,7 +25,7 @@ def describe_availability_zones(filters = {})
Formatador.display_line("[yellow][WARN] describe_availability_zones with #{filters.class} param is deprecated, use describe_availability_zones('zone-name' => []) instead[/] [light_black](#{caller.first})[/]")
filters = {'public-ip' => [*filters]}
end
- params = AWS.indexed_filters(filters)
+ params = Fog::AWS.indexed_filters(filters)
request({
'Action' => 'DescribeAvailabilityZones',
:idempotent => true,
View
2  lib/fog/compute/requests/aws/describe_images.rb
@@ -45,7 +45,7 @@ def describe_images(filters = {})
options[key] = filters.delete(key)
end
end
- params = AWS.indexed_filters(filters).merge!(options)
+ params = Fog::AWS.indexed_filters(filters).merge!(options)
request({
'Action' => 'DescribeImages',
:idempotent => true,
View
2  lib/fog/compute/requests/aws/describe_instances.rb
@@ -62,7 +62,7 @@ def describe_instances(filters = {})
if filters['instance-id'] && !filters['instance-id'].is_a?(Array)
params.merge!('InstanceId' => filters.delete('instance-id'))
end
- params.merge!(AWS.indexed_filters(filters))
+ params.merge!(Fog::AWS.indexed_filters(filters))
request({
'Action' => 'DescribeInstances',
View
2  lib/fog/compute/requests/aws/describe_key_pairs.rb
@@ -24,7 +24,7 @@ def describe_key_pairs(filters = {})
Formatador.display_line("[yellow][WARN] describe_key_pairs with #{filters.class} param is deprecated, use describe_key_pairs('key-name' => []) instead[/] [light_black](#{caller.first})[/]")
filters = {'key-name' => [*filters]}
end
- params = AWS.indexed_filters(filters)
+ params = Fog::AWS.indexed_filters(filters)
request({
'Action' => 'DescribeKeyPairs',
:idempotent => true,
View
2  lib/fog/compute/requests/aws/describe_regions.rb
@@ -24,7 +24,7 @@ def describe_regions(filters = {})
Formatador.display_line("[yellow][WARN] describe_regions with #{filters.class} param is deprecated, use describe_regions('region-name' => []) instead[/] [light_black](#{caller.first})[/]")
filters = {'region-name' => [*filters]}
end
- params = AWS.indexed_filters(filters)
+ params = Fog::AWS.indexed_filters(filters)
request({
'Action' => 'DescribeRegions',
:idempotent => true,
View
2  lib/fog/compute/requests/aws/describe_reserved_instances.rb
@@ -32,7 +32,7 @@ def describe_reserved_instances(filters = {})
Formatador.display_line("[yellow][WARN] describe_reserved_instances with #{filters.class} param is deprecated, use describe_reserved_instances('reserved-instances-id' => []) instead[/] [light_black](#{caller.first})[/]")
filters = {'reserved-instances-id' => [*filters]}
end
- params = AWS.indexed_filters(filters)
+ params = Fog::AWS.indexed_filters(filters)
request({
'Action' => 'DescribeReservedInstances',
:idempotent => true,
View
2  lib/fog/compute/requests/aws/describe_reserved_instances_offerings.rb
@@ -25,7 +25,7 @@ class Real
#
# {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeReservedInstancesOfferings.html]
def describe_reserved_instances_offerings(filters = {})
- params = AWS.indexed_filters(filters)
+ params = Fog::AWS.indexed_filters(filters)
request({
'Action' => 'DescribeReservedInstancesOfferings',
:idempotent => true,
View
2  lib/fog/compute/requests/aws/describe_security_groups.rb
@@ -34,7 +34,7 @@ def describe_security_groups(filters = {})
Formatador.display_line("[yellow][WARN] describe_security_groups with #{filters.class} param is deprecated, use describe_security_groups('group-name' => []) instead[/] [light_black](#{caller.first})[/]")
filters = {'group-name' => [*filters]}
end
- params = AWS.indexed_filters(filters)
+ params = Fog::AWS.indexed_filters(filters)
request({
'Action' => 'DescribeSecurityGroups',
:idempotent => true,
View
2  lib/fog/compute/requests/aws/describe_snapshots.rb
@@ -40,7 +40,7 @@ def describe_snapshots(filters = {}, options = {})
end
end
options['RestorableBy'] ||= 'self'
- params = AWS.indexed_filters(filters).merge!(options)
+ params = Fog::AWS.indexed_filters(filters).merge!(options)
request({
'Action' => 'DescribeSnapshots',
:idempotent => true,
View
2  lib/fog/compute/requests/aws/describe_tags.rb
@@ -22,7 +22,7 @@ class Real
#
# {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeTags.html]
def describe_tags(filters = {})
- params = AWS.indexed_filters(filters)
+ params = Fog::AWS.indexed_filters(filters)
request({
'Action' => 'DescribeTags',
:idempotent => true,
View
2  lib/fog/compute/requests/aws/describe_volumes.rb
@@ -34,7 +34,7 @@ def describe_volumes(filters = {})
Formatador.display_line("[yellow][WARN] describe_volumes with #{filters.class} param is deprecated, use describe_volumes('volume-id' => []) instead[/] [light_black](#{caller.first})[/]")
filters = {'volume-id' => [*filters]}
end
- params = AWS.indexed_filters(filters)
+ params = Fog::AWS.indexed_filters(filters)
request({
'Action' => 'DescribeVolumes',
:idempotent => true,
View
6 lib/fog/compute/requests/aws/modify_image_attributes.rb
@@ -18,9 +18,9 @@ class Real
#
def modify_image_attributes(image_id, attribute, operation_type, options = {})
params = {}
- params.merge!(AWS.indexed_param('UserId', options['UserId']))
- params.merge!(AWS.indexed_param('UserGroup', options['UserGroup']))
- params.merge!(AWS.indexed_param('ProductCode', options['ProductCode']))
+ params.merge!(Fog::AWS.indexed_param('UserId', options['UserId']))
+ params.merge!(Fog::AWS.indexed_param('UserGroup', options['UserGroup']))
+ params.merge!(Fog::AWS.indexed_param('ProductCode', options['ProductCode']))
request({
'Action' => 'ModifyImageAttribute',
'Attribute' => attribute,
View
2  lib/fog/compute/requests/aws/stop_instances.rb
@@ -18,7 +18,7 @@ class Real
#
# {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-StopInstances.html]
def stop_instances(instance_id)
- params = AWS.indexed_param('InstanceId', instance_id)
+ params = Fog::AWS.indexed_param('InstanceId', instance_id)
request({
'Action' => 'StopInstances',
:idempotent => true,
Please sign in to comment.
Something went wrong with that request. Please try again.