mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[aws|auto_scaling] Updates reference to service
This commit is contained in:
parent
acb52cbee9
commit
e8108fdce0
10 changed files with 32 additions and 32 deletions
|
@ -11,7 +11,7 @@ module Fog
|
|||
data = []
|
||||
next_token = nil
|
||||
loop do
|
||||
result = connection.describe_scaling_activities('NextToken' => next_token).body['DescribeScalingActivitiesResult']
|
||||
result = service.describe_scaling_activities('NextToken' => next_token).body['DescribeScalingActivitiesResult']
|
||||
data += result['Activities']
|
||||
next_token = result['NextToken']
|
||||
break if next_token.nil?
|
||||
|
@ -20,7 +20,7 @@ module Fog
|
|||
end
|
||||
|
||||
def get(identity)
|
||||
data = connection.describe_scaling_activities('ActivityId' => identity).body['DescribeScalingActivitiesResult']['Activities'].first
|
||||
data = service.describe_scaling_activities('ActivityId' => identity).body['DescribeScalingActivitiesResult']['Activities'].first
|
||||
new(data) unless data.nil?
|
||||
end
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ module Fog
|
|||
attribute :status_message, :aliases => 'StatusMessage'
|
||||
|
||||
def group
|
||||
connection.groups.get(attributes['AutoScalingGroupName'])
|
||||
service.groups.get(attributes['AutoScalingGroupName'])
|
||||
end
|
||||
|
||||
def save
|
||||
|
|
|
@ -41,7 +41,7 @@ module Fog
|
|||
|
||||
options = Hash[self.class.aliases.map { |key, value| [key, send(value)] }]
|
||||
options.delete_if { |key, value| value.nil? }
|
||||
connection.create_launch_configuration(image_id, instance_type, id, options) #, listeners.map{|l| l.to_params})
|
||||
service.create_launch_configuration(image_id, instance_type, id, options) #, listeners.map{|l| l.to_params})
|
||||
|
||||
# reload instead of merge attributes b/c some attrs (like HealthCheck)
|
||||
# may be set, but only the DNS name is returned in the create_load_balance
|
||||
|
@ -56,7 +56,7 @@ module Fog
|
|||
|
||||
def destroy
|
||||
requires :id
|
||||
connection.delete_launch_configuration(id)
|
||||
service.delete_launch_configuration(id)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -16,7 +16,7 @@ module Fog
|
|||
data = []
|
||||
next_token = nil
|
||||
loop do
|
||||
result = connection.describe_launch_configurations('NextToken' => next_token).body['DescribeLaunchConfigurationsResult']
|
||||
result = service.describe_launch_configurations('NextToken' => next_token).body['DescribeLaunchConfigurationsResult']
|
||||
data += result['LaunchConfigurations']
|
||||
next_token = result['NextToken']
|
||||
break if next_token.nil?
|
||||
|
@ -25,7 +25,7 @@ module Fog
|
|||
end
|
||||
|
||||
def get(identity)
|
||||
data = connection.describe_launch_configurations('LaunchConfigurationNames' => identity).body['DescribeLaunchConfigurationsResult']['LaunchConfigurations'].first
|
||||
data = service.describe_launch_configurations('LaunchConfigurationNames' => identity).body['DescribeLaunchConfigurationsResult']['LaunchConfigurations'].first
|
||||
new(data) unless data.nil?
|
||||
end
|
||||
|
||||
|
|
|
@ -45,37 +45,37 @@ module Fog
|
|||
data = []
|
||||
next_token = nil
|
||||
loop do
|
||||
result = connection.describe_scaling_activities('AutoScalingGroupName' => id, 'NextToken' => next_token).body['DescribeScalingActivitiesResult']
|
||||
result = service.describe_scaling_activities('AutoScalingGroupName' => id, 'NextToken' => next_token).body['DescribeScalingActivitiesResult']
|
||||
data += result['Activities']
|
||||
next_token = result['NextToken']
|
||||
break if next_token.nil?
|
||||
end
|
||||
Fog::AWS::AutoScaling::Activities.new({
|
||||
:data => data,
|
||||
:connection => connection,
|
||||
:service => service,
|
||||
#:load_balancer => self
|
||||
})
|
||||
end
|
||||
|
||||
def configuration
|
||||
requires :launch_configuration_name
|
||||
connection.configurations.get(launch_configuration_name)
|
||||
service.configurations.get(launch_configuration_name)
|
||||
end
|
||||
|
||||
def disable_metrics_collection(metrics = {})
|
||||
requires :id
|
||||
connection.disable_metrics_collection(id, 'Metrics' => metrics)
|
||||
service.disable_metrics_collection(id, 'Metrics' => metrics)
|
||||
reload
|
||||
end
|
||||
|
||||
def enable_metrics_collection(granularity = '1Minute', metrics = {})
|
||||
requires :id
|
||||
connection.enable_metrics_collection(id, granularity, 'Metrics' => metrics)
|
||||
service.enable_metrics_collection(id, granularity, 'Metrics' => metrics)
|
||||
reload
|
||||
end
|
||||
|
||||
def instances
|
||||
Fog::AWS::AutoScaling::Instances.new(:connection => connection).load(attributes[:instances])
|
||||
Fog::AWS::AutoScaling::Instances.new(:service => service).load(attributes[:instances])
|
||||
end
|
||||
|
||||
def instances_in_service
|
||||
|
@ -88,13 +88,13 @@ module Fog
|
|||
|
||||
def resume_processes(processes = [])
|
||||
requires :id
|
||||
connection.resume_processes(id, 'ScalingProcesses' => processes)
|
||||
service.resume_processes(id, 'ScalingProcesses' => processes)
|
||||
reload
|
||||
end
|
||||
|
||||
def suspend_processes(processes = [])
|
||||
requires :id
|
||||
connection.suspend_processes(id, 'ScalingProcesses' => processes)
|
||||
service.suspend_processes(id, 'ScalingProcesses' => processes)
|
||||
reload
|
||||
end
|
||||
|
||||
|
@ -112,7 +112,7 @@ module Fog
|
|||
requires :max_size
|
||||
requires :min_size
|
||||
|
||||
connection.create_auto_scaling_group(id, availability_zones, launch_configuration_name, max_size, min_size, options)
|
||||
service.create_auto_scaling_group(id, availability_zones, launch_configuration_name, max_size, min_size, options)
|
||||
reload
|
||||
end
|
||||
|
||||
|
@ -126,13 +126,13 @@ module Fog
|
|||
|
||||
opts = {}
|
||||
opts.merge!({'ForceDelete' => true}) if options[:force]
|
||||
|
||||
connection.delete_auto_scaling_group(id, opts)
|
||||
|
||||
service.delete_auto_scaling_group(id, opts)
|
||||
end
|
||||
|
||||
def update
|
||||
requires :id
|
||||
connection.update_auto_scaling_group(id, options)
|
||||
service.update_auto_scaling_group(id, options)
|
||||
reload
|
||||
end
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ module Fog
|
|||
data = []
|
||||
next_token = nil
|
||||
loop do
|
||||
result = connection.describe_auto_scaling_groups('NextToken' => next_token).body['DescribeAutoScalingGroupsResult']
|
||||
result = service.describe_auto_scaling_groups('NextToken' => next_token).body['DescribeAutoScalingGroupsResult']
|
||||
data += result['AutoScalingGroups']
|
||||
next_token = result['NextToken']
|
||||
break if next_token.nil?
|
||||
|
@ -25,7 +25,7 @@ module Fog
|
|||
end
|
||||
|
||||
def get(identity)
|
||||
data = connection.describe_auto_scaling_groups('AutoScalingGroupNames' => identity).body['DescribeAutoScalingGroupsResult']['AutoScalingGroups'].first
|
||||
data = service.describe_auto_scaling_groups('AutoScalingGroupNames' => identity).body['DescribeAutoScalingGroupsResult']['AutoScalingGroups'].first
|
||||
new(data) unless data.nil?
|
||||
end
|
||||
|
||||
|
|
|
@ -17,22 +17,22 @@ module Fog
|
|||
end
|
||||
|
||||
def group
|
||||
connection.groups.get(attributes['AutoScalingGroupName'])
|
||||
service.groups.get(attributes['AutoScalingGroupName'])
|
||||
end
|
||||
|
||||
def configuration
|
||||
connection.configurations.get(attributes['LaunchConfigurationName'])
|
||||
service.configurations.get(attributes['LaunchConfigurationName'])
|
||||
end
|
||||
|
||||
def set_health(health_status, options)
|
||||
requires :id
|
||||
connection.set_instance_health(health_status, id, options)
|
||||
service.set_instance_health(health_status, id, options)
|
||||
reload
|
||||
end
|
||||
|
||||
def terminate(should_decrement_desired_capacity)
|
||||
requires :id
|
||||
connection.terminate_instance_in_auto_scaling_group(id, should_decrement_desired_capacity)
|
||||
service.terminate_instance_in_auto_scaling_group(id, should_decrement_desired_capacity)
|
||||
reload
|
||||
end
|
||||
|
||||
|
@ -51,7 +51,7 @@ module Fog
|
|||
|
||||
#def destroy
|
||||
# requires :id
|
||||
# connection.delete_auto_scaling_group(id)
|
||||
# service.delete_auto_scaling_group(id)
|
||||
#end
|
||||
|
||||
end
|
||||
|
|
|
@ -11,7 +11,7 @@ module Fog
|
|||
data = []
|
||||
next_token = nil
|
||||
loop do
|
||||
result = connection.describe_auto_scaling_instances('NextToken' => next_token).body['DescribeAutoScalingInstancesResult']
|
||||
result = service.describe_auto_scaling_instances('NextToken' => next_token).body['DescribeAutoScalingInstancesResult']
|
||||
data += result['AutoScalingInstances']
|
||||
next_token = result['NextToken']
|
||||
break if next_token.nil?
|
||||
|
@ -20,7 +20,7 @@ module Fog
|
|||
end
|
||||
|
||||
def get(identity)
|
||||
data = connection.describe_auto_scaling_instances('InstanceIds' => identity).body['DescribeAutoScalingInstancesResult']['AutoScalingInstances'].first
|
||||
data = service.describe_auto_scaling_instances('InstanceIds' => identity).body['DescribeAutoScalingInstancesResult']['AutoScalingInstances'].first
|
||||
new(data) unless data.nil?
|
||||
end
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ module Fog
|
|||
data = []
|
||||
next_token = nil
|
||||
loop do
|
||||
result = connection.describe_policies('NextToken' => next_token).body['DescribePoliciesResult']
|
||||
result = service.describe_policies('NextToken' => next_token).body['DescribePoliciesResult']
|
||||
data += result['ScalingPolicies']
|
||||
next_token = result['NextToken']
|
||||
break if next_token.nil?
|
||||
|
@ -24,7 +24,7 @@ module Fog
|
|||
end
|
||||
|
||||
def get(identity, auto_scaling_group = nil)
|
||||
data = connection.describe_policies('PolicyNames' => identity, 'AutoScalingGroupName' => auto_scaling_group).body['DescribePoliciesResult']['ScalingPolicies'].first
|
||||
data = service.describe_policies('PolicyNames' => identity, 'AutoScalingGroupName' => auto_scaling_group).body['DescribePoliciesResult']['ScalingPolicies'].first
|
||||
new(data) unless data.nil?
|
||||
end
|
||||
end
|
||||
|
|
|
@ -31,14 +31,14 @@ module Fog
|
|||
options = Hash[self.class.aliases.map { |key, value| [key, send(value)] }]
|
||||
options.delete_if { |key, value| value.nil? }
|
||||
|
||||
connection.put_scaling_policy(adjustment_type, auto_scaling_group_name, id, scaling_adjustment, options)
|
||||
service.put_scaling_policy(adjustment_type, auto_scaling_group_name, id, scaling_adjustment, options)
|
||||
reload
|
||||
end
|
||||
|
||||
def destroy
|
||||
requires :id
|
||||
requires :auto_scaling_group_name
|
||||
connection.delete_policy(auto_scaling_group_name, id)
|
||||
service.delete_policy(auto_scaling_group_name, id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue