aws-sdk-applicationautoscaling 1.0.0.rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,748 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing for info on making contributions:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'seahorse/client/plugins/content_length.rb'
9
+ require 'aws-sdk-core/plugins/credentials_configuration.rb'
10
+ require 'aws-sdk-core/plugins/logging.rb'
11
+ require 'aws-sdk-core/plugins/param_converter.rb'
12
+ require 'aws-sdk-core/plugins/param_validator.rb'
13
+ require 'aws-sdk-core/plugins/user_agent.rb'
14
+ require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
15
+ require 'aws-sdk-core/plugins/retry_errors.rb'
16
+ require 'aws-sdk-core/plugins/global_configuration.rb'
17
+ require 'aws-sdk-core/plugins/regional_endpoint.rb'
18
+ require 'aws-sdk-core/plugins/response_paging.rb'
19
+ require 'aws-sdk-core/plugins/stub_responses.rb'
20
+ require 'aws-sdk-core/plugins/idempotency_token.rb'
21
+ require 'aws-sdk-core/plugins/signature_v4.rb'
22
+ require 'aws-sdk-core/plugins/protocols/json_rpc.rb'
23
+
24
+ Aws::Plugins::GlobalConfiguration.add_identifier(:applicationautoscaling)
25
+
26
+ module Aws
27
+ module ApplicationAutoScaling
28
+ class Client < Seahorse::Client::Base
29
+
30
+ include Aws::ClientStubs
31
+
32
+ @identifier = :applicationautoscaling
33
+
34
+ set_api(ClientApi::API)
35
+
36
+ add_plugin(Seahorse::Client::Plugins::ContentLength)
37
+ add_plugin(Aws::Plugins::CredentialsConfiguration)
38
+ add_plugin(Aws::Plugins::Logging)
39
+ add_plugin(Aws::Plugins::ParamConverter)
40
+ add_plugin(Aws::Plugins::ParamValidator)
41
+ add_plugin(Aws::Plugins::UserAgent)
42
+ add_plugin(Aws::Plugins::HelpfulSocketErrors)
43
+ add_plugin(Aws::Plugins::RetryErrors)
44
+ add_plugin(Aws::Plugins::GlobalConfiguration)
45
+ add_plugin(Aws::Plugins::RegionalEndpoint)
46
+ add_plugin(Aws::Plugins::ResponsePaging)
47
+ add_plugin(Aws::Plugins::StubResponses)
48
+ add_plugin(Aws::Plugins::IdempotencyToken)
49
+ add_plugin(Aws::Plugins::SignatureV4)
50
+ add_plugin(Aws::Plugins::Protocols::JsonRpc)
51
+
52
+ # @option options [required, Aws::CredentialProvider] :credentials
53
+ # Your AWS credentials. This can be an instance of any one of the
54
+ # following classes:
55
+ #
56
+ # * `Aws::Credentials` - Used for configuring static, non-refreshing
57
+ # credentials.
58
+ #
59
+ # * `Aws::InstanceProfileCredentials` - Used for loading credentials
60
+ # from an EC2 IMDS on an EC2 instance.
61
+ #
62
+ # * `Aws::SharedCredentials` - Used for loading credentials from a
63
+ # shared file, such as `~/.aws/config`.
64
+ #
65
+ # * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
66
+ #
67
+ # When `:credentials` are not configured directly, the following
68
+ # locations will be searched for credentials:
69
+ #
70
+ # * `Aws.config[:credentials]`
71
+ # * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
72
+ # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
73
+ # * `~/.aws/credentials`
74
+ # * `~/.aws/config`
75
+ # * EC2 IMDS instance profile - When used by default, the timeouts are
76
+ # very aggressive. Construct and pass an instance of
77
+ # `Aws::InstanceProfileCredentails` to enable retries and extended
78
+ # timeouts.
79
+ # @option options [required, String] :region
80
+ # The AWS region to connect to. The configured `:region` is
81
+ # used to determine the service `:endpoint`. When not passed,
82
+ # a default `:region` is search for in the following locations:
83
+ #
84
+ # * `Aws.config[:region]`
85
+ # * `ENV['AWS_REGION']`
86
+ # * `ENV['AMAZON_REGION']`
87
+ # * `ENV['AWS_DEFAULT_REGION']`
88
+ # * `~/.aws/credentials`
89
+ # * `~/.aws/config`
90
+ # @option options [String] :access_key_id
91
+ # @option options [Boolean] :convert_params (true)
92
+ # When `true`, an attempt is made to coerce request parameters into
93
+ # the required types.
94
+ # @option options [String] :endpoint
95
+ # The client endpoint is normally constructed from the `:region`
96
+ # option. You should only configure an `:endpoint` when connecting
97
+ # to test endpoints. This should be avalid HTTP(S) URI.
98
+ # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
99
+ # The log formatter.
100
+ # @option options [Symbol] :log_level (:info)
101
+ # The log level to send messages to the `:logger` at.
102
+ # @option options [Logger] :logger
103
+ # The Logger instance to send log messages to. If this option
104
+ # is not set, logging will be disabled.
105
+ # @option options [String] :profile ("default")
106
+ # Used when loading credentials from the shared credentials file
107
+ # at HOME/.aws/credentials. When not specified, 'default' is used.
108
+ # @option options [Integer] :retry_limit (3)
109
+ # The maximum number of times to retry failed requests. Only
110
+ # ~ 500 level server errors and certain ~ 400 level client errors
111
+ # are retried. Generally, these are throttling errors, data
112
+ # checksum errors, networking errors, timeout errors and auth
113
+ # errors from expired credentials.
114
+ # @option options [String] :secret_access_key
115
+ # @option options [String] :session_token
116
+ # @option options [Boolean] :simple_json (false)
117
+ # Disables request parameter conversion, validation, and formatting.
118
+ # Also disable response data type conversions. This option is useful
119
+ # when you want to ensure the highest level of performance by
120
+ # avoiding overhead of walking request parameters and response data
121
+ # structures.
122
+ #
123
+ # When `:simple_json` is enabled, the request parameters hash must
124
+ # be formatted exactly as the DynamoDB API expects.
125
+ # @option options [Boolean] :stub_responses (false)
126
+ # Causes the client to return stubbed responses. By default
127
+ # fake responses are generated and returned. You can specify
128
+ # the response data to return or errors to raise by calling
129
+ # {ClientStubs#stub_responses}. See {ClientStubs} for more information.
130
+ #
131
+ # ** Please note ** When response stubbing is enabled, no HTTP
132
+ # requests are made, and retries are disabled.
133
+ # @option options [Boolean] :validate_params (true)
134
+ # When `true`, request parameters are validated before
135
+ # sending the request.
136
+ def initialize(*args)
137
+ super
138
+ end
139
+
140
+ # @!group API Operations
141
+
142
+ # Deletes the specified Application Auto Scaling scaling policy.
143
+ #
144
+ # Deleting a policy deletes the underlying alarm action, but does not
145
+ # delete the CloudWatch alarm associated with the scaling policy, even
146
+ # if it no longer has an associated action.
147
+ #
148
+ # To create a scaling policy or update an existing one, see
149
+ # PutScalingPolicy.
150
+ # @option params [required, String] :policy_name
151
+ # The name of the scaling policy.
152
+ # @option params [required, String] :service_namespace
153
+ # The namespace of the AWS service. For more information, see [AWS
154
+ # Service Namespaces][1] in the *Amazon Web Services General Reference*.
155
+ #
156
+ #
157
+ #
158
+ # [1]: http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces
159
+ # @option params [required, String] :resource_id
160
+ # The identifier of the resource associated with the scalable target.
161
+ # This string consists of the resource type and unique identifier.
162
+ #
163
+ # * ECS service - The resource type is `service` and the unique
164
+ # identifier is the cluster name and service name. Example:
165
+ # `service/default/sample-webapp`.
166
+ #
167
+ # * Spot fleet request - The resource type is `spot-fleet-request` and
168
+ # the unique identifier is the Spot fleet request ID. Example:
169
+ # `spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE`.
170
+ #
171
+ # * EMR cluster - The resource type is `instancegroup` and the unique
172
+ # identifier is the cluster ID and instance group ID. Example:
173
+ # `instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0`.
174
+ # @option params [required, String] :scalable_dimension
175
+ # The scalable dimension. This string consists of the service namespace,
176
+ # resource type, and scaling property.
177
+ #
178
+ # * `ecs:service:DesiredCount` - The desired task count of an ECS
179
+ # service.
180
+ #
181
+ # * `ec2:spot-fleet-request:TargetCapacity` - The target capacity of a
182
+ # Spot fleet request.
183
+ #
184
+ # * `elasticmapreduce:instancegroup:InstanceCount` - The instance count
185
+ # of an EMR Instance Group.
186
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
187
+ #
188
+ # @example Request syntax with placeholder values
189
+ # resp = client.delete_scaling_policy({
190
+ # policy_name: "ResourceIdMaxLen1600", # required
191
+ # service_namespace: "ecs", # required, accepts ecs, elasticmapreduce, ec2
192
+ # resource_id: "ResourceIdMaxLen1600", # required
193
+ # scalable_dimension: "ecs:service:DesiredCount", # required, accepts ecs:service:DesiredCount, ec2:spot-fleet-request:TargetCapacity, elasticmapreduce:instancegroup:InstanceCount
194
+ # })
195
+ # @overload delete_scaling_policy(params = {})
196
+ # @param [Hash] params ({})
197
+ def delete_scaling_policy(params = {}, options = {})
198
+ req = build_request(:delete_scaling_policy, params)
199
+ req.send_request(options)
200
+ end
201
+
202
+ # Deregisters a scalable target.
203
+ #
204
+ # Deregistering a scalable target deletes the scaling policies that are
205
+ # associated with it.
206
+ #
207
+ # To create a scalable target or update an existing one, see
208
+ # RegisterScalableTarget.
209
+ # @option params [required, String] :service_namespace
210
+ # The namespace of the AWS service. For more information, see [AWS
211
+ # Service Namespaces][1] in the *Amazon Web Services General Reference*.
212
+ #
213
+ #
214
+ #
215
+ # [1]: http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces
216
+ # @option params [required, String] :resource_id
217
+ # The identifier of the resource associated with the scalable target.
218
+ # This string consists of the resource type and unique identifier.
219
+ #
220
+ # * ECS service - The resource type is `service` and the unique
221
+ # identifier is the cluster name and service name. Example:
222
+ # `service/default/sample-webapp`.
223
+ #
224
+ # * Spot fleet request - The resource type is `spot-fleet-request` and
225
+ # the unique identifier is the Spot fleet request ID. Example:
226
+ # `spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE`.
227
+ #
228
+ # * EMR cluster - The resource type is `instancegroup` and the unique
229
+ # identifier is the cluster ID and instance group ID. Example:
230
+ # `instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0`.
231
+ # @option params [required, String] :scalable_dimension
232
+ # The scalable dimension associated with the scalable target. This
233
+ # string consists of the service namespace, resource type, and scaling
234
+ # property.
235
+ #
236
+ # * `ecs:service:DesiredCount` - The desired task count of an ECS
237
+ # service.
238
+ #
239
+ # * `ec2:spot-fleet-request:TargetCapacity` - The target capacity of a
240
+ # Spot fleet request.
241
+ #
242
+ # * `elasticmapreduce:instancegroup:InstanceCount` - The instance count
243
+ # of an EMR Instance Group.
244
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
245
+ #
246
+ # @example Request syntax with placeholder values
247
+ # resp = client.deregister_scalable_target({
248
+ # service_namespace: "ecs", # required, accepts ecs, elasticmapreduce, ec2
249
+ # resource_id: "ResourceIdMaxLen1600", # required
250
+ # scalable_dimension: "ecs:service:DesiredCount", # required, accepts ecs:service:DesiredCount, ec2:spot-fleet-request:TargetCapacity, elasticmapreduce:instancegroup:InstanceCount
251
+ # })
252
+ # @overload deregister_scalable_target(params = {})
253
+ # @param [Hash] params ({})
254
+ def deregister_scalable_target(params = {}, options = {})
255
+ req = build_request(:deregister_scalable_target, params)
256
+ req.send_request(options)
257
+ end
258
+
259
+ # Provides descriptive information about the scalable targets in the
260
+ # specified namespace.
261
+ #
262
+ # You can filter the results using the `ResourceIds` and
263
+ # `ScalableDimension` parameters.
264
+ #
265
+ # To create a scalable target or update an existing one, see
266
+ # RegisterScalableTarget. If you are no longer using a scalable target,
267
+ # you can deregister it using DeregisterScalableTarget.
268
+ # @option params [required, String] :service_namespace
269
+ # The namespace of the AWS service. For more information, see [AWS
270
+ # Service Namespaces][1] in the *Amazon Web Services General Reference*.
271
+ #
272
+ #
273
+ #
274
+ # [1]: http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces
275
+ # @option params [Array<String>] :resource_ids
276
+ # The identifier of the resource associated with the scalable target.
277
+ # This string consists of the resource type and unique identifier. If
278
+ # you specify a scalable dimension, you must also specify a resource ID.
279
+ #
280
+ # * ECS service - The resource type is `service` and the unique
281
+ # identifier is the cluster name and service name. Example:
282
+ # `service/default/sample-webapp`.
283
+ #
284
+ # * Spot fleet request - The resource type is `spot-fleet-request` and
285
+ # the unique identifier is the Spot fleet request ID. Example:
286
+ # `spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE`.
287
+ #
288
+ # * EMR cluster - The resource type is `instancegroup` and the unique
289
+ # identifier is the cluster ID and instance group ID. Example:
290
+ # `instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0`.
291
+ # @option params [String] :scalable_dimension
292
+ # The scalable dimension associated with the scalable target. This
293
+ # string consists of the service namespace, resource type, and scaling
294
+ # property. If you specify a scalable dimension, you must also specify a
295
+ # resource ID.
296
+ #
297
+ # * `ecs:service:DesiredCount` - The desired task count of an ECS
298
+ # service.
299
+ #
300
+ # * `ec2:spot-fleet-request:TargetCapacity` - The target capacity of a
301
+ # Spot fleet request.
302
+ #
303
+ # * `elasticmapreduce:instancegroup:InstanceCount` - The instance count
304
+ # of an EMR Instance Group.
305
+ # @option params [Integer] :max_results
306
+ # The maximum number of scalable target results. This value can be
307
+ # between 1 and 50. The default value is 50.
308
+ #
309
+ # If this parameter is used, the operation returns up to `MaxResults`
310
+ # results at a time, along with a `NextToken` value. To get the next set
311
+ # of results, include the `NextToken` value in a subsequent call. If
312
+ # this parameter is not used, the operation returns up to 50 results and
313
+ # a `NextToken` value, if applicable.
314
+ # @option params [String] :next_token
315
+ # The token for the next set of results.
316
+ # @return [Types::DescribeScalableTargetsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
317
+ #
318
+ # * {Types::DescribeScalableTargetsResponse#scalable_targets #ScalableTargets} => Array&lt;Types::ScalableTarget&gt;
319
+ # * {Types::DescribeScalableTargetsResponse#next_token #NextToken} => String
320
+ #
321
+ # @example Request syntax with placeholder values
322
+ # resp = client.describe_scalable_targets({
323
+ # service_namespace: "ecs", # required, accepts ecs, elasticmapreduce, ec2
324
+ # resource_ids: ["ResourceIdMaxLen1600"],
325
+ # scalable_dimension: "ecs:service:DesiredCount", # accepts ecs:service:DesiredCount, ec2:spot-fleet-request:TargetCapacity, elasticmapreduce:instancegroup:InstanceCount
326
+ # max_results: 1,
327
+ # next_token: "XmlString",
328
+ # })
329
+ #
330
+ # @example Response structure
331
+ # resp.scalable_targets #=> Array
332
+ # resp.scalable_targets[0].service_namespace #=> String, one of "ecs", "elasticmapreduce", "ec2"
333
+ # resp.scalable_targets[0].resource_id #=> String
334
+ # resp.scalable_targets[0].scalable_dimension #=> String, one of "ecs:service:DesiredCount", "ec2:spot-fleet-request:TargetCapacity", "elasticmapreduce:instancegroup:InstanceCount"
335
+ # resp.scalable_targets[0].min_capacity #=> Integer
336
+ # resp.scalable_targets[0].max_capacity #=> Integer
337
+ # resp.scalable_targets[0].role_arn #=> String
338
+ # resp.scalable_targets[0].creation_time #=> Time
339
+ # resp.next_token #=> String
340
+ # @overload describe_scalable_targets(params = {})
341
+ # @param [Hash] params ({})
342
+ def describe_scalable_targets(params = {}, options = {})
343
+ req = build_request(:describe_scalable_targets, params)
344
+ req.send_request(options)
345
+ end
346
+
347
+ # Provides descriptive information about the scaling activities in the
348
+ # specified namespace from the previous six weeks.
349
+ #
350
+ # You can filter the results using the `ResourceId` and
351
+ # `ScalableDimension` parameters.
352
+ #
353
+ # Scaling activities are triggered by CloudWatch alarms that are
354
+ # associated with scaling policies. To view the scaling policies for a
355
+ # service namespace, see DescribeScalingPolicies. To create a scaling
356
+ # policy or update an existing one, see PutScalingPolicy.
357
+ # @option params [required, String] :service_namespace
358
+ # The namespace of the AWS service. For more information, see [AWS
359
+ # Service Namespaces][1] in the *Amazon Web Services General Reference*.
360
+ #
361
+ #
362
+ #
363
+ # [1]: http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces
364
+ # @option params [String] :resource_id
365
+ # The identifier of the resource associated with the scaling activity.
366
+ # This string consists of the resource type and unique identifier. If
367
+ # you specify a scalable dimension, you must also specify a resource ID.
368
+ #
369
+ # * ECS service - The resource type is `service` and the unique
370
+ # identifier is the cluster name and service name. Example:
371
+ # `service/default/sample-webapp`.
372
+ #
373
+ # * Spot fleet request - The resource type is `spot-fleet-request` and
374
+ # the unique identifier is the Spot fleet request ID. Example:
375
+ # `spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE`.
376
+ #
377
+ # * EMR cluster - The resource type is `instancegroup` and the unique
378
+ # identifier is the cluster ID and instance group ID. Example:
379
+ # `instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0`.
380
+ # @option params [String] :scalable_dimension
381
+ # The scalable dimension. This string consists of the service namespace,
382
+ # resource type, and scaling property. If you specify a scalable
383
+ # dimension, you must also specify a resource ID.
384
+ #
385
+ # * `ecs:service:DesiredCount` - The desired task count of an ECS
386
+ # service.
387
+ #
388
+ # * `ec2:spot-fleet-request:TargetCapacity` - The target capacity of a
389
+ # Spot fleet request.
390
+ #
391
+ # * `elasticmapreduce:instancegroup:InstanceCount` - The instance count
392
+ # of an EMR Instance Group.
393
+ # @option params [Integer] :max_results
394
+ # The maximum number of scalable target results. This value can be
395
+ # between 1 and 50. The default value is 50.
396
+ #
397
+ # If this parameter is used, the operation returns up to `MaxResults`
398
+ # results at a time, along with a `NextToken` value. To get the next set
399
+ # of results, include the `NextToken` value in a subsequent call. If
400
+ # this parameter is not used, the operation returns up to 50 results and
401
+ # a `NextToken` value, if applicable.
402
+ # @option params [String] :next_token
403
+ # The token for the next set of results.
404
+ # @return [Types::DescribeScalingActivitiesResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
405
+ #
406
+ # * {Types::DescribeScalingActivitiesResponse#scaling_activities #ScalingActivities} => Array&lt;Types::ScalingActivity&gt;
407
+ # * {Types::DescribeScalingActivitiesResponse#next_token #NextToken} => String
408
+ #
409
+ # @example Request syntax with placeholder values
410
+ # resp = client.describe_scaling_activities({
411
+ # service_namespace: "ecs", # required, accepts ecs, elasticmapreduce, ec2
412
+ # resource_id: "ResourceIdMaxLen1600",
413
+ # scalable_dimension: "ecs:service:DesiredCount", # accepts ecs:service:DesiredCount, ec2:spot-fleet-request:TargetCapacity, elasticmapreduce:instancegroup:InstanceCount
414
+ # max_results: 1,
415
+ # next_token: "XmlString",
416
+ # })
417
+ #
418
+ # @example Response structure
419
+ # resp.scaling_activities #=> Array
420
+ # resp.scaling_activities[0].activity_id #=> String
421
+ # resp.scaling_activities[0].service_namespace #=> String, one of "ecs", "elasticmapreduce", "ec2"
422
+ # resp.scaling_activities[0].resource_id #=> String
423
+ # resp.scaling_activities[0].scalable_dimension #=> String, one of "ecs:service:DesiredCount", "ec2:spot-fleet-request:TargetCapacity", "elasticmapreduce:instancegroup:InstanceCount"
424
+ # resp.scaling_activities[0].description #=> String
425
+ # resp.scaling_activities[0].cause #=> String
426
+ # resp.scaling_activities[0].start_time #=> Time
427
+ # resp.scaling_activities[0].end_time #=> Time
428
+ # resp.scaling_activities[0].status_code #=> String, one of "Pending", "InProgress", "Successful", "Overridden", "Unfulfilled", "Failed"
429
+ # resp.scaling_activities[0].status_message #=> String
430
+ # resp.scaling_activities[0].details #=> String
431
+ # resp.next_token #=> String
432
+ # @overload describe_scaling_activities(params = {})
433
+ # @param [Hash] params ({})
434
+ def describe_scaling_activities(params = {}, options = {})
435
+ req = build_request(:describe_scaling_activities, params)
436
+ req.send_request(options)
437
+ end
438
+
439
+ # Provides descriptive information about the scaling policies in the
440
+ # specified namespace.
441
+ #
442
+ # You can filter the results using the `ResourceId`,
443
+ # `ScalableDimension`, and `PolicyNames` parameters.
444
+ #
445
+ # To create a scaling policy or update an existing one, see
446
+ # PutScalingPolicy. If you are no longer using a scaling policy, you can
447
+ # delete it using DeleteScalingPolicy.
448
+ # @option params [Array<String>] :policy_names
449
+ # The names of the scaling policies to describe.
450
+ # @option params [required, String] :service_namespace
451
+ # The namespace of the AWS service. For more information, see [AWS
452
+ # Service Namespaces][1] in the *Amazon Web Services General Reference*.
453
+ #
454
+ #
455
+ #
456
+ # [1]: http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces
457
+ # @option params [String] :resource_id
458
+ # The identifier of the resource associated with the scaling policy.
459
+ # This string consists of the resource type and unique identifier. If
460
+ # you specify a scalable dimension, you must also specify a resource ID.
461
+ #
462
+ # * ECS service - The resource type is `service` and the unique
463
+ # identifier is the cluster name and service name. Example:
464
+ # `service/default/sample-webapp`.
465
+ #
466
+ # * Spot fleet request - The resource type is `spot-fleet-request` and
467
+ # the unique identifier is the Spot fleet request ID. Example:
468
+ # `spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE`.
469
+ #
470
+ # * EMR cluster - The resource type is `instancegroup` and the unique
471
+ # identifier is the cluster ID and instance group ID. Example:
472
+ # `instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0`.
473
+ # @option params [String] :scalable_dimension
474
+ # The scalable dimension. This string consists of the service namespace,
475
+ # resource type, and scaling property. If you specify a scalable
476
+ # dimension, you must also specify a resource ID.
477
+ #
478
+ # * `ecs:service:DesiredCount` - The desired task count of an ECS
479
+ # service.
480
+ #
481
+ # * `ec2:spot-fleet-request:TargetCapacity` - The target capacity of a
482
+ # Spot fleet request.
483
+ #
484
+ # * `elasticmapreduce:instancegroup:InstanceCount` - The instance count
485
+ # of an EMR Instance Group.
486
+ # @option params [Integer] :max_results
487
+ # The maximum number of scalable target results. This value can be
488
+ # between 1 and 50. The default value is 50.
489
+ #
490
+ # If this parameter is used, the operation returns up to `MaxResults`
491
+ # results at a time, along with a `NextToken` value. To get the next set
492
+ # of results, include the `NextToken` value in a subsequent call. If
493
+ # this parameter is not used, the operation returns up to 50 results and
494
+ # a `NextToken` value, if applicable.
495
+ # @option params [String] :next_token
496
+ # The token for the next set of results.
497
+ # @return [Types::DescribeScalingPoliciesResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
498
+ #
499
+ # * {Types::DescribeScalingPoliciesResponse#scaling_policies #ScalingPolicies} => Array&lt;Types::ScalingPolicy&gt;
500
+ # * {Types::DescribeScalingPoliciesResponse#next_token #NextToken} => String
501
+ #
502
+ # @example Request syntax with placeholder values
503
+ # resp = client.describe_scaling_policies({
504
+ # policy_names: ["ResourceIdMaxLen1600"],
505
+ # service_namespace: "ecs", # required, accepts ecs, elasticmapreduce, ec2
506
+ # resource_id: "ResourceIdMaxLen1600",
507
+ # scalable_dimension: "ecs:service:DesiredCount", # accepts ecs:service:DesiredCount, ec2:spot-fleet-request:TargetCapacity, elasticmapreduce:instancegroup:InstanceCount
508
+ # max_results: 1,
509
+ # next_token: "XmlString",
510
+ # })
511
+ #
512
+ # @example Response structure
513
+ # resp.scaling_policies #=> Array
514
+ # resp.scaling_policies[0].policy_arn #=> String
515
+ # resp.scaling_policies[0].policy_name #=> String
516
+ # resp.scaling_policies[0].service_namespace #=> String, one of "ecs", "elasticmapreduce", "ec2"
517
+ # resp.scaling_policies[0].resource_id #=> String
518
+ # resp.scaling_policies[0].scalable_dimension #=> String, one of "ecs:service:DesiredCount", "ec2:spot-fleet-request:TargetCapacity", "elasticmapreduce:instancegroup:InstanceCount"
519
+ # resp.scaling_policies[0].policy_type #=> String, one of "StepScaling"
520
+ # resp.scaling_policies[0].step_scaling_policy_configuration.adjustment_type #=> String, one of "ChangeInCapacity", "PercentChangeInCapacity", "ExactCapacity"
521
+ # resp.scaling_policies[0].step_scaling_policy_configuration.step_adjustments #=> Array
522
+ # resp.scaling_policies[0].step_scaling_policy_configuration.step_adjustments[0].metric_interval_lower_bound #=> Float
523
+ # resp.scaling_policies[0].step_scaling_policy_configuration.step_adjustments[0].metric_interval_upper_bound #=> Float
524
+ # resp.scaling_policies[0].step_scaling_policy_configuration.step_adjustments[0].scaling_adjustment #=> Integer
525
+ # resp.scaling_policies[0].step_scaling_policy_configuration.min_adjustment_magnitude #=> Integer
526
+ # resp.scaling_policies[0].step_scaling_policy_configuration.cooldown #=> Integer
527
+ # resp.scaling_policies[0].step_scaling_policy_configuration.metric_aggregation_type #=> String, one of "Average", "Minimum", "Maximum"
528
+ # resp.scaling_policies[0].alarms #=> Array
529
+ # resp.scaling_policies[0].alarms[0].alarm_name #=> String
530
+ # resp.scaling_policies[0].alarms[0].alarm_arn #=> String
531
+ # resp.scaling_policies[0].creation_time #=> Time
532
+ # resp.next_token #=> String
533
+ # @overload describe_scaling_policies(params = {})
534
+ # @param [Hash] params ({})
535
+ def describe_scaling_policies(params = {}, options = {})
536
+ req = build_request(:describe_scaling_policies, params)
537
+ req.send_request(options)
538
+ end
539
+
540
+ # Creates or updates a policy for an Application Auto Scaling scalable
541
+ # target.
542
+ #
543
+ # Each scalable target is identified by a service namespace, resource
544
+ # ID, and scalable dimension. A scaling policy applies to the scalable
545
+ # target identified by those three attributes. You cannot create a
546
+ # scaling policy without first registering a scalable target using
547
+ # RegisterScalableTarget.
548
+ #
549
+ # To update a policy, specify its policy name and the parameters that
550
+ # you want to change. Any parameters that you don't specify are not
551
+ # changed by this update request.
552
+ #
553
+ # You can view the scaling policies for a service namespace using
554
+ # DescribeScalingPolicies. If you are no longer using a scaling policy,
555
+ # you can delete it using DeleteScalingPolicy.
556
+ # @option params [required, String] :policy_name
557
+ # The name of the scaling policy.
558
+ # @option params [required, String] :service_namespace
559
+ # The namespace of the AWS service. For more information, see [AWS
560
+ # Service Namespaces][1] in the *Amazon Web Services General Reference*.
561
+ #
562
+ #
563
+ #
564
+ # [1]: http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces
565
+ # @option params [required, String] :resource_id
566
+ # The identifier of the resource associated with the scaling policy.
567
+ # This string consists of the resource type and unique identifier.
568
+ #
569
+ # * ECS service - The resource type is `service` and the unique
570
+ # identifier is the cluster name and service name. Example:
571
+ # `service/default/sample-webapp`.
572
+ #
573
+ # * Spot fleet request - The resource type is `spot-fleet-request` and
574
+ # the unique identifier is the Spot fleet request ID. Example:
575
+ # `spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE`.
576
+ #
577
+ # * EMR cluster - The resource type is `instancegroup` and the unique
578
+ # identifier is the cluster ID and instance group ID. Example:
579
+ # `instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0`.
580
+ # @option params [required, String] :scalable_dimension
581
+ # The scalable dimension. This string consists of the service namespace,
582
+ # resource type, and scaling property.
583
+ #
584
+ # * `ecs:service:DesiredCount` - The desired task count of an ECS
585
+ # service.
586
+ #
587
+ # * `ec2:spot-fleet-request:TargetCapacity` - The target capacity of a
588
+ # Spot fleet request.
589
+ #
590
+ # * `elasticmapreduce:instancegroup:InstanceCount` - The instance count
591
+ # of an EMR Instance Group.
592
+ # @option params [String] :policy_type
593
+ # The policy type. If you are creating a new policy, this parameter is
594
+ # required. If you are updating a policy, this parameter is not
595
+ # required.
596
+ # @option params [Types::StepScalingPolicyConfiguration] :step_scaling_policy_configuration
597
+ # The configuration for the step scaling policy. If you are creating a
598
+ # new policy, this parameter is required. If you are updating a policy,
599
+ # this parameter is not required. For more information, see
600
+ # StepScalingPolicyConfiguration and StepAdjustment.
601
+ # @return [Types::PutScalingPolicyResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
602
+ #
603
+ # * {Types::PutScalingPolicyResponse#policy_arn #PolicyARN} => String
604
+ #
605
+ # @example Request syntax with placeholder values
606
+ # resp = client.put_scaling_policy({
607
+ # policy_name: "PolicyName", # required
608
+ # service_namespace: "ecs", # required, accepts ecs, elasticmapreduce, ec2
609
+ # resource_id: "ResourceIdMaxLen1600", # required
610
+ # scalable_dimension: "ecs:service:DesiredCount", # required, accepts ecs:service:DesiredCount, ec2:spot-fleet-request:TargetCapacity, elasticmapreduce:instancegroup:InstanceCount
611
+ # policy_type: "StepScaling", # accepts StepScaling
612
+ # step_scaling_policy_configuration: {
613
+ # adjustment_type: "ChangeInCapacity", # accepts ChangeInCapacity, PercentChangeInCapacity, ExactCapacity
614
+ # step_adjustments: [
615
+ # {
616
+ # metric_interval_lower_bound: 1.0,
617
+ # metric_interval_upper_bound: 1.0,
618
+ # scaling_adjustment: 1, # required
619
+ # },
620
+ # ],
621
+ # min_adjustment_magnitude: 1,
622
+ # cooldown: 1,
623
+ # metric_aggregation_type: "Average", # accepts Average, Minimum, Maximum
624
+ # },
625
+ # })
626
+ #
627
+ # @example Response structure
628
+ # resp.policy_arn #=> String
629
+ # @overload put_scaling_policy(params = {})
630
+ # @param [Hash] params ({})
631
+ def put_scaling_policy(params = {}, options = {})
632
+ req = build_request(:put_scaling_policy, params)
633
+ req.send_request(options)
634
+ end
635
+
636
+ # Registers or updates a scalable target. A scalable target is a
637
+ # resource that Application Auto Scaling can scale out or scale in.
638
+ # After you have registered a scalable target, you can use this
639
+ # operation to update the minimum and maximum values for your scalable
640
+ # dimension.
641
+ #
642
+ # After you register a scalable target, you can create and apply scaling
643
+ # policies using PutScalingPolicy. You can view the scaling policies for
644
+ # a service namespace using DescribeScalableTargets. If you are no
645
+ # longer using a scalable target, you can deregister it using
646
+ # DeregisterScalableTarget.
647
+ # @option params [required, String] :service_namespace
648
+ # The namespace of the AWS service. For more information, see [AWS
649
+ # Service Namespaces][1] in the *Amazon Web Services General Reference*.
650
+ #
651
+ #
652
+ #
653
+ # [1]: http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces
654
+ # @option params [required, String] :resource_id
655
+ # The identifier of the resource associated with the scalable target.
656
+ # This string consists of the resource type and unique identifier.
657
+ #
658
+ # * ECS service - The resource type is `service` and the unique
659
+ # identifier is the cluster name and service name. Example:
660
+ # `service/default/sample-webapp`.
661
+ #
662
+ # * Spot fleet request - The resource type is `spot-fleet-request` and
663
+ # the unique identifier is the Spot fleet request ID. Example:
664
+ # `spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE`.
665
+ #
666
+ # * EMR cluster - The resource type is `instancegroup` and the unique
667
+ # identifier is the cluster ID and instance group ID. Example:
668
+ # `instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0`.
669
+ # @option params [required, String] :scalable_dimension
670
+ # The scalable dimension associated with the scalable target. This
671
+ # string consists of the service namespace, resource type, and scaling
672
+ # property.
673
+ #
674
+ # * `ecs:service:DesiredCount` - The desired task count of an ECS
675
+ # service.
676
+ #
677
+ # * `ec2:spot-fleet-request:TargetCapacity` - The target capacity of a
678
+ # Spot fleet request.
679
+ #
680
+ # * `elasticmapreduce:instancegroup:InstanceCount` - The instance count
681
+ # of an EMR Instance Group.
682
+ # @option params [Integer] :min_capacity
683
+ # The minimum value to scale to in response to a scale in event. This
684
+ # parameter is required if you are registering a scalable target and
685
+ # optional if you are updating one.
686
+ # @option params [Integer] :max_capacity
687
+ # The maximum value to scale to in response to a scale out event. This
688
+ # parameter is required if you are registering a scalable target and
689
+ # optional if you are updating one.
690
+ # @option params [String] :role_arn
691
+ # The ARN of an IAM role that allows Application Auto Scaling to modify
692
+ # the scalable target on your behalf. This parameter is required when
693
+ # you register a scalable target and optional when you update one.
694
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
695
+ #
696
+ # @example Request syntax with placeholder values
697
+ # resp = client.register_scalable_target({
698
+ # service_namespace: "ecs", # required, accepts ecs, elasticmapreduce, ec2
699
+ # resource_id: "ResourceIdMaxLen1600", # required
700
+ # scalable_dimension: "ecs:service:DesiredCount", # required, accepts ecs:service:DesiredCount, ec2:spot-fleet-request:TargetCapacity, elasticmapreduce:instancegroup:InstanceCount
701
+ # min_capacity: 1,
702
+ # max_capacity: 1,
703
+ # role_arn: "ResourceIdMaxLen1600",
704
+ # })
705
+ # @overload register_scalable_target(params = {})
706
+ # @param [Hash] params ({})
707
+ def register_scalable_target(params = {}, options = {})
708
+ req = build_request(:register_scalable_target, params)
709
+ req.send_request(options)
710
+ end
711
+
712
+ # @!endgroup
713
+
714
+ # @param params ({})
715
+ # @api private
716
+ def build_request(operation_name, params = {})
717
+ handlers = @handlers.for(operation_name)
718
+ context = Seahorse::Client::RequestContext.new(
719
+ operation_name: operation_name,
720
+ operation: config.api.operation(operation_name),
721
+ client: self,
722
+ params: params,
723
+ config: config)
724
+ context[:gem_name] = 'aws-sdk-applicationautoscaling'
725
+ context[:gem_version] = '1.0.0.rc1'
726
+ Seahorse::Client::Request.new(handlers, context)
727
+ end
728
+
729
+ # @api private
730
+ # @deprecated
731
+ def waiter_names
732
+ []
733
+ end
734
+
735
+ class << self
736
+
737
+ # @api private
738
+ attr_reader :identifier
739
+
740
+ # @api private
741
+ def errors_module
742
+ Errors
743
+ end
744
+
745
+ end
746
+ end
747
+ end
748
+ end