Class: Fog::AWS::AutoScaling::Real

Inherits:
Object
  • Object
show all
Includes:
CredentialFetcher::ConnectionMethods
Defined in:
lib/fog/aws/auto_scaling.rb,
lib/fog/aws/requests/auto_scaling/delete_tags.rb,
lib/fog/aws/requests/auto_scaling/delete_policy.rb,
lib/fog/aws/requests/auto_scaling/describe_tags.rb,
lib/fog/aws/requests/auto_scaling/execute_policy.rb,
lib/fog/aws/requests/auto_scaling/resume_processes.rb,
lib/fog/aws/requests/auto_scaling/describe_policies.rb,
lib/fog/aws/requests/auto_scaling/suspend_processes.rb,
lib/fog/aws/requests/auto_scaling/put_scaling_policy.rb,
lib/fog/aws/requests/auto_scaling/set_instance_health.rb,
lib/fog/aws/requests/auto_scaling/set_desired_capacity.rb,
lib/fog/aws/requests/auto_scaling/create_or_update_tags.rb,
lib/fog/aws/requests/auto_scaling/delete_scheduled_action.rb,
lib/fog/aws/requests/auto_scaling/create_auto_scaling_group.rb,
lib/fog/aws/requests/auto_scaling/delete_auto_scaling_group.rb,
lib/fog/aws/requests/auto_scaling/describe_adjustment_types.rb,
lib/fog/aws/requests/auto_scaling/enable_metrics_collection.rb,
lib/fog/aws/requests/auto_scaling/update_auto_scaling_group.rb,
lib/fog/aws/requests/auto_scaling/describe_scheduled_actions.rb,
lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb,
lib/fog/aws/requests/auto_scaling/create_launch_configuration.rb,
lib/fog/aws/requests/auto_scaling/delete_launch_configuration.rb,
lib/fog/aws/requests/auto_scaling/describe_scaling_activities.rb,
lib/fog/aws/requests/auto_scaling/describe_auto_scaling_groups.rb,
lib/fog/aws/requests/auto_scaling/describe_launch_configurations.rb,
lib/fog/aws/requests/auto_scaling/describe_scaling_process_types.rb,
lib/fog/aws/requests/auto_scaling/put_notification_configuration.rb,
lib/fog/aws/requests/auto_scaling/describe_auto_scaling_instances.rb,
lib/fog/aws/requests/auto_scaling/describe_metric_collection_types.rb,
lib/fog/aws/requests/auto_scaling/delete_notification_configuration.rb,
lib/fog/aws/requests/auto_scaling/describe_termination_policy_types.rb,
lib/fog/aws/requests/auto_scaling/put_scheduled_update_group_action.rb,
lib/fog/aws/requests/auto_scaling/describe_notification_configurations.rb,
lib/fog/aws/requests/auto_scaling/describe_auto_scaling_notification_types.rb,
lib/fog/aws/requests/auto_scaling/terminate_instance_in_auto_scaling_group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from CredentialFetcher::ConnectionMethods

#refresh_credentials_if_expired

Constructor Details

#initialize(options = {}) ⇒ Real

Initialize connection to AutoScaling

Notes

options parameter must include values for :aws_access_key_id and :aws_secret_access_key in order to create a connection

Examples

as = AutoScaling.new(
 :aws_access_key_id => your_aws_access_key_id,
 :aws_secret_access_key => your_aws_secret_access_key
)

Parameters

  • options<~Hash> - config arguments for connection. Defaults to {}.

Returns

  • AutoScaling object with connection to AWS.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/fog/aws/auto_scaling.rb', line 88

def initialize(options={})
  @use_iam_profile = options[:use_iam_profile]

  @connection_options = options[:connection_options] || {}

  @instrumentor           = options[:instrumentor]
  @instrumentor_name      = options[:instrumentor_name] || 'fog.aws.auto_scaling'

  options[:region] ||= 'us-east-1'
  @region = options[:region]

  @host = options[:host] || "autoscaling.#{options[:region]}.amazonaws.com"
  @path       = options[:path]        || '/'
  @port       = options[:port]        || 443
  @persistent = options[:persistent]  || false
  @scheme     = options[:scheme]      || 'https'
  @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)

  setup_credentials(options)
end

Instance Attribute Details

#regionObject

Returns the value of attribute region.



68
69
70
# File 'lib/fog/aws/auto_scaling.rb', line 68

def region
  @region
end

Instance Method Details

#create_auto_scaling_group(auto_scaling_group_name, availability_zones, launch_configuration_name, max_size, min_size, options = {}) ⇒ Object



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/fog/aws/requests/auto_scaling/create_auto_scaling_group.rb', line 67

def create_auto_scaling_group(auto_scaling_group_name, availability_zones, launch_configuration_name, max_size, min_size, options = {})
  options.merge!(AWS.indexed_param('AvailabilityZones.member.%d', [*availability_zones]))
  options.delete('AvailabilityZones')
  if load_balancer_names = options.delete('LoadBalancerNames')
    options.merge!(AWS.indexed_param('LoadBalancerNames.member.%d', [*load_balancer_names]))
  end

  if tags = options.delete('Tags')
    tags.each_with_index do |(key, value), i|
      options["Tags.member.#{i+1}.Key"] = key.to_s # turns symbol into string
      options["Tags.member.#{i+1}.Value"] = value
    end
  end
  if termination_policies = options.delete('TerminationPolicies')
    options.merge!(AWS.indexed_param('TerminationPolicies.member.%d', [*termination_policies]))
  end

  request({
    'Action'                  => 'CreateAutoScalingGroup',
    'AutoScalingGroupName'    => auto_scaling_group_name,
    'LaunchConfigurationName' => launch_configuration_name,
    'MaxSize'                 => max_size,
    'MinSize'                 => min_size,
    :parser                   => Fog::Parsers::AWS::AutoScaling::Basic.new
  }.merge!(options))
end

#create_launch_configuration(image_id, instance_type, launch_configuration_name, options = {}) ⇒ Object

Creates a new launch configuration. When created, the new launch configuration is available for immediate use.

Parameters

  • image_id<~String> - Unique ID of the Amazon Machine Image (AMI) which was assigned during registration.

  • instance_type<~String> - The instance type of the EC2 instance.

  • launch_configuration_name<~String> - The name of the launch configuration to create.

  • options<~Hash>:

    • ‘BlockDeviceMappings’<~Array>:

      • ‘DeviceName’<~String> - The name of the device within Amazon EC2.

      • ‘Ebs.SnapshotId’<~String> - The snapshot ID.

      • ‘Ebs.VolumeSize’<~Integer> - The volume size, in GigaBytes.

      • ‘VirtualName’<~String> - The virtual name associated with the device.

    • ‘IamInstanceProfile’<~String> The name or the Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance.

    • ‘InstanceMonitoring.Enabled’<~Boolean> - Enables detailed monitoring, which is enabled by default.

    • ‘KernelId’<~String> - The ID of the kernel associated with the Amazon EC2 AMI.

    • ‘KeyName’<~String> - The name of the Amazon EC2 key pair.

    • ‘RamdiskId’<~String> - The ID of the RAM disk associated with the Amazon EC2 AMI.

    • ‘SecurityGroups’<~Array> - The names of the security groups with which to associate Amazon EC2 or Amazon VPC instances.

    • ‘SpotPrice’<~String> - The maximum hourly price to be paid for any Spot Instance launched to fulfill the request. Spot Instances are launched when the price you specify exceeds the current Spot market price.

    • ‘UserData’<~String> - The user data available to the launched Amazon EC2 instances.

    • ‘EbsOptimized’<~Boolean> - Whether the instance is optimized for EBS I/O. Not required, default false.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_CreateLaunchConfiguration.html



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/fog/aws/requests/auto_scaling/create_launch_configuration.rb', line 54

