You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::AutoScalingPlans::Client

Inherits:
Seahorse::Client::Base show all
Includes:
ClientStubs
Defined in:
gems/aws-sdk-autoscalingplans/lib/aws-sdk-autoscalingplans/client.rb

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from ClientStubs

#api_requests, #stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(*args) ⇒ Client

Returns a new instance of Client

Parameters:

  • options (Hash)

    a customizable set of options



183
184
185
# File 'gems/aws-sdk-autoscalingplans/lib/aws-sdk-autoscalingplans/client.rb', line 183

def initialize(*args)
  super
end

Instance Method Details

#create_scaling_plan(params = {}) ⇒ Types::CreateScalingPlanResponse

Creates a scaling plan.

A scaling plan contains a set of instructions used to configure dynamic scaling for the scalable resources in your application. AWS Auto Scaling creates target tracking scaling policies based on the scaling instructions in your scaling plan.

Examples:

Request syntax with placeholder values


resp = client.create_scaling_plan({
  scaling_plan_name: "ScalingPlanName", # required
  application_source: { # required
    cloud_formation_stack_arn: "XmlString",
    tag_filters: [
      {
        key: "XmlStringMaxLen128",
        values: ["XmlStringMaxLen256"],
      },
    ],
  },
  scaling_instructions: [ # required
    {
      service_namespace: "autoscaling", # required, accepts autoscaling, ecs, ec2, rds, dynamodb
      resource_id: "ResourceIdMaxLen1600", # required
      scalable_dimension: "autoscaling:autoScalingGroup:DesiredCapacity", # required, accepts autoscaling:autoScalingGroup:DesiredCapacity, ecs:service:DesiredCount, ec2:spot-fleet-request:TargetCapacity, rds:cluster:ReadReplicaCount, dynamodb:table:ReadCapacityUnits, dynamodb:table:WriteCapacityUnits, dynamodb:index:ReadCapacityUnits, dynamodb:index:WriteCapacityUnits
      min_capacity: 1, # required
      max_capacity: 1, # required
      target_tracking_configurations: [ # required
        {
          predefined_scaling_metric_specification: {
            predefined_scaling_metric_type: "ASGAverageCPUUtilization", # required, accepts ASGAverageCPUUtilization, ASGAverageNetworkIn, ASGAverageNetworkOut, DynamoDBReadCapacityUtilization, DynamoDBWriteCapacityUtilization, ECSServiceAverageCPUUtilization, ECSServiceAverageMemoryUtilization, ALBRequestCountPerTarget, RDSReaderAverageCPUUtilization, RDSReaderAverageDatabaseConnections, EC2SpotFleetRequestAverageCPUUtilization, EC2SpotFleetRequestAverageNetworkIn, EC2SpotFleetRequestAverageNetworkOut
            resource_label: "ResourceLabel",
          },
          customized_scaling_metric_specification: {
            metric_name: "MetricName", # required
            namespace: "MetricNamespace", # required
            dimensions: [
              {
                name: "MetricDimensionName", # required
                value: "MetricDimensionValue", # required
              },
            ],
            statistic: "Average", # required, accepts Average, Minimum, Maximum, SampleCount, Sum
            unit: "MetricUnit",
          },
          target_value: 1.0, # required
          disable_scale_in: false,
          scale_out_cooldown: 1,
          scale_in_cooldown: 1,
          estimated_instance_warmup: 1,
        },
      ],
    },
  ],
})

Response structure


resp.scaling_plan_version #=> Integer

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :scaling_plan_name (required, String)

    The name of the scaling plan. Names cannot contain vertical bars, colons, or forward slashes.

  • :application_source (required, Types::ApplicationSource)

    A CloudFormation stack or set of tags. You can create one scaling plan per application source.

  • :scaling_instructions (required, Array<Types::ScalingInstruction>)

    The scaling instructions.

Returns:

See Also:



268
269
270
271
# File 'gems/aws-sdk-autoscalingplans/lib/aws-sdk-autoscalingplans/client.rb', line 268

def create_scaling_plan(params = {}, options = {})
  req = build_request(:create_scaling_plan, params)
  req.send_request(options)
end

#delete_scaling_plan(params = {}) ⇒ Struct

Deletes the specified scaling plan.

Examples:

Request syntax with placeholder values


