Class: Fog::AWS::AutoScaling::Real
- Inherits:
-
Object
- Object
- Fog::AWS::AutoScaling::Real
- Defined in:
- lib/fog/aws/auto_scaling.rb,
lib/fog/aws/requests/auto_scaling/delete_policy.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/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/describe_auto_scaling_instances.rb,
lib/fog/aws/requests/auto_scaling/describe_metric_collection_types.rb,
lib/fog/aws/requests/auto_scaling/put_scheduled_update_group_action.rb,
lib/fog/aws/requests/auto_scaling/terminate_instance_in_auto_scaling_group.rb
Instance Method Summary collapse
-
#create_auto_scaling_group(auto_scaling_group_name, availability_zones, launch_configuration_name, max_size, min_size, options = {}) ⇒ Object
Creates a new Auto Scaling group with the specified name.
-
#create_launch_configuration(image_id, instance_type, launch_configuration_name, options = {}) ⇒ Object
Creates a new launch configuration.
-
#delete_auto_scaling_group(auto_scaling_group_name) ⇒ Object
Deletes the specified auto scaling group if the group has no instances and no scaling activities in progress.
-
#delete_launch_configuration(launch_configuration_name) ⇒ Object
Deletes the specified launch configuration.
-
#delete_policy(auto_scaling_group_name, policy_name) ⇒ Object
-
policy_name<~String> - The name or PolicyARN of the policy you want to delete.
-
-
#delete_scheduled_action(auto_scaling_group_name, scheduled_action_name) ⇒ Object
Deletes a scheduled action previously created using the put_scheduled_update_group_action.
-
#describe_adjustment_types ⇒ Object
Returns policy adjustment types for use in the put_scaling_policy action.
-
#describe_auto_scaling_groups(options = {}) ⇒ Object
Returns a full description of each Auto Scaling group in the given list.
-
#describe_auto_scaling_instances(options = {}) ⇒ Object
Returns a description of each Auto Scaling instance in the instance_ids list.
-
#describe_launch_configurations(options = {}) ⇒ Object
Returns a full description of the launch configurations given the specified names.
-
#describe_metric_collection_types ⇒ Object
Returns a list of metrics and a corresponding list of granularities for each metric.
-
#describe_policies(options = {}) ⇒ Object
Returns descriptions of what each policy does.
-
#describe_scaling_activities(options = {}) ⇒ Object
Returns the scaling activities for the specified Auto Scaling group.
-
#describe_scaling_process_types ⇒ Object
Returns scaling process types for use in the resume_processes and suspend_processes actions.
-
#describe_scheduled_actions(options = {}) ⇒ Object
List all the actions scheduled for your Auto Scaling group that haven’t been executed.
-
#disable_metrics_collection(auto_scaling_group_name, options = {}) ⇒ Object
Disables monitoring of group metrics for the Auto Scaling group specified in AutoScalingGroupName.
-
#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.
-
#execute_policy(policy_name, options = {}) ⇒ Object
Runs the policy you create for your Auto Scaling group in put_scaling_policy.
-
#initialize(options = {}) ⇒ Real
constructor
Initialize connection to AutoScaling.
-
#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.
-
#put_scheduled_update_group_action(auto_scaling_group_name, scheduled_action_name, time, options = {}) ⇒ Object
Creates a scheduled scaling action for a Auto Scaling group.
- #reload ⇒ Object
-
#resume_processes(auto_scaling_group_name, options = {}) ⇒ Object
Resumes Auto Scaling processes for an Auto Scaling group.
-
#set_desired_capacity(auto_scaling_group_name, desired_capacity, options = {}) ⇒ Object
Adjusts the desired size of the AutoScalingGroup by initiating scaling activities.
-
#set_instance_health(health_status, instance_id, options = {}) ⇒ Object
Sets the health status of an instance.
-
#suspend_processes(auto_scaling_group_name, options = {}) ⇒ Object
Suspends Auto Scaling processes for an Auto Scaling group.
-
#terminate_instance_in_auto_scaling_group(instance_id, should_decrement_desired_capacity) ⇒ Object
Terminates the specified instance.
-
#update_auto_scaling_group(auto_scaling_group_name, options = {}) ⇒ Object
Updates the configuration for the specified AutoScalingGroup.
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.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/fog/aws/auto_scaling.rb', line 69 def initialize(={}) require 'fog/core/parser' @aws_access_key_id = [:aws_access_key_id] @aws_secret_access_key = [:aws_secret_access_key] @hmac = Fog::HMAC.new('sha256', @aws_secret_access_key) [:region] ||= 'us-east-1' @host = [:host] || case [:region] when 'ap-northeast-1' 'autoscaling.ap-northeast-1.amazonaws.com' when 'ap-southeast-1' 'autoscaling.ap-southeast-1.amazonaws.com' when 'eu-west-1' 'autoscaling.eu-west-1.amazonaws.com' when 'us-east-1' 'autoscaling.us-east-1.amazonaws.com' when 'us-west-1' 'autoscaling.us-west-1.amazonaws.com' else raise ArgumentError, "Unknown region: #{[:region].inspect}" end @path = [:path] || '/' @port = [:port] || 443 @scheme = [:scheme] || 'https' @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", [:persistent]) end |
Instance Method Details
#create_auto_scaling_group(auto_scaling_group_name, availability_zones, launch_configuration_name, max_size, min_size, options = {}) ⇒ Object
Creates a new Auto Scaling group with the specified name. Once the creation request is completed, the AutoScalingGroup is ready to be used in other calls.
Parameters
-
auto_scaling_group_name<~String> - The name of the Auto Scaling group.
-
availability_zones<~Array> - A list of availability zones for the Auto Scaling group.
-
launch_configuration_name<~String> - The name of the launch configuration to use with the Auto Scaling group.
-
max_size<~Integer> - The maximum size of the Auto Scaling group.
-
min_size<~Integer> - The minimum size of the Auto Scaling group.
-
options<~Hash>:
-
‘DefaultCooldown’<~Integer> - The amount of time, in seconds, after a scaling activity completes before any further trigger- related scaling activities can start.
-
‘DesiredCapacity’<~Integer> - The number of EC2 instances that should be running in the group. For more information, see set_desired_capacity.
-
‘HealthCheckGracePeriod’<~Integer> - Length of time in seconds after a new EC2 instance comes into service that Auto Scaling starts checking its health.
-
‘HealthCheckType’<~String> - The service you want the health status from, Amazon EC2 or Elastic Load Balancer. Valid values are “EC2” or “ELB”.
-
‘LoadBalancerNames’<~Array> - A list of LoadBalancers to use.
-
‘PlacementGroup’<~String> - Physical location of your cluster
placement group created in Amazon EC2.
-
‘VPCZoneIdentifier’<~String> - Subnet identifier of the Virtual Private Cloud.
-
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘ResponseMetadata’<~Hash>:
-
‘RequestId’<~String> - Id of request
-
-
-
See Also
docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_CreateAutoScalingGroup.html
50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/fog/aws/requests/auto_scaling/create_auto_scaling_group.rb', line 50 def create_auto_scaling_group(auto_scaling_group_name, availability_zones, launch_configuration_name, max_size, min_size, = {}) .merge!(AWS.indexed_param('AvailabilityZones.member.%d', [*availability_zones])) if load_balancer_names = .delete('LoadBalancerNames') .merge!(AWS.indexed_param('LoadBalancerNames.member.%d', [*load_balancer_names])) 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!()) end |
#create_launch_configuration(image_id, instance_type, launch_configuration_name, options = {}) ⇒ Object
Creates a new launch configuration. Once 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.
-
-
‘InstanceMonitoring’<~Hash>:
-
‘Enabled’<~Boolean> - Enabled detailed monitoring.
-
-
‘KernelId’<~String> - The ID of the kernel associated with the EC2 AMI.
-
‘KeyName’<~String> - The name of the EC2 key pair.
-
‘RamdiskId’<~String> - The ID of the RAM disk associated with the EC2 AMI.
-
‘SecurityGroups’<~Array> - The names of the security groups with which to associate EC2 instances.
-
‘UserData’<~String> - User data available to the launched EC2 instances.
-
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘ResponseMetadata’<~Hash>:
-
‘RequestId’<~String> - Id of request
-
-
-
See Also
docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_CreateLaunchConfiguration.html
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/fog/aws/requests/auto_scaling/create_launch_configuration.rb', line 47 def create_launch_configuration(image_id, instance_type, launch_configuration_name, = {}) if block_device_mappings = .delete('BlockDeviceMappings') block_device_mappings.each_with_index do |mapping, i| for key, value in mapping .merge!({ format("BlockDeviceMappings.member.%d.#{key}", i+1) => value }) end end end if security_groups = .delete('SecurityGroups') .merge!(AWS.indexed_param('SecurityGroups.member.%d', [*security_groups])) end if ['UserData'] ['UserData'] = Base64.encode64(['UserData']) end request({ 'Action' => 'CreateLaunchConfiguration', 'ImageId' => image_id, 'InstanceType' => instance_type, 'LaunchConfigurationName' => launch_configuration_name, :parser => Fog::Parsers::AWS::AutoScaling::Basic.new }.merge!()) end |
#delete_auto_scaling_group(auto_scaling_group_name) ⇒ 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.
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘ResponseMetadata’<~Hash>:
-
‘RequestId’<~String> - Id of request
-
-
-
See Also
docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DeleteAutoScalingGroup.html
25 26 27 28 29 30 31 |
# File 'lib/fog/aws/requests/auto_scaling/delete_auto_scaling_group.rb', line 25 def delete_auto_scaling_group(auto_scaling_group_name) request({ 'Action' => 'DeleteAutoScalingGroup', 'AutoScalingGroupName' => auto_scaling_group_name, :parser => Fog::Parsers::AWS::AutoScaling::Basic.new }) 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
28 29 30 31 32 33 34 |
# File 'lib/fog/aws/requests/auto_scaling/delete_launch_configuration.rb', line 28 def delete_launch_configuration(launch_configuration_name) request({ 'Action' => 'DeleteLaunchConfiguration', 'LaunchConfigurationName' => launch_configuration_name, :parser => Fog::Parsers::AWS::AutoScaling::Basic.new }) end |
#delete_policy(auto_scaling_group_name, policy_name) ⇒ Object
-
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
26 27 28 29 30 31 32 33 |
# File 'lib/fog/aws/requests/auto_scaling/delete_policy.rb', line 26 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
27 28 29 30 31 32 33 34 |
# File 'lib/fog/aws/requests/auto_scaling/delete_scheduled_action.rb', line 27 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 |
#describe_adjustment_types ⇒ Object
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
24 25 26 27 28 29 |
# File 'lib/fog/aws/requests/auto_scaling/describe_adjustment_types.rb', line 24 def describe_adjustment_types() request({ 'Action' => 'DescribeAdjustmentTypes', :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> - 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
-
-
‘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 umber of seconds after a scaling activity completes before any further scaling activities can start.
-
‘DesiredCapacity’<~Integer> - Specifies the desired capacity of the AutoScalingGroup.
-
‘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 group.
-
‘MinSize’<~Integer> - The minimum size of the 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.
-
-
-
‘VPCZoneIdentifier’<~String> - The identifier for the VPC connection, if applicable.
-
-
-
‘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_DescribeAutoScalingGroups.html
94 95 96 97 98 99 100 101 102 |
# File 'lib/fog/aws/requests/auto_scaling/describe_auto_scaling_groups.rb', line 94 def describe_auto_scaling_groups( = {}) if auto_scaling_group_names = .delete('AutoScalingGroupNames') .merge!(AWS.indexed_param('AutoScalingGroupNames.member.%d', [*auto_scaling_group_names])) end request({ 'Action' => 'DescribeAutoScalingGroups', :parser => Fog::Parsers::AWS::AutoScaling::DescribeAutoScalingGroups.new }.merge!()) 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
59 60 61 62 63 64 65 66 67 |
# File 'lib/fog/aws/requests/auto_scaling/describe_auto_scaling_instances.rb', line 59 def describe_auto_scaling_instances( = {}) if instance_ids = .delete('InstanceIds') .merge!(AWS.indexed_param('InstanceIds.member.%d', [*instance_ids])) end request({ 'Action' => 'DescribeAutoScalingInstances', :parser => Fog::Parsers::AWS::AutoScaling::DescribeAutoScalingInstances.new }.merge!()) 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
74 75 76 77 78 79 80 81 82 |
# File 'lib/fog/aws/requests/auto_scaling/describe_launch_configurations.rb', line 74 def describe_launch_configurations( = {}) if launch_configuration_names = .delete('LaunchConfigurationNames') .merge!(AWS.indexed_param('LaunchConfigurationNames.member.%d', [*launch_configuration_names])) end request({ 'Action' => 'DescribeLaunchConfigurations', :parser => Fog::Parsers::AWS::AutoScaling::DescribeLaunchConfigurations.new }.merge!()) end |
#describe_metric_collection_types ⇒ Object
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_DescribeAutoScalingInstances.html
26 27 28 29 30 31 |
# File 'lib/fog/aws/requests/auto_scaling/describe_metric_collection_types.rb', line 26 def describe_metric_collection_types() request({ 'Action' => 'DescribeMetricCollectionTypes', :parser => Fog::Parsers::AWS::AutoScaling::DescribeMetricCollectionTypes.new }) 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
63 64 65 66 67 68 69 70 71 |
# File 'lib/fog/aws/requests/auto_scaling/describe_policies.rb', line 63 def describe_policies( = {}) if policy_names = .delete('PolicyNames') .merge!(AWS.indexed_param('PolicyNames.member.%d', [*policy_names])) end request({ 'Action' => 'DescribePolicies', :parser => Fog::Parsers::AWS::AutoScaling::DescribePolicies.new }.merge!()) 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
66 67 68 69 70 71 72 73 74 |
# File 'lib/fog/aws/requests/auto_scaling/describe_scaling_activities.rb', line 66 def describe_scaling_activities( = {}) if activity_ids = .delete('ActivityIds') .merge!(AWS.indexed_param('ActivityIds.member.%d', [*activity_ids])) end request({ 'Action' => 'DescribeScalingActivities', :parser => Fog::Parsers::AWS::AutoScaling::DescribeScalingActivities.new }.merge!()) end |
#describe_scaling_process_types ⇒ Object
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
25 26 27 28 29 30 |
# File 'lib/fog/aws/requests/auto_scaling/describe_scaling_process_types.rb', line 25 def describe_scaling_process_types() request({ 'Action' => 'DescribeScalingProcessTypes', :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.
-
‘MaxSize’<~Integer> - The maximum size of the Auto Scaling group.
-
‘MinSize’<~Integer> - The minimum size of the Auto Scaling group.
-
‘ScheduledActionARN’<~String> - The Amazon Resource Name (ARN) of this scheduled action.
-
‘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
61 62 63 64 65 66 67 68 69 |
# File 'lib/fog/aws/requests/auto_scaling/describe_scheduled_actions.rb', line 61 def describe_scheduled_actions( = {}) if scheduled_action_names = .delete('ScheduledActionNames') .merge!(AWS.indexed_param('ScheduledActionNames.member.%d', [*scheduled_action_names])) end request({ 'Action' => 'DescribeScheduledActions', :parser => Fog::Parsers::AWS::AutoScaling::DescribeScheduledActions.new }.merge!()) 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
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb', line 29 def disable_metrics_collection(auto_scaling_group_name, = {}) if metrics = .delete('Metrics') .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!()) 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
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/fog/aws/requests/auto_scaling/enable_metrics_collection.rb', line 35 def enable_metrics_collection(auto_scaling_group_name, granularity, = {}) if metrics = .delete('Metrics') .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!()) 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
30 31 32 33 34 35 36 |
# File 'lib/fog/aws/requests/auto_scaling/execute_policy.rb', line 30 def execute_policy(policy_name, = {}) request({ 'Action' => 'ExecutePolicy', 'PolicyName' => policy_name, :parser => Fog::Parsers::AWS::AutoScaling::Basic.new }.merge!()) 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
-
-
‘PutScalingPolicyResponse’<~Hash>:
-
‘PolicyARN’<~String> - A policy’s Amazon Resource Name (ARN).
-
-
-
See Also
docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_PutScalingPolicy.html
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/fog/aws/requests/auto_scaling/put_scaling_policy.rb', line 43 def put_scaling_policy(adjustment_type, auto_scaling_group_name, policy_name, scaling_adjustment, = {}) 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!()) end |
#put_scheduled_update_group_action(auto_scaling_group_name, scheduled_action_name, time, 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
-
options<~Hash>:
-
‘DesiredCapacity’<~Integer> - The number of EC2 instances that should be running in this group.
-
‘MaxSize’<~Integer> - The maximum size for the Auto Scaling group.
-
‘MinSize’<~Integer> - The minimum size for the Auto Scaling group.
-
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘ResponseMetadata’<~Hash>:
-
‘RequestId’<~String> - Id of request
-
-
-
See Also
docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_PutScheduledUpdateGroupAction.html
35 36 37 38 39 40 41 42 43 |
# File 'lib/fog/aws/requests/auto_scaling/put_scheduled_update_group_action.rb', line 35 def put_scheduled_update_group_action(auto_scaling_group_name, scheduled_action_name, time, = {}) request({ 'Action' => 'PutScheduledUpdateGroupAction', 'AutoScalingGroupName' => auto_scaling_group_name, 'ScheduledActionName' => scheduled_action_name, 'Time' => time.utc.strftime('%FT%T.%3NZ'), :parser => Fog::Parsers::AWS::AutoScaling::Basic.new }.merge!()) end |
#reload ⇒ Object
97 98 99 |
# File 'lib/fog/aws/auto_scaling.rb', line 97 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
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/fog/aws/requests/auto_scaling/resume_processes.rb', line 27 def resume_processes(auto_scaling_group_name, = {}) if scaling_processes = .delete('ScalingProcesses') .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!()) 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
56 57 58 59 60 61 62 63 |
# File 'lib/fog/aws/requests/auto_scaling/set_desired_capacity.rb', line 56 def set_desired_capacity(auto_scaling_group_name, desired_capacity, = {}) request({ 'Action' => 'SetDesiredCapacity', 'AutoScalingGroupName' => auto_scaling_group_name, 'DesiredCapacity' => desired_capacity, :parser => Fog::Parsers::AWS::AutoScaling::Basic.new }.merge!()) 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
30 31 32 33 34 35 36 37 |
# File 'lib/fog/aws/requests/auto_scaling/set_instance_health.rb', line 30 def set_instance_health(health_status, instance_id, = {}) request({ 'Action' => 'SetInstanceHealth', 'HealthStatus' => health_status, 'InstanceId' => instance_id, :parser => Fog::Parsers::AWS::AutoScaling::Basic.new }.merge!()) 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
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/fog/aws/requests/auto_scaling/suspend_processes.rb', line 30 def suspend_processes(auto_scaling_group_name, = {}) if scaling_processes = .delete('ScalingProcesses') .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!()) 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
44 45 46 47 48 49 50 51 |
# File 'lib/fog/aws/requests/auto_scaling/terminate_instance_in_auto_scaling_group.rb', line 44 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
Updates the configuration for the specified AutoScalingGroup.
The new settings are registered upon the completion of this call. Any launch configuration settings take effect on any triggers after this call returns. Triggers that are currently in progress aren’t affected.
Parameters
-
auto_scaling_group_name<~String> - The name of the Auto Scaling group.
-
options<~Hash>:
-
‘AvailabilityZones’<~Array>: Availability zones for the group
-
‘DefaultCooldown’<~Integer> - Amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start
-
‘DesiredCapacity’<~Integer> - Desired capacity for the scaling group
-
‘HealthCheckGracePeriod’<~Integer> - Length of time that Auto
Scaling waits before checking an instance's health status
-
‘HealthCheckType’<~String> - Service of interest for the health status check, either “EC2” or “ELB”.
-
‘LaunchConfigurationName’<~String> - Name of the launch configuration
-
‘MaxSize’<~Integer> - Maximum size of the Auto Scaling group
-
‘MinSize’<~Integer> - Minimum size of the Auto Scaling group
-
‘PlacementGroup’<~String> - Name of the cluster placement group, if applicable
-
‘VPCZoneIdentifier’<~String> - Identifier for the VPC connection, if applicable
-
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘ResponseMetadata’<~Hash>:
-
‘RequestId’<~String> - Id of request
-
-
-
See Also
docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_UpdateAutoScalingGroup.html
46 47 48 49 50 51 52 53 54 55 |
# File 'lib/fog/aws/requests/auto_scaling/update_auto_scaling_group.rb', line 46 def update_auto_scaling_group(auto_scaling_group_name, = {}) if availability_zones = .delete('AvailabilityZones') .merge!(AWS.indexed_param('AvailabilityZones.member.%d', [*availability_zones])) end request({ 'Action' => 'UpdateAutoScalingGroup', 'AutoScalingGroupName' => auto_scaling_group_name, :parser => Fog::Parsers::AWS::AutoScaling::Basic.new }.merge!()) end |