def create_launch_configuration(image_id, instance_type, launch_configuration_name, options = {})
  if block_device_mappings = options.delete('BlockDeviceMappings')
    block_device_mappings.each_with_index do |mapping, i|
      for key, value in mapping
        options.merge!({ format("BlockDeviceMappings.member.%d.#{key}", i+1) => value })
      end
    end
  end
  if security_groups = options.delete('SecurityGroups')
     options.merge!(AWS.indexed_param('SecurityGroups.member.%d', [*security_groups]))
  end
  if options['UserData']
    options['UserData'] = Base64.encode64(options['UserData'])
  end
  request({
    'Action'                  => 'CreateLaunchConfiguration',
    'ImageId'                 => image_id,
    'InstanceType'            => instance_type,
    'LaunchConfigurationName' => launch_configuration_name,
    :parser                   => Fog::Parsers::AWS::AutoScaling::Basic.new
  }.merge!(options))
end

#create_or_update_tags(tags) ⇒ Object

Creates new tags or updates existing tags for an Auto Scaling group.

Parameters

  • tags<~Array>:

    • tag<~Hash>:

      • Key<~String> - The key of the tag.

      • PropagateAtLaunch<~Boolean> - Specifies whether the new tag will be applied to instances launched after the tag is created. The same behavior applies to updates: If you change a tag, the changed tag will be applied to all instances launched after you made the change.

      • ResourceId<~String> - The name of the Auto Scaling group.

      • ResourceType<~String> - The kind of resource to which the tag is applied. Currently, Auto Scaling supports the auto-scaling-group resource type.

      • Value<~String> - The value of the tag.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_CreateOrUpdateTags.html



33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/fog/aws/requests/auto_scaling/create_or_update_tags.rb', line 33

def create_or_update_tags(tags)
  params = {}
  tags.each_with_index do |tag, i|
    tag.each do |key, value|
      params["Tags.member.#{i+1}.#{key}"] = value unless value.nil?
    end
  end
  request({
    'Action' => 'CreateOrUpdateTags',
    :parser  => Fog::Parsers::AWS::AutoScaling::Basic.new
  }.merge!(params))
end

#delete_auto_scaling_group(auto_scaling_group_name, options = {}) ⇒ Object

Deletes the specified auto scaling group if the group has no instances and no scaling activities in progress.

Parameters

  • auto_scaling_group_name<~String> - The name of the Auto Scaling group.

  • options<~Hash>:

    • ‘ForceDelete’<~Boolean> - Starting with API version 2011-01-01, specifies that the Auto Scaling group will be deleted along with all instances associated with the group, without waiting for all instances to be terminated.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DeleteAutoScalingGroup.html



28
29
30
31
32
33
34
# File 'lib/fog/aws/requests/auto_scaling/delete_auto_scaling_group.rb', line 28

def delete_auto_scaling_group(auto_scaling_group_name, options = {})
  request({
    'Action'               => 'DeleteAutoScalingGroup',
    'AutoScalingGroupName' => auto_scaling_group_name,
    :parser                => Fog::Parsers::AWS::AutoScaling::Basic.new
  }.merge!(options))
end

#delete_launch_configuration(launch_configuration_name) ⇒ Object

Deletes the specified launch configuration.

The specified launch configuration must not be attached to an Auto Scaling group. Once this call completes, the launch configuration is no longer available for use.

Parameters

  • launch_configuration_name<~String> - The name of the launch configuration.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DeleteLaunchConfiguration.html



26
27
28
29
30
31
32
# File 'lib/fog/aws/requests/auto_scaling/delete_launch_configuration.rb', line 26

def delete_launch_configuration(launch_configuration_name)
  request({
    'Action'                  => 'DeleteLaunchConfiguration',
    'LaunchConfigurationName' => launch_configuration_name,
    :parser                   => Fog::Parsers::AWS::AutoScaling::Basic.new
  })
end

#delete_notification_configuration(auto_scaling_group_name, topic_arn) ⇒ Object

Deletes notifications created by put_notification_configuration.

Parameters

  • auto_scaling_group_name<~String> - The name of the Auto Scaling group.

  • topic_arn<~String> - The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) topic.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DeleteNotificationConfiguration.html



24
25
26
27
28
29
30
31
# File 'lib/fog/aws/requests/auto_scaling/delete_notification_configuration.rb', line 24

def delete_notification_configuration(auto_scaling_group_name, topic_arn)
  request({
    'Action'               => 'DeleteNotificationConfiguration',
    'AutoScalingGroupName' => auto_scaling_group_name,
    'TopicARN'             => topic_arn,
    :parser                => Fog::Parsers::AWS::AutoScaling::Basic.new
  })
end

#delete_policy(auto_scaling_group_name, policy_name) ⇒ Object

Deletes a policy created by put_scaling_policy

Parameters

  • auto_scaling_group_name<~String> - The name of the Auto Scaling group.

  • policy_name<~String> - The name or PolicyARN of the policy you want to delete.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DeletePolicy.html



24
25
26
27
28
29
30
31
# File 'lib/fog/aws/requests/auto_scaling/delete_policy.rb', line 24

def delete_policy(auto_scaling_group_name, policy_name)
  request({
    'Action'               => 'DeletePolicy',
    'AutoScalingGroupName' => auto_scaling_group_name,
    'PolicyName'           => policy_name,
    :parser                => Fog::Parsers::AWS::AutoScaling::Basic.new
  })
end

#delete_scheduled_action(auto_scaling_group_name, scheduled_action_name) ⇒ Object

Deletes a scheduled action previously created using the put_scheduled_update_group_action.

Parameters

  • auto_scaling_group_name<~String> - The name of the Auto Scaling group.

  • scheduled_action_name<~String> - The name of the action you want to delete.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DeleteScheduledAction.html



25
26
27
28
29
30
31
32
# File 'lib/fog/aws/requests/auto_scaling/delete_scheduled_action.rb', line 25

def delete_scheduled_action(auto_scaling_group_name, scheduled_action_name)
  request({
    'Action'               => 'DeleteScheduledAction',
    'AutoScalingGroupName' => auto_scaling_group_name,
    'ScheduledActionName'  => scheduled_action_name,
    :parser                => Fog::Parsers::AWS::AutoScaling::Basic.new
  })