resp = client.delete_scaling_plan({
  scaling_plan_name: "ScalingPlanName", # required
  scaling_plan_version: 1, # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :scaling_plan_name (required, String)

    The name of the scaling plan.

  • :scaling_plan_version (required, Integer)

    The version of the scaling plan.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



294
295
296
297
# File 'gems/aws-sdk-autoscalingplans/lib/aws-sdk-autoscalingplans/client.rb', line 294

def delete_scaling_plan(params = {}, options = {})
  req = build_request(:delete_scaling_plan, params)
  req.send_request(options)
end

#describe_scaling_plan_resources(params = {}) ⇒ Types::DescribeScalingPlanResourcesResponse

Describes the scalable resources in the specified scaling plan.

Examples:

Request syntax with placeholder values


resp = client.describe_scaling_plan_resources({
  scaling_plan_name: "ScalingPlanName", # required
  scaling_plan_version: 1, # required
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.scaling_plan_resources #=> Array
resp.scaling_plan_resources[0].scaling_plan_name #=> String
resp.scaling_plan_resources[0].scaling_plan_version #=> Integer
resp.scaling_plan_resources[0].service_namespace #=> String, one of "autoscaling", "ecs", "ec2", "rds", "dynamodb"
resp.scaling_plan_resources[0].resource_id #=> String
resp.scaling_plan_resources[0].scalable_dimension #=> String, one of "autoscaling:autoScalingGroup:DesiredCapacity", "ecs:service:DesiredCount", "ec2:spot-fleet-request:TargetCapacity", "rds:cluster:ReadReplicaCount", "dynamodb:table:ReadCapacityUnits", "dynamodb:table:WriteCapacityUnits", "dynamodb:index:ReadCapacityUnits", "dynamodb:index:WriteCapacityUnits"
resp.scaling_plan_resources[0].scaling_policies #=> Array
resp.scaling_plan_resources[0].scaling_policies[0].policy_name #=> String
resp.scaling_plan_resources[0].scaling_policies[0].policy_type #=> String, one of "TargetTrackingScaling"
resp.scaling_plan_resources[0].scaling_policies[0].target_tracking_configuration.predefined_scaling_metric_specification.predefined_scaling_metric_type #=> String, one of "ASGAverageCPUUtilization", "ASGAverageNetworkIn", "ASGAverageNetworkOut", "DynamoDBReadCapacityUtilization", "DynamoDBWriteCapacityUtilization", "ECSServiceAverageCPUUtilization", "ECSServiceAverageMemoryUtilization", "ALBRequestCountPerTarget", "RDSReaderAverageCPUUtilization", "RDSReaderAverageDatabaseConnections", "EC2SpotFleetRequestAverageCPUUtilization", "EC2SpotFleetRequestAverageNetworkIn", "EC2SpotFleetRequestAverageNetworkOut"
resp.scaling_plan_resources[0].scaling_policies[0].target_tracking_configuration.predefined_scaling_metric_specification.resource_label #=> String
resp.scaling_plan_resources[0].scaling_policies[0].target_tracking_configuration.customized_scaling_metric_specification.metric_name #=> String
resp.scaling_plan_resources[0].scaling_policies[0].target_tracking_configuration.customized_scaling_metric_specification.namespace #=> String
resp.scaling_plan_resources[0].scaling_policies[0].target_tracking_configuration.customized_scaling_metric_specification.dimensions #=> Array
resp.scaling_plan_resources[0].scaling_policies[0].target_tracking_configuration.customized_scaling_metric_specification.dimensions[0].name #=> String
resp.scaling_plan_resources[0].scaling_policies[0].target_tracking_configuration.customized_scaling_metric_specification.dimensions[0].value #=> String
resp.scaling_plan_resources[0].scaling_policies[0].target_tracking_configuration.customized_scaling_metric_specification.statistic #=> String, one of "Average", "Minimum", "Maximum", "SampleCount", "Sum"
resp.scaling_plan_resources[0].scaling_policies[0].target_tracking_configuration.customized_scaling_metric_specification.unit #=> String
resp.scaling_plan_resources[0].scaling_policies[0].target_tracking_configuration.target_value #=> Float
resp.scaling_plan_resources[0].scaling_policies[0].target_tracking_configuration.disable_scale_in #=> Boolean
resp.scaling_plan_resources[0].scaling_policies[0].target_tracking_configuration.scale_out_cooldown #=> Integer
resp.scaling_plan_resources[0].scaling_policies[0].target_tracking_configuration.scale_in_cooldown #=> Integer
resp.scaling_plan_resources[0].scaling_policies[0].target_tracking_configuration.estimated_instance_warmup #=> Integer
resp.scaling_plan_resources[0].scaling_status_code #=> String, one of "Inactive", "PartiallyActive", "Active"
resp.scaling_plan_resources[0].scaling_status_message #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :scaling_plan_name (required, String)

    The name of the scaling plan.

  • :scaling_plan_version (required, Integer)

    The version of the scaling plan.

  • :max_results (Integer)

    The maximum number of scalable resources to return. This value can be between 1 and 50. The default value is 50.

  • :next_token (String)

    The token for the next set of results.

Returns:

See Also:



361
362
363
364
# File 'gems/aws-sdk-autoscalingplans/lib/aws-sdk-autoscalingplans/client.rb', line 361

def describe_scaling_plan_resources(params = {}, options = {})
  req = build_request(:describe_scaling_plan_resources, params)
  req.send_request(options)
end

#describe_scaling_plans(params = {}) ⇒ Types::DescribeScalingPlansResponse

Describes the specified scaling plans or all of your scaling plans.

Examples:

Request syntax with placeholder values


resp = client.describe_scaling_plans({
  scaling_plan_names: ["ScalingPlanName"],
  scaling_plan_version: 1,
  application_sources: [
    {
      cloud_formation_stack_arn: "XmlString",
      tag_filters: [
        {
          key: "XmlStringMaxLen128",
          values: ["XmlStringMaxLen256"],
        },
      ],
    },
  ],
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.scaling_plans #=> Array
resp.scaling_plans[0].scaling_plan_name #=> String
resp.scaling_plans[0].scaling_plan_version #=> Integer
resp.scaling_plans[0].application_source.cloud_formation_stack_arn #=> String
resp.scaling_plans[0].application_source.tag_filters #=> Array
resp.scaling_plans[0].application_source.tag_filters[0].key #=> String
resp.scaling_plans[0].application_source.tag_filters[0].values #=> Array
resp.scaling_plans[0].application_source.tag_filters[0].values[0] #=> String
resp.scaling_plans[0].scaling_instructions #=> Array
resp.scaling_plans[0].scaling_instructions[0].service_namespace #=> String, one of "autoscaling", "ecs", "ec2", "rds", "dynamodb"
resp.scaling_plans[0].scaling_instructions[0].resource_id #=> String
resp.scaling_plans[0].scaling_instructions[0].scalable_dimension #=> String, one of "autoscaling:autoScalingGroup:DesiredCapacity", "ecs:service:DesiredCount", "ec2:spot-fleet-request:TargetCapacity", "rds:cluster:ReadReplicaCount", "dynamodb:table:ReadCapacityUnits", "dynamodb:table:WriteCapacityUnits", "dynamodb:index:ReadCapacityUnits", "dynamodb:index:WriteCapacityUnits"
resp.scaling_plans[0].scaling_instructions[0].min_capacity #=> Integer
resp.scaling_plans[0].scaling_instructions[0].max_capacity #=> Integer
resp.scaling_plans[0].scaling_instructions[0].target_tracking_configurations #=> Array
resp.scaling_plans[0].scaling_instructions[0].target_tracking_configurations[0].predefined_scaling_metric_specification.predefined_scaling_metric_type #=> String, one of "ASGAverageCPUUtilization", "ASGAverageNetworkIn", "ASGAverageNetworkOut", "DynamoDBReadCapacityUtilization", "DynamoDBWriteCapacityUtilization", "ECSServiceAverageCPUUtilization", "ECSServiceAverageMemoryUtilization", "ALBRequestCountPerTarget", "RDSReaderAverageCPUUtilization", "RDSReaderAverageDatabaseConnections", "EC2SpotFleetRequestAverageCPUUtilization", "EC2SpotFleetRequestAverageNetworkIn", "EC2SpotFleetRequestAverageNetworkOut"
resp.scaling_plans[0].scaling_instructions[0].target_tracking_configurations[0].predefined_scaling_metric_specification.resource_label #=> String
resp.scaling_plans[0].scaling_instructions[0].target_tracking_configurations[0].customized_scaling_metric_specification.metric_name #=> String
resp.scaling_plans[0].scaling_instructions[0].target_tracking_configurations[0].customized_scaling_metric_specification.namespace #=> String
resp.scaling_plans[0].scaling_instructions[0].target_tracking_configurations[0].customized_scaling_metric_specification.dimensions #=> Array
resp.scaling_plans[0].scaling_instructions[0].target_tracking_configurations[0].customized_scaling_metric_specification.dimensions[0].name #=> String
resp.scaling_plans[0].scaling_instructions[0].target_tracking_configurations[0].customized_scaling_metric_specification.dimensions[0].value #=> String
resp.scaling_plans[0].scaling_instructions[0].target_tracking_configurations[0].customized_scaling_metric_specification.statistic #=> String, one of "Average", "Minimum", "Maximum", "SampleCount", "Sum"
resp.scaling_plans[0].scaling_instructions[0].target_tracking_configurations[0].customized_scaling_metric_specification.unit #=> String
resp.scaling_plans[0].scaling_instructions[0].target_tracking_configurations[0].target_value #=> Float
resp.scaling_plans[0].scaling_instructions[0].target_tracking_configurations[0].disable_scale_in #=> Boolean
resp.scaling_plans[0].scaling_instructions[0].target_tracking_configurations[0].scale_out_cooldown #=> Integer
resp.scaling_plans[0].scaling_instructions[0].target_tracking_configurations[0].scale_in_cooldown #=> Integer
resp.scaling_plans[0].scaling_instructions[0].target_tracking_configurations[0].estimated_instance_warmup #=> Integer
resp.scaling_plans[0].status_code #=> String, one of "Active", "ActiveWithProblems", "CreationInProgress", "CreationFailed", "DeletionInProgress", "DeletionFailed", "UpdateInProgress", "UpdateFailed"
resp.scaling_plans[0].status_message #=> String
resp.scaling_plans[0].status_start_time #=> Time
resp.scaling_plans[0].creation_time #=> Time
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :scaling_plan_names (Array<String>)

    The names of the scaling plans (up to 10). If you specify application sources, you cannot specify scaling plan names.

  • :scaling_plan_version (Integer)

    The version of the scaling plan. If you specify a scaling plan version, you must also specify a scaling plan name.

  • :application_sources (Array<Types::ApplicationSource>)

    The sources for the applications (up to 10). If you specify scaling plan names, you cannot specify application sources.

  • :max_results (Integer)

    The maximum number of scalable resources to return. This value can be between 1 and 50. The default value is 50.

  • :next_token (String)

    The token for the next set of results.

Returns:

See Also:



453
454
455
456
# File 'gems/aws-sdk-autoscalingplans/lib/aws-sdk-autoscalingplans/client.rb', line 453

def describe_scaling_plans(params = {}, options = {})
  req = build_request(:describe_scaling_plans, params)
  req.send_request(options)
end

#update_scaling_plan(params = {}) ⇒ Struct

Updates the scaling plan for the specified scaling plan.

You cannot update a scaling plan if it is in the process of being created, updated, or deleted.

Examples:

Request syntax with placeholder values


resp = client.update_scaling_plan({
  application_source: {
    cloud_formation_stack_arn: "XmlString",
    tag_filters: [
      {
        key: "XmlStringMaxLen128",
        values: ["XmlStringMaxLen256"],
      },
    ],
  },
  scaling_plan_name: "ScalingPlanName", # required
  scaling_instructions: [
    {
      service_namespace: "autoscaling", # required, accepts autoscaling, ecs, ec2, rds, dynamodb
      resource_id: "ResourceIdMaxLen1600", # required
      scalable_dimension: "autoscaling:autoScalingGroup:DesiredCapacity", # required, accepts autoscaling:autoScalingGroup:DesiredCapacity, ecs:service:DesiredCount, ec2:spot-fleet-request:TargetCapacity, rds:cluster:ReadReplicaCount, dynamodb:table:ReadCapacityUnits, dynamodb:table:WriteCapacityUnits, dynamodb:index:ReadCapacityUnits, dynamodb:index:WriteCapacityUnits
      min_capacity: 1, # required
      max_capacity: 1, # required
      target_tracking_configurations: [ # required
        {
          predefined_scaling_metric_specification: {
            predefined_scaling_metric_type: "ASGAverageCPUUtilization", # required, accepts ASGAverageCPUUtilization, ASGAverageNetworkIn, ASGAverageNetworkOut, DynamoDBReadCapacityUtilization, DynamoDBWriteCapacityUtilization, ECSServiceAverageCPUUtilization, ECSServiceAverageMemoryUtilization, ALBRequestCountPerTarget, RDSReaderAverageCPUUtilization, RDSReaderAverageDatabaseConnections, EC2SpotFleetRequestAverageCPUUtilization, EC2SpotFleetRequestAverageNetworkIn, EC2SpotFleetRequestAverageNetworkOut
            resource_label: "ResourceLabel",
          },
          customized_scaling_metric_specification: {
            metric_name: "MetricName", # required
            namespace: "MetricNamespace", # required
            dimensions: [
              {
                name: "MetricDimensionName", # required
                value: "MetricDimensionValue", # required
              },
            ],
            statistic: "Average", # required, accepts Average, Minimum, Maximum, SampleCount, Sum
            unit: "MetricUnit",
          },
          target_value: 1.0, # required
          disable_scale_in: false,
          scale_out_cooldown: 1,
          scale_in_cooldown: 1,
          estimated_instance_warmup: 1,
        },
      ],
    },
  ],
  scaling_plan_version: 1, # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :application_source (Types::ApplicationSource)

    A CloudFormation stack or set of tags.

  • :scaling_plan_name (required, String)

    The name of the scaling plan.

  • :scaling_instructions (Array<Types::ScalingInstruction>)

    The scaling instructions.

  • :scaling_plan_version (required, Integer)

    The version number.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



531
532
533
534
# File 'gems/aws-sdk-autoscalingplans/lib/aws-sdk-autoscalingplans/client.rb', line 531

def update_scaling_plan(params = {}, options = {})
  req = build_request(:update_scaling_plan, params)
  req.send_request(options)
end