end

#delete_tags(tags) ⇒ Object

Removes the specified tags or a set of tags from a set of resources.

Parameters

  • tags<~Array>:

    • tag<~Hash>:

      • Key<~String> - The key of the tag.

      • PropagateAtLaunch<~Boolean> - Specifies whether the new tag will be applied to instances launched after the tag is created. The same behavior applies to updates: If you change a tag, the changed tag will be applied to all instances launched after you made the change.

      • ResourceId<~String> - The name of the Auto Scaling group.

      • ResourceType<~String> - The kind of resource to which the tag is applied. Currently, Auto Scaling supports the auto-scaling-group resource type.

      • Value<~String> - The value of the tag.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DeleteTags.html



33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/fog/aws/requests/auto_scaling/delete_tags.rb', line 33

def delete_tags(tags)
  params = {}
  tags.each_with_index do |tag, i|
    tag.each do |key, value|
      params["Tags.member.#{i+1}.#{key}"] = value unless value.nil?
    end
  end
  request({
    'Action' => 'DeleteTags',
    :parser  => Fog::Parsers::AWS::AutoScaling::Basic.new
  }.merge!(params))
end

#describe_adjustment_typesObject

Returns policy adjustment types for use in the put_scaling_policy action.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

      • ‘DescribeAdjustmentTypesResponse’<~Hash>:

        • ‘AdjustmentTypes’<~Array>:

          • ‘AdjustmentType’<~String> - A policy adjustment type.

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DescribeAdjustmentTypes.html



22
23
24
25
26
27
28
# File 'lib/fog/aws/requests/auto_scaling/describe_adjustment_types.rb', line 22

def describe_adjustment_types()
  request({
    'Action'    => 'DescribeAdjustmentTypes',
    :idempotent => true,
    :parser     => Fog::Parsers::AWS::AutoScaling::DescribeAdjustmentTypes.new
  })
end

#describe_auto_scaling_groups(options = {}) ⇒ Object

Returns a full description of each Auto Scaling group in the given list. This includes all Amazon EC2 instances that are members of the group. If a list of names is not provided, the service returns the full details of all Auto Scaling groups.

This action supports pagination by returning a token if there are more pages to retrieve. To get the next page, call this action again with the returned token as the NextToken parameter.

Parameters

  • options<~Hash>:

    • ‘AutoScalingGroupNames’<~Array> - A list of Auto Scaling group names.

    • ‘MaxRecords’<~Integer> - The maximum number of records to return.

    • ‘NextToken’<~String> - A string that marks the start of the next batch of returned results.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

      • ‘DescribeAutoScalingGroupsResponse’<~Hash>:

        • ‘AutoScalingGroups’<~Array>:

          • ‘AutoScalingGroup’<~Hash>:

            • ‘AutoScalingGroupARN’<~String> - The Amazon Resource Name

              (ARN) of the Auto Scaling group.
              
            • ‘AutoScalingGroupName’<~String> - Specifies the name of the group.

            • ‘AvailabilityZones’<~Array> - Contains a list of availability zones for the group.

            • ‘CreatedTime’<~Time> - Specifies the date and time the Auto Scaling group was created.

            • ‘DefaultCooldown’<~Integer> - The number of seconds after a scaling activity completes before any further scaling activities can start.

            • ‘DesiredCapacity’<~Integer> - Specifies the desired capacity of the Auto Scaling group.

            • ‘EnabledMetrics’<~Array>:

              • enabledmetric<~Hash>:

                • ‘Granularity’<~String> - The granularity of the enabled metric.

                • ‘Metrics’<~String> - The name of the enabled metric.

            • ‘HealthCheckGracePeriod’<~Integer>: The length of time that Auto Scaling waits before checking an instance’s health status. The grace period begins when an instance comes into service.

            • ‘HealthCheckType’<~String>: The service of interest for the health status check, either “EC2” for Amazon EC2 or “ELB” for Elastic Load Balancing.

            • ‘Instances’<~Array>:

              • instance<~Hash>:

                • ‘AvailabilityZone’<~String>: Availability zone associated with this instance.

                • ‘HealthStatus’<~String>: The instance’s health status.

                • ‘InstanceId’<~String>: Specifies the EC2 instance ID.

                • ‘LaunchConfigurationName’<~String>: The launch configuration associated with this instance.

                • ‘LifecycleState’<~String>: Contains a description of the current lifecycle state.

            • ‘LaunchConfigurationName’<~String> - Specifies the name of the associated launch configuration.

            • ‘LoadBalancerNames’<~Array> - A list of load balancers associated with this Auto Scaling group.

            • ‘MaxSize’<~Integer> - The maximum size of the Auto Scaling group.

            • ‘MinSize’<~Integer> - The minimum size of the Auto Scaling group.

            • ‘PlacementGroup’<~String> - The name of the cluster placement group, if applicable.

            • ‘SuspendedProcesses’<~Array>:

              • suspendedprocess’<~Hash>:

                • ‘ProcessName’<~String> - The name of the suspended process.

                • ‘SuspensionReason’<~String> - The reason that the process was suspended.

            • ‘TerminationPolicies’<~Array> - A standalone termination policy or a list of termination policies for this Auto Scaling group.

            • ‘VPCZoneIdentifier’<~String> - The subnet identifier for the Amazon VPC connection, if applicable. You can specify several subnets in a comma-separated list.

        • ‘NextToken’<~String> - A string that marks the start of the next batch of returned results.

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DescribeAutoScalingGroups.html



96
97
98
99
100
101
102
103
104
# File 'lib/fog/aws/requests/auto_scaling/describe_auto_scaling_groups.rb', line 96

def describe_auto_scaling_groups(options = {})
  if auto_scaling_group_names = options.delete('AutoScalingGroupNames')
    options.merge!(AWS.indexed_param('AutoScalingGroupNames.member.%d', [*auto_scaling_group_names]))
  end
  request({
    'Action' => 'DescribeAutoScalingGroups',
    :parser  => Fog::Parsers::AWS::AutoScaling::DescribeAutoScalingGroups.new
  }.merge!(options))
end

#describe_auto_scaling_instances(options = {}) ⇒ Object

Returns a description of each Auto Scaling instance in the instance_ids list. If a list is not provided, the service returns the full details of all instances.

This action supports pagination by returning a token if there are more pages to retrieve. To get the next page, call this action again with the returned token as the NextToken parameter.

Parameters

  • options<~Hash>:

    • ‘InstanceIds’<~Array> - The list of Auto Scaling instances to describe. If this list is omitted, all auto scaling instances are described. The list of requested instances cannot contain more than 50 items. If unknown instances are requested, they are ignored with no error.

    • ‘MaxRecords’<~Integer> - The aximum number of Auto Scaling instances to be described with each call.

    • ‘NextToken’<~String> - The token returned by a previous call to indicate that there is more data available.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

      • ‘DescribeAutoScalingInstancesResponse’<~Hash>:

        • ‘AutoScalingInstances’<~Array>:

          • autoscalinginstancedetails<~Hash>:

            • ‘AutoScalingGroupName’<~String> - The name of the Auto Scaling Group associated with this instance.

            • ‘AvailabilityZone’<~String> - The availability zone in which this instance resides.

            • ‘HealthStatus’<~String> - The health status of this instance. “Healthy” means that the instance is healthy and should remain in service. “Unhealthy” means that the instance is unhealthy. Auto Scaling should terminate and replace it.

            • ‘InstanceId’<~String> - The instance’s EC2 instance ID.

            • ‘LaunchConfigurationName’<~String> - The launch

              configuration associated with this instance.
              
            • ‘LifecycleState’<~String> - The life cycle state of this instance.

        • ‘NextToken’<~String> - Acts as a paging mechanism for large result sets. Set to a non-empty string if there are additional results waiting to be returned. Pass this in to subsequent calls to return additional results.

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DescribeAutoScalingInstances.html



57
58
59
60
61
62
63
64
65
# File 'lib/fog/aws/requests/auto_scaling/describe_auto_scaling_instances.rb', line 57

def describe_auto_scaling_instances(options = {})
  if instance_ids = options.delete('InstanceIds')
    options.merge!(AWS.indexed_param('InstanceIds.member.%d', [*instance_ids]))
  end
  request({
    'Action' => 'DescribeAutoScalingInstances',
    :parser  => Fog::Parsers::AWS::AutoScaling::DescribeAutoScalingInstances.new
  }.merge!(options))
end

#describe_auto_scaling_notification_typesObject

Returns a list of all notification types that are supported by Auto Scaling.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

      • ‘DescribeAutoScalingNotificationTypesResult’<~Hash>:

        • ‘AutoScalingNotificationTypes’<~Array>:

          • ‘notificationType’<~String> - A notification type.

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DescribeAutoScalingNotificationTypes.html



22
23
24
25
26
27
28
# File 'lib/fog/aws/requests/auto_scaling/describe_auto_scaling_notification_types.rb', line 22

def describe_auto_scaling_notification_types()
  request({
    'Action'    => 'DescribeAutoScalingNotificationTypes',
    :idempotent => true,
    :parser     => Fog::Parsers::AWS::AutoScaling::DescribeAutoScalingNotificationTypes.new
  })
end

#describe_launch_configurations(options = {}) ⇒ Object

Returns a full description of the launch configurations given the specified names.

If no names are specified, then the full details of all launch configurations are returned.

Parameters

  • options<~Hash>:

    • ‘LaunchConfigurationNames’<~Array> - A list of launch configuration names.

    • ‘MaxRecords’<~Integer> - The maximum number of launch configurations.

    • ‘NextToken’<~String> - The token returned by a previous call to indicate that there is more data available.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

      • ‘DescribeLaunchConfigurationsResponse’<~Hash>:

        • ‘LaunchConfigurations’<~Array>:

          • launchconfiguration’<~Hash>:

            • ‘BlockDeviceMappings’<~Array>:

              • blockdevicemapping<~Hash>:

                • ‘DeviceName’<~String> - The name of the device within EC2.

                • ‘Ebs’<~Hash>:

                  • ‘SnapshotId’<~String> - The snapshot ID

                  • ‘VolumeSize’<~Integer> - The volume size, in GigaBytes.

                • ‘VirtualName’<~String> - The virtual name associated with the device.

            • ‘CreatedTime’<~Time> - Provides the creation date and time for this launch configuration.

            • ‘ImageId’<~String> - Provides the unique ID of the Amazon Machine Image (AMI) that was assigned during registration.

            • ‘InstanceMonitoring’<~Hash>:

              • ‘Enabled’<~Boolean> - If true, instance monitoring is enabled.

            • ‘InstanceType’<~String> - Specifies the instance type of the EC2 instance.

            • ‘KernelId’<~String> - Provides the ID of the kernel associated with the EC2 AMI.

            • ‘KeyName’<~String> - Provides the name of the EC2 key pair.

            • ‘LaunchConfigurationARN’<~String> - The launch configuration’s Amazon Resource Name (ARN).

            • ‘LaunchConfigurationName’<~String> - Specifies the name of the launch configuration.

            • ‘RamdiskId’<~String> - Provides ID of the RAM disk associated with the EC2 AMI.

            • ‘SecurityGroups’<~Array> - A description of the security groups to associate with the EC2 instances.

            • ‘UserData’<~String> - The user data available to the launched EC2 instances.

        • ‘NextToken’<~String> - Acts as a paging mechanism for large result sets. Set to a non-empty string if there are additional results waiting to be returned. Pass this in to subsequent calls to return additional results.

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DescribeLaunchConfigurations.html



72
73
74
75
76
77
78
79
80
# File 'lib/fog/aws/requests/auto_scaling/describe_launch_configurations.rb', line 72

def describe_launch_configurations(options = {})
  if launch_configuration_names = options.delete('LaunchConfigurationNames')
    options.merge!(AWS.indexed_param('LaunchConfigurationNames.member.%d', [*launch_configuration_names]))
  end
  request({
    'Action' => 'DescribeLaunchConfigurations',
    :parser  => Fog::Parsers::AWS::AutoScaling::DescribeLaunchConfigurations.new
  }.merge!(options))
end

#describe_metric_collection_typesObject

Returns a list of metrics and a corresponding list of granularities for each metric.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

      • ‘DescribeMetricCollectionTypesResult’<~Hash>:

        • ‘Granularities’<~Array>:

          • ‘Granularity’<~String> - The granularity of a Metric.

        • ‘Metrics’<~Array>:

          • ‘Metric’<~String> - The name of a Metric.

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DescribeMetricCollectionTypes.html



24
25
26
27
28
29
30
# File 'lib/fog/aws/requests/auto_scaling/describe_metric_collection_types.rb', line 24

def describe_metric_collection_types()
  request({
    'Action'    => 'DescribeMetricCollectionTypes',
    :idempotent => true,
    :parser     => Fog::Parsers::AWS::AutoScaling::DescribeMetricCollectionTypes.new
  })
end

#describe_notification_configurations(options = {}) ⇒ Object

Returns a list of notification actions associated with Auto Scaling groups for specified events.

Parameters

  • options<~Hash>:

    • ‘AutoScalingGroupNames’<~String> - The name of the Auto Scaling group.

    • ‘MaxRecords’<~Integer> - The maximum number of records to return.

    • ‘NextToken’<~String> - A string that is used to mark the start of the next batch of returned results for pagination.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

      • ‘DescribeNotificationConfigurationsResult’<~Hash>:

        • ‘NotificationConfigurations’<~Array>:

          • notificationConfiguration<~Hash>:

            • ‘AutoScalingGroupName’<~String> - Specifies the Auto Scaling group name.

            • ‘NotificationType’<~String> - The types of events for an action to start.

          • ‘TopicARN’<~String> - The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) topic.

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DescribeNotificationConfigurations.html



36
37
38
39
40
41
42
43
44
# File 'lib/fog/aws/requests/auto_scaling/describe_notification_configurations.rb', line 36

def describe_notification_configurations(options = {})
  if auto_scaling_group_names = options.delete('AutoScalingGroupNames')
    options.merge!(AWS.indexed_param('AutoScalingGroupNames.member.%d', [*auto_scaling_group_names]))
  end
  request({
    'Action' => 'DescribeNotificationConfigurations',
    :parser  => Fog::Parsers::AWS::AutoScaling::DescribeNotificationConfigurations.new
  }.merge!(options))
end

#describe_policies(options = {}) ⇒ Object

Returns descriptions of what each policy does. This action supports pagination. If the response includes a token, there are more records available. To get the additional records, repeat the request with the response token as the NextToken parameter.

Parameters

  • options<~Hash>:

    • ‘AutoScalingGroupName’<~String> - The name of the Auto Scaling group.

    • ‘MaxRecords’<~Integer> - The maximum number of policies that will be described with each call.

    • ‘NextToken’<~String> - The token returned by a previous call to indicate that there is more data available.

    • PolicyNames<~Array> - A list of policy names or policy ARNs to be described. If this list is omitted, all policy names are described. If an auto scaling group name is provided, the results are limited to that group.The list of requested policy names cannot contain more than 50 items. If unknown policy names are requested, they are ignored with no error.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

      • ‘DescribePoliciesResult’<~Hash>:

        • ‘ScalingPolicies’<~Array>:

          • ‘AdjustmentType’<~String> - Specifies whether the adjustment is an absolute number or a percentage of the current capacity.

          • ‘Alarms’<~Array>:

            • ‘AlarmARN’<~String> - The Amazon Resource Name (ARN) of the alarm.

            • ‘AlarmName’<~String> - The name of the alarm.

          • ‘AutoScalingGroupName’<~String> - The name of the Auto Scaling group associated with this scaling policy.

          • ‘Cooldown’<~Integer> - The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.

          • ‘PolicyARN’<~String> - The Amazon Resource Name (ARN) of the policy.

          • ‘PolicyName’<~String> - The name of the scaling policy.

          • ‘ScalingAdjustment’<~Integer> - The number associated with the specified AdjustmentType. A positive value adds to the current capacity and a negative value removes from the current capacity.

        • ‘NextToken’<~String> - Acts as a paging mechanism for large result sets. Set to a non-empty string if there are additional results waiting to be returned. Pass this in to subsequent calls to return additional results.

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DescribePolicies.html



61
62
63
64
65
66
67
68
69
# File 'lib/fog/aws/requests/auto_scaling/describe_policies.rb', line 61

def describe_policies(options = {})
  if policy_names = options.delete('PolicyNames')
    options.merge!(AWS.indexed_param('PolicyNames.member.%d', [*policy_names]))
  end
  request({
    'Action' => 'DescribePolicies',
    :parser  => Fog::Parsers::AWS::AutoScaling::DescribePolicies.new
  }.merge!(options))
end

#describe_scaling_activities(options = {}) ⇒ Object

Returns the scaling activities for the specified Auto Scaling group.

If the specified activity_ids list is empty, all the activities from the past six weeks are returned. Activities are sorted by completion time. Activities still in progress appear first on the list.

This action supports pagination. If the response includes a token, there are more records available. To get the additional records, repeat the request with the response token as the NextToken parameter.

Parameters

  • options<~Hash>:

    • ‘ActivityIds’<~Array> - A list containing the activity IDs of the desired scaling activities. If this list is omitted, all activities are described. If an AutoScalingGroupName is provided, the results are limited to that group. The list of requested activities cannot contain more than 50 items. If unknown activities are requested, they are ignored with no error.

    • ‘AutoScalingGroupName’<~String> - The name of the Auto Scaling group.

    • ‘MaxRecords’<~Integer> - The maximum number of scaling activities to return.

    • ‘NextToken’<~String> - The token returned by a previous call to indicate that there is more data available.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

      • ‘DescribeScalingActivitiesResponse’<~Hash>:

        • ‘Activities’<~Array>:

          • ‘ActivityId’<~String> - Specifies the ID of the activity.

          • ‘AutoScalingGroupName’<~String> - The name of the Auto Scaling group.

          • ‘Cause’<~String> - Contins the reason the activity was begun.

          • ‘Description’<~String> - Contains a friendly, more verbose description of the scaling activity.

          • ‘EndTime’<~Time> - Provides the end time of this activity.

          • ‘Progress’<~Integer> - Specifies a value between 0 and 100 that indicates the progress of the activity.

          • ‘StartTime’<~Time> - Provides the start time of this activity.

          • ‘StatusCode’<~String> - Contains the current status of the activity.

          • ‘StatusMessage’<~String> - Contains a friendly, more verbose description of the activity status.

        • ‘NextToken’<~String> - Acts as a paging mechanism for large result sets. Set to a non-empty string if there are additional results waiting to be returned. Pass this in to subsequent calls to return additional results.

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DescribeScalingActivities.html



64
65
66
67
68
69
70
71
72
# File 'lib/fog/aws/requests/auto_scaling/describe_scaling_activities.rb', line 64

def describe_scaling_activities(options = {})
  if activity_ids = options.delete('ActivityIds')
    options.merge!(AWS.indexed_param('ActivityIds.member.%d', [*activity_ids]))
  end
  request({
    'Action' => 'DescribeScalingActivities',
    :parser  => Fog::Parsers::AWS::AutoScaling::DescribeScalingActivities.new
  }.merge!(options))
end

#describe_scaling_process_typesObject

Returns scaling process types for use in the resume_processes and suspend_processes actions.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

      • ‘DescribeScalingProcessTypesResult’<~Hash>:

        • ‘Processes’<~Array>:

          • processtype<~Hash>:

            • ‘ProcessName’<~String> - The name of a process.

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DescribeScalingProcessTypes.html



23
24
25
26
27
28
29
# File 'lib/fog/aws/requests/auto_scaling/describe_scaling_process_types.rb', line 23

def describe_scaling_process_types()
  request({
    'Action'    => 'DescribeScalingProcessTypes',
    :idempotent => true,
    :parser     => Fog::Parsers::AWS::AutoScaling::DescribeScalingProcessTypes.new
  })
end

#describe_scheduled_actions(options = {}) ⇒ Object

List all the actions scheduled for your Auto Scaling group that haven’t been executed. To see a list of action already executed, see the activity record returned in describe_scaling_activities.

Parameters

  • options<~Hash>:

    • ‘AutoScalingGroupName’<~String> - The name of the Auto Scaling group.

    • ‘EndTime’<~Time> - The latest scheduled start time to return. If scheduled action names are provided, this field will be ignored.

    • ‘MaxRecords’<~Integer> - The maximum number of scheduled actions to return.

    • ‘NextToken’<~String> - The token returned by a previous call to indicate that there is more data available.

    • ‘ScheduledActionNames’<~Array> - A list of scheduled actions to be described. If this list is omitted, all scheduled actions are described. The list of requested scheduled actions cannot contain more than 50 items. If an auto scaling group name is provided, the results are limited to that group. If unknown scheduled actions are requested, they are ignored with no error.

    • ‘StartTime’<~Time> - The earliest scheduled start time to return. If scheduled action names are provided, this field will be ignored.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

      • ‘DescribeScheduledActionsResponse’<~Hash>:

        • ‘ScheduledUpdateGroupActions’<~Array>:

          • scheduledupdatesroupAction<~Hash>:

            • ‘AutoScalingGroupName’<~String> - The name of the Auto Scaling group to be updated.

          • ‘DesiredCapacity’<~Integer> -The number of instances you prefer to maintain in your Auto Scaling group.

          • ‘EndTime’<~Time> - The time for this action to end.

          • ‘MaxSize’<~Integer> - The maximum size of the Auto Scaling group.

          • ‘MinSize’<~Integer> - The minimum size of the Auto Scaling group.

          • ‘Recurrence’<~String> - The time when recurring future actions will start. Start time is specified by the user following the Unix cron syntax format.

          • ‘ScheduledActionARN’<~String> - The Amazon Resource Name (ARN) of this scheduled action.

          • ‘StartTime’<~Time> - The time for this action to start.

          • ‘Time’<~Time> - The time that the action is scheduled to occur. This value can be up to one month in the future.

        • ‘NextToken’<~String> - Acts as a paging mechanism for large result sets. Set to a non-empty string if there are additional results waiting to be returned. Pass this in to subsequent calls to return additional results.

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DescribeScheduledActions.html



64
65
66
67
68
69
70
71
72
# File 'lib/fog/aws/requests/auto_scaling/describe_scheduled_actions.rb', line 64

def describe_scheduled_actions(options = {})
  if scheduled_action_names = options.delete('ScheduledActionNames')
    options.merge!(AWS.indexed_param('ScheduledActionNames.member.%d', [*scheduled_action_names]))
  end
  request({
    'Action' => 'DescribeScheduledActions',
    :parser  => Fog::Parsers::AWS::AutoScaling::DescribeScheduledActions.new
  }.merge!(options))
end

#describe_tags(options = {}) ⇒ Object

Lists the Auto Scaling group tags.

Parameters

  • options<~Hash>:

    • tag<~Hash>:

      • Key<~String> - The key of the tag.

      • PropagateAtLaunch<~Boolean> - Specifies whether the new tag will be applied to instances launched after the tag is created. The same behavior applies to updates: If you change a tag, changed tag will be applied to all instances launched after you made the change.

      • ResourceId<~String> - The name of the Auto Scaling group.

      • ResourceType<~String> - The kind of resource to which the tag is applied. Currently, Auto Scaling supports the auto-scaling-group resource type.

      • Value<~String> - The value of the tag.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

      • ‘DescribeTagsResult’<~Hash>:

        • ‘NextToken’<~String> - A string used to mark the start of the next batch of returned results.

        • ‘Tags’<~Hash>:

          • tagDescription<~Hash>:

            • ‘Key’<~String> - The key of the tag.

            • ‘PropagateAtLaunch’<~Boolean> - Specifies whether the new tag will be applied to instances launched after the tag is created. The same behavior applies to updates: If you change a tag, the changed tag will be applied to all instances launched after you made the change.

            • ‘ResourceId’<~String> - The name of the Auto Scaling group.

            • ‘ResourceType’<~String> - The kind of resource to which the tag is applied. Currently, Auto Scaling supports the auto-scaling-group resource type.

            • ‘Value’<~String> - The value of the tag.

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DescribeTags.html



50
51
52
53
54
55
56
57
58
# File 'lib/fog/aws/requests/auto_scaling/describe_tags.rb', line 50

def describe_tags(options={})
  if filters = options.delete('Filters')
    options.merge!(Fog::AWS.indexed_filters(filters))
  end
  request({
    'Action' => 'DescribeTags',
    :parser  => Fog::Parsers::AWS::AutoScaling::DescribeTags.new
  }.merge!(options))
end

#describe_termination_policy_typesObject

Returns a list of all termination policies supported by Auto Scaling.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

      • ‘DescribeTerminationPolicyTypesResult’<~Hash>:

        • ‘TerminationPolicyTypes’<~Array>:

          • terminationtype<~String>:

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DescribeTerminationPolicyTypes.html



21
22
23
24
25
26
27
# File 'lib/fog/aws/requests/auto_scaling/describe_termination_policy_types.rb', line 21

def describe_termination_policy_types()
  request({
    'Action'    => 'DescribeTerminationPolicyTypes',
    :idempotent => true,
    :parser     => Fog::Parsers::AWS::AutoScaling::DescribeTerminationPolicyTypes.new
  })
end

#disable_metrics_collection(auto_scaling_group_name, options = {}) ⇒ Object

Disables monitoring of group metrics for the Auto Scaling group specified in AutoScalingGroupName. You can specify the list of affected metrics with the Metrics parameter.

Parameters

  • ‘AutoScalingGroupName’<~String> - The name or ARN of the Auto Scaling group.

  • options<~Hash>:

    • Metrics<~Array> - The list of metrics to disable. If no metrics are specified, all metrics are disabled.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DisableMetricsCollection.html



27
28
29
30
31
32
33
34
35
36
# File 'lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb', line 27

def disable_metrics_collection(auto_scaling_group_name, options = {})
  if metrics = options.delete('Metrics')
    options.merge!(AWS.indexed_param('Metrics.member.%d', [*metrics]))
  end
  request({
    'Action'               => 'DisableMetricsCollection',
    'AutoScalingGroupName' => auto_scaling_group_name,
    :parser                => Fog::Parsers::AWS::AutoScaling::Basic.new
  }.merge!(options))
end

#enable_metrics_collection(auto_scaling_group_name, granularity, options = {}) ⇒ Object

Enables monitoring of group metrics for the Auto Scaling group specified in auto_scaling_group_name. You can specify the list of enabled metrics with the metrics parameter.

Auto scaling metrics collection can be turned on only if the instance_monitoring.enabled flag, in the Auto Scaling group’s launch configuration, is set to true.

Parameters

  • ‘AutoScalingGroupName’<~String>: The name or ARN of the Auto Scaling group

  • options<~Hash>:

    • Granularity<~String>: The granularity to associate with the metrics to collect.

    • Metrics<~Array>: The list of metrics to collect. If no metrics are specified, all metrics are enabled.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_EnableMetricsCollection.html



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/fog/aws/requests/auto_scaling/enable_metrics_collection.rb', line 33

def enable_metrics_collection(auto_scaling_group_name, granularity, options = {})
  if metrics = options.delete('Metrics')
    options.merge!(AWS.indexed_param('Metrics.member.%d', [*metrics]))
  end
  request({
    'Action'               => 'EnableMetricsCollection',
    'AutoScalingGroupName' => auto_scaling_group_name,
    'Granularity'          => granularity,
    :parser                => Fog::Parsers::AWS::AutoScaling::Basic.new
  }.merge!(options))
end

#execute_policy(policy_name, options = {}) ⇒ Object

Runs the policy you create for your Auto Scaling group in put_scaling_policy.

Parameters

  • ‘PolicyName’<~String> - The name or PolicyARN of the policy you want to run.

  • options<~Hash>:

    • ‘AutoScalingGroupName’<~String> - The name or ARN of the Auto Scaling group.

    • ‘HonorCooldown’<~Boolean> - Set to true if you want Auto Scaling to reject this request if the Auto Scaling group is in cooldown.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_ExecutePolicy.html



28
29
30
31
32
33
34
# File 'lib/fog/aws/requests/auto_scaling/execute_policy.rb', line 28

def execute_policy(policy_name, options = {})
  request({
    'Action'     => 'ExecutePolicy',
    'PolicyName' => policy_name,
    :parser      => Fog::Parsers::AWS::AutoScaling::Basic.new
  }.merge!(options))
end

#put_notification_configuration(auto_scaling_group_name, notification_types, topic_arn) ⇒ Object

Creates a notification configuration for an Auto Scaling group. To update an existing policy, overwrite the existing notification configuration name and set the parameter(s) you want to change.

Parameters

  • auto_scaling_group_name<~String> - The name of the Auto Scaling group.

  • notification_types<~Array> - The type of events that will trigger the notification.

  • topic_arn<~String> - The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) topic.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_PutNotificationConfiguration.html



27
28
29
30
31
32
33
34
35
# File 'lib/fog/aws/requests/auto_scaling/put_notification_configuration.rb', line 27

def put_notification_configuration(auto_scaling_group_name, notification_types, topic_arn)
  params = AWS.indexed_param('NotificationTypes.member.%d', [*notification_types])
  request({
    'Action'               => 'PutNotificationConfiguration',
    'AutoScalingGroupName' => auto_scaling_group_name,
    'TopicARN'             => topic_arn,
    :parser                => Fog::Parsers::AWS::AutoScaling::PutNotificationConfiguration.new
  }.merge!(params))
end

#put_scaling_policy(adjustment_type, auto_scaling_group_name, policy_name, scaling_adjustment, options = {}) ⇒ Object

Creates or updates a policy for an Auto Scaling group. To update an existing policy, use the existing policy name and set the parameter(s) you want to change. Any existing parameter not changed in an update to an existing policy is not changed in this update request.

Parameters

  • adjustment_type<~String> - Specifies whether the scaling_adjustment is an absolute number or a percentage of the current capacity.

  • auto_scaling_group_name<~String> - The name or ARN of the Auto Scaling group.

  • policy_name<~String> - The name of the policy you want to create or update.

  • scaling_adjustment<~Integer> - The number of instances by which to scale. AdjustmentType determines the interpretation of this number (e.g., as an absolute number or as a percentage of the existing Auto Scaling group size). A positive increment adds to the current capacity and a negative value removes from the current capacity.

  • options<~Hash>:

    • ‘CoolDown’<~Integer> - The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

      • ‘PutScalingPolicyResult’<~Hash>:

        • ‘PolicyARN’<~String> - A policy’s Amazon Resource Name (ARN).

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_PutScalingPolicy.html



41
42
43
44
45
46
47
48
49
50
# File 'lib/fog/aws/requests/auto_scaling/put_scaling_policy.rb', line 41

def put_scaling_policy(adjustment_type, auto_scaling_group_name, policy_name, scaling_adjustment, options = {})
  request({
    'Action'               => 'PutScalingPolicy',
    'AdjustmentType'       => adjustment_type,
    'AutoScalingGroupName' => auto_scaling_group_name,
    'PolicyName'           => policy_name,
    'ScalingAdjustment'    => scaling_adjustment,
    :parser                => Fog::Parsers::AWS::AutoScaling::PutScalingPolicy.new
  }.merge!(options))
end

#put_scheduled_update_group_action(auto_scaling_group_name, scheduled_action_name, time = nil, options = {}) ⇒ Object

Creates a scheduled scaling action for a Auto Scaling group. If you leave a parameter unspecified, the corresponding value remains unchanged in the affected Auto Scaling group.

Parameters

  • auto_scaling_group_name<~String> - The name or ARN of the Auto Scaling Group.

  • scheduled_action_name<~String> - Name of this scaling action.

  • time<~Datetime> - The time for this action to start (deprecated: use StartTime, EndTime and Recurrence).

  • options<~Hash>:

    • ‘DesiredCapacity’<~Integer> - The number of EC2 instances that should be running in this group.

    • ‘EndTime’<~DateTime> - The time for this action to end.

    • ‘MaxSize’<~Integer> - The maximum size for the Auto Scaling group.

    • ‘MinSize’<~Integer> - The minimum size for the Auto Scaling group.

    • ‘Recurrence’<~String> - The time when recurring future actions will start. Start time is specified by the user following the Unix cron syntax format. When StartTime and EndTime are specified with Recurrence, they form the boundaries of when the recurring action will start and stop.

    • ‘StartTime’<~DateTime> - The time for this action to start

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_PutScheduledUpdateGroupAction.html



41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/fog/aws/requests/auto_scaling/put_scheduled_update_group_action.rb', line 41

def put_scheduled_update_group_action(auto_scaling_group_name, scheduled_action_name, time=nil, options = {})
  # The 'Time' paramenter is now an alias for StartTime and needs to be identical if specified.
  time = options['StartTime'].nil? ? time : options['StartTime']
  if !time.nil?
    time = time.class == Time ? time.utc.iso8601 : Time.parse(time).utc.iso8601
  end
  request({
    'Action'               => 'PutScheduledUpdateGroupAction',
    'AutoScalingGroupName' => auto_scaling_group_name,
    'ScheduledActionName'  => scheduled_action_name,
    'Time'                 => time,
    :parser                => Fog::Parsers::AWS::AutoScaling::Basic.new
  }.merge!(options))
end

#reloadObject



109
110
111
# File 'lib/fog/aws/auto_scaling.rb', line 109

def reload
  @connection.reset
end

#resume_processes(auto_scaling_group_name, options = {}) ⇒ Object

Resumes Auto Scaling processes for an Auto Scaling group.

Parameters

  • auto_scaling_group_name’<~String> - The name or Amazon Resource Name (ARN) of the Auto Scaling group.

  • options<~Hash>:

    • ‘ScalingProcesses’<~Array> - The processes that you want to resume. To resume all process types, omit this parameter.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_ResumeProcesses.html



25
26
27
28
29
30
31
32
33
34
# File 'lib/fog/aws/requests/auto_scaling/resume_processes.rb', line 25

def resume_processes(auto_scaling_group_name, options = {})
  if scaling_processes = options.delete('ScalingProcesses')
    options.merge!(AWS.indexed_param('ScalingProcesses.member.%d', [*scaling_processes]))
  end
  request({
    'Action'               => 'ResumeProcesses',
    'AutoScalingGroupName' => auto_scaling_group_name,
    :parser                => Fog::Parsers::AWS::AutoScaling::Basic.new
  }.merge!(options))
end

#set_desired_capacity(auto_scaling_group_name, desired_capacity, options = {}) ⇒ Object

Adjusts the desired size of the AutoScalingGroup by initiating scaling activities. When reducing the size of the group, it is not possible to define which EC2 instances will be terminated. This applies to any auto-scaling decisions that might result in terminating instances.

There are two common use cases for set_desired_capacity: one for users of the Auto Scaling triggering system, and another for developers who write their own triggering systems. Both use cases relate to the concept of cooldown.

In the first case, if you use the Auto Scaling triggering system, set_desired_capacity changes the size of your Auto Scaling group without regard to the cooldown period. This could be useful, for example, if Auto Scaling did something unexpected for some reason. If your cooldown period is 10 minutes, Auto Scaling would normally reject requests to change the size of the group for that entire 10 minute period. The set_desired_capacity command allows you to circumvent this restriction and change the size of the group before the end of the cooldown period.

In the second case, if you write your own triggering system, you can use set_desired_capacity to control the size of your Auto Scaling group. If you want the same cooldown functionality that Auto Scaling offers, you can configure set_desired_capacity to honor cooldown by setting the HonorCooldown parameter to true.

Parameters

  • auto_scaling_group_name<~String> - The name of the Auto Scaling group.

  • desired_capacity<~Integer> - The new capacity setting for the Auto Scaling group.

  • options<~Hash>:

    • ‘HonorCooldown’<~Boolean> - By default, set_desired_capacity overrides any cooldown period. Set to true if you want Auto Scaling to reject this request if the Auto Scaling group is in cooldown.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_SetDesiredCapacity.html



54
55
56
57
58
59
60
61
# File 'lib/fog/aws/requests/auto_scaling/set_desired_capacity.rb', line 54

def set_desired_capacity(auto_scaling_group_name, desired_capacity, options = {})
  request({
    'Action'               => 'SetDesiredCapacity',
    'AutoScalingGroupName' => auto_scaling_group_name,
    'DesiredCapacity'      => desired_capacity,
    :parser                => Fog::Parsers::AWS::AutoScaling::Basic.new
  }.merge!(options))
end

#set_instance_health(health_status, instance_id, options = {}) ⇒ Object

Sets the health status of an instance.

Parameters

  • health_status<~String> - The health status of the instance. “Healthy” means that the instance is healthy and should remain in service. “Unhealthy” means that the instance is unhealthy. Auto Scaling should terminate and replace it.

  • instance_id<~String> - The identifier of the EC2 instance.

  • options<~Hash>:

    • ‘ShouldRespectGracePeriod’<~Boolean> - If true, this call should

    respect the grace period associated with the group.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_SetInstanceHealth.html



28
29
30
31
32
33
34
35
# File 'lib/fog/aws/requests/auto_scaling/set_instance_health.rb', line 28

def set_instance_health(health_status, instance_id, options = {})
  request({
    'Action'       => 'SetInstanceHealth',
    'HealthStatus' => health_status,
    'InstanceId'   => instance_id,
    :parser        => Fog::Parsers::AWS::AutoScaling::Basic.new
  }.merge!(options))
end

#suspend_processes(auto_scaling_group_name, options = {}) ⇒ Object

Suspends Auto Scaling processes for an Auto Scaling group. To suspend specific process types, specify them by name with the ScalingProcesses parameter. To suspend all process types, omit the ScalingProcesses.member.N parameter.

Parameters

  • ‘AutoScalingGroupName’<~String> - The name or Amazon Resource Name (ARN) of the Auto Scaling group.

  • options<~Hash>:

    • ‘ScalingProcesses’<~Array> - The processes that you want to suspend. To suspend all process types, omit this parameter.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_SuspendProcesses.html



28
29
30
31
32
33
34
35
36
37
# File 'lib/fog/aws/requests/auto_scaling/suspend_processes.rb', line 28

def suspend_processes(auto_scaling_group_name, options = {})
  if scaling_processes = options.delete('ScalingProcesses')
    options.merge!(AWS.indexed_param('ScalingProcesses.member.%d', [*scaling_processes]))
  end
  request({
    'Action'               => 'SuspendProcesses',
    'AutoScalingGroupName' => auto_scaling_group_name,
    :parser                => Fog::Parsers::AWS::AutoScaling::Basic.new
  }.merge!(options))
end

#terminate_instance_in_auto_scaling_group(instance_id, should_decrement_desired_capacity) ⇒ Object

Terminates the specified instance. Optionally, the desired group size can be adjusted.

Parameters

  • instance_id<~String> - The ID of the EC2 instance to be terminated.

  • should_decrement_desired_capacity<~Boolean> - Specifies whether (true) or not (false) terminating this instance should also decrement the size of the AutoScalingGroup.

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘ResponseMetadata’<~Hash>:

        • ‘RequestId’<~String> - Id of request

      • ‘TerminateGroupInAutoScalingInstanceResult’<~Hash>:

        • ‘ActivityId’<~String> - Specifies the ID of the activity.

        • ‘AutoScalingGroupName’<~String> - The name of the Auto Scaling group.

        • ‘Cause’<~String> - Contains the reason the activity was begun.

        • ‘Description’<~String> - Contains a friendly, more verbose description of the scaling activity.

        • ‘EndTime’<~Time> - Provides the end time of this activity.

        • ‘Progress’<~Integer> - Specifies a value between 0 and 100 that indicates the progress of the activity.

        • ‘StartTime’<~Time> - Provides the start time of this activity.

        • ‘StatusCode’<~String> - Contains the current status of the activity.

        • ‘StatusMessage’<~String> - Contains a friendly, more verbose description of the activity status.

See Also

docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_TerminateInstanceInAutoScalingGroup.html



42
43
44
45
46
47
48
49
# File 'lib/fog/aws/requests/auto_scaling/terminate_instance_in_auto_scaling_group.rb', line 42

def terminate_instance_in_auto_scaling_group(instance_id, should_decrement_desired_capacity)
  request({
    'Action'                         => 'TerminateInstanceInAutoScalingGroup',
    'InstanceId'                     => instance_id,
    'ShouldDecrementDesiredCapacity' => should_decrement_desired_capacity.to_s,
    :parser                          => Fog::Parsers::AWS::AutoScaling::TerminateInstanceInAutoScalingGroup.new
  })
end

#update_auto_scaling_group(auto_scaling_group_name, options = {}) ⇒ Object



56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/fog/aws/requests/auto_scaling/update_auto_scaling_group.rb', line 56

def update_auto_scaling_group(auto_scaling_group_name, options = {})
  if availability_zones = options.delete('AvailabilityZones')
    options.merge!(AWS.indexed_param('AvailabilityZones.member.%d', [*availability_zones]))
  end
  if termination_policies = options.delete('TerminationPolicies')
    options.merge!(AWS.indexed_param('TerminationPolicies.member.%d', [*termination_policies]))
  end
  request({
    'Action'               => 'UpdateAutoScalingGroup',
    'AutoScalingGroupName' => auto_scaling_group_name,
    :parser                => Fog::Parsers::AWS::AutoScaling::Basic.new
  }.merge!(options))
end