aws-sdk-locationservice 1.84.0 → 1.85.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-locationservice/client.rb +408 -2
- data/lib/aws-sdk-locationservice/client_api.rb +192 -0
- data/lib/aws-sdk-locationservice/types.rb +513 -2
- data/lib/aws-sdk-locationservice/waiters.rb +126 -0
- data/lib/aws-sdk-locationservice.rb +2 -1
- data/sig/client.rbs +85 -0
- data/sig/types.rbs +118 -0
- data/sig/waiters.rbs +10 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ac4b8383b650ff47957f7c0ce578afaa5517be3cde8e2bd0ac868f934fe56c67
|
|
4
|
+
data.tar.gz: e5ded0092642a2322a7cff4db0987170390e59b5262c666f6065350f7f040ae2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f0a6ef501ca49b70defd8ace627633f3707a77987209bc96f23bf9c4fcc974c7e968f119df3c815d3098e47ea3e8e46c22820bb3be785f915d5dc8cd43105bfc
|
|
7
|
+
data.tar.gz: 03f7118160928a454dc0a6b6ab6186e77e56f13bed15bb0a04f7ecaf5d8df349318aa55158c99ba957cfed6cf73a6da4c3c2084ca65e410f6008a5985a9d4b0a
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
Unreleased Changes
|
|
2
2
|
------------------
|
|
3
3
|
|
|
4
|
+
1.85.0 (2026-04-20)
|
|
5
|
+
------------------
|
|
6
|
+
|
|
7
|
+
* Feature - This release adds support for new Job APIs for bulk workloads. The initial job type supported is Address Validation. The new APIs added are StartJob, CancelJob, ListJobs, and GetJob.
|
|
8
|
+
|
|
4
9
|
1.84.0 (2026-03-18)
|
|
5
10
|
------------------
|
|
6
11
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.
|
|
1
|
+
1.85.0
|
|
@@ -1463,6 +1463,48 @@ module Aws::LocationService
|
|
|
1463
1463
|
req.send_request(options)
|
|
1464
1464
|
end
|
|
1465
1465
|
|
|
1466
|
+
# `CancelJob` cancels a job that is currently running or pending. If the
|
|
1467
|
+
# job is already in a terminal state (`Completed`, `Failed`, or
|
|
1468
|
+
# `Cancelled`), the operation returns successfully with the current
|
|
1469
|
+
# status.
|
|
1470
|
+
#
|
|
1471
|
+
# For more information, see [Job concepts][1] in the *Amazon Location
|
|
1472
|
+
# Service Developer Guide*.
|
|
1473
|
+
#
|
|
1474
|
+
#
|
|
1475
|
+
#
|
|
1476
|
+
# [1]: https://docs.aws.amazon.com/location/latest/developerguide/jobs-concepts.html
|
|
1477
|
+
#
|
|
1478
|
+
# @option params [required, String] :job_id
|
|
1479
|
+
# The unique identifier of the job to cancel.
|
|
1480
|
+
#
|
|
1481
|
+
# @return [Types::CancelJobResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
|
1482
|
+
#
|
|
1483
|
+
# * {Types::CancelJobResponse#job_arn #job_arn} => String
|
|
1484
|
+
# * {Types::CancelJobResponse#job_id #job_id} => String
|
|
1485
|
+
# * {Types::CancelJobResponse#status #status} => String
|
|
1486
|
+
#
|
|
1487
|
+
# @example Request syntax with placeholder values
|
|
1488
|
+
#
|
|
1489
|
+
# resp = client.cancel_job({
|
|
1490
|
+
# job_id: "JobId", # required
|
|
1491
|
+
# })
|
|
1492
|
+
#
|
|
1493
|
+
# @example Response structure
|
|
1494
|
+
#
|
|
1495
|
+
# resp.job_arn #=> String
|
|
1496
|
+
# resp.job_id #=> String
|
|
1497
|
+
# resp.status #=> String, one of "Pending", "Running", "Completed", "Failed", "Cancelling", "Cancelled"
|
|
1498
|
+
#
|
|
1499
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/location-2020-11-19/CancelJob AWS API Documentation
|
|
1500
|
+
#
|
|
1501
|
+
# @overload cancel_job(params = {})
|
|
1502
|
+
# @param [Hash] params ({})
|
|
1503
|
+
def cancel_job(params = {}, options = {})
|
|
1504
|
+
req = build_request(:cancel_job, params)
|
|
1505
|
+
req.send_request(options)
|
|
1506
|
+
end
|
|
1507
|
+
|
|
1466
1508
|
# Creates a geofence collection, which manages and stores geofences.
|
|
1467
1509
|
#
|
|
1468
1510
|
# @option params [required, String] :collection_name
|
|
@@ -3262,6 +3304,80 @@ module Aws::LocationService
|
|
|
3262
3304
|
req.send_request(options)
|
|
3263
3305
|
end
|
|
3264
3306
|
|
|
3307
|
+
# `GetJob` retrieves detailed information about a specific job,
|
|
3308
|
+
# including its current status, configuration, and error information if
|
|
3309
|
+
# the job failed.
|
|
3310
|
+
#
|
|
3311
|
+
# For more information, see [Job concepts][1] in the *Amazon Location
|
|
3312
|
+
# Service Developer Guide*.
|
|
3313
|
+
#
|
|
3314
|
+
#
|
|
3315
|
+
#
|
|
3316
|
+
# [1]: https://docs.aws.amazon.com/location/latest/developerguide/jobs-concepts.html
|
|
3317
|
+
#
|
|
3318
|
+
# @option params [required, String] :job_id
|
|
3319
|
+
# The unique identifier of the job to retrieve.
|
|
3320
|
+
#
|
|
3321
|
+
# @return [Types::GetJobResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
|
3322
|
+
#
|
|
3323
|
+
# * {Types::GetJobResponse#action #action} => String
|
|
3324
|
+
# * {Types::GetJobResponse#action_options #action_options} => Types::JobActionOptions
|
|
3325
|
+
# * {Types::GetJobResponse#created_at #created_at} => Time
|
|
3326
|
+
# * {Types::GetJobResponse#ended_at #ended_at} => Time
|
|
3327
|
+
# * {Types::GetJobResponse#error #error} => Types::JobError
|
|
3328
|
+
# * {Types::GetJobResponse#execution_role_arn #execution_role_arn} => String
|
|
3329
|
+
# * {Types::GetJobResponse#input_options #input_options} => Types::JobInputOptions
|
|
3330
|
+
# * {Types::GetJobResponse#job_arn #job_arn} => String
|
|
3331
|
+
# * {Types::GetJobResponse#job_id #job_id} => String
|
|
3332
|
+
# * {Types::GetJobResponse#name #name} => String
|
|
3333
|
+
# * {Types::GetJobResponse#output_options #output_options} => Types::JobOutputOptions
|
|
3334
|
+
# * {Types::GetJobResponse#status #status} => String
|
|
3335
|
+
# * {Types::GetJobResponse#updated_at #updated_at} => Time
|
|
3336
|
+
# * {Types::GetJobResponse#tags #tags} => Hash<String,String>
|
|
3337
|
+
#
|
|
3338
|
+
# @example Request syntax with placeholder values
|
|
3339
|
+
#
|
|
3340
|
+
# resp = client.get_job({
|
|
3341
|
+
# job_id: "JobId", # required
|
|
3342
|
+
# })
|
|
3343
|
+
#
|
|
3344
|
+
# @example Response structure
|
|
3345
|
+
#
|
|
3346
|
+
# resp.action #=> String, one of "ValidateAddress"
|
|
3347
|
+
# resp.action_options.validate_address.additional_features #=> Array
|
|
3348
|
+
# resp.action_options.validate_address.additional_features[0] #=> String, one of "Position", "CountrySpecificAttributes"
|
|
3349
|
+
# resp.created_at #=> Time
|
|
3350
|
+
# resp.ended_at #=> Time
|
|
3351
|
+
# resp.error.code #=> String, one of "ValidationError", "InternalServerError"
|
|
3352
|
+
# resp.error.messages #=> Array
|
|
3353
|
+
# resp.error.messages[0] #=> String
|
|
3354
|
+
# resp.execution_role_arn #=> String
|
|
3355
|
+
# resp.input_options.location #=> String
|
|
3356
|
+
# resp.input_options.format #=> String, one of "Parquet"
|
|
3357
|
+
# resp.job_arn #=> String
|
|
3358
|
+
# resp.job_id #=> String
|
|
3359
|
+
# resp.name #=> String
|
|
3360
|
+
# resp.output_options.format #=> String, one of "Parquet"
|
|
3361
|
+
# resp.output_options.location #=> String
|
|
3362
|
+
# resp.status #=> String, one of "Pending", "Running", "Completed", "Failed", "Cancelling", "Cancelled"
|
|
3363
|
+
# resp.updated_at #=> Time
|
|
3364
|
+
# resp.tags #=> Hash
|
|
3365
|
+
# resp.tags["TagKey"] #=> String
|
|
3366
|
+
#
|
|
3367
|
+
#
|
|
3368
|
+
# The following waiters are defined for this operation (see {Client#wait_until} for detailed usage):
|
|
3369
|
+
#
|
|
3370
|
+
# * job_completed
|
|
3371
|
+
#
|
|
3372
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/location-2020-11-19/GetJob AWS API Documentation
|
|
3373
|
+
#
|
|
3374
|
+
# @overload get_job(params = {})
|
|
3375
|
+
# @param [Hash] params ({})
|
|
3376
|
+
def get_job(params = {}, options = {})
|
|
3377
|
+
req = build_request(:get_job, params)
|
|
3378
|
+
req.send_request(options)
|
|
3379
|
+
end
|
|
3380
|
+
|
|
3265
3381
|
# This operation is no longer current and may be deprecated in the
|
|
3266
3382
|
# future. We recommend upgrading to [ `GetGlyphs` ][1] unless you
|
|
3267
3383
|
# require `Grab` data.
|
|
@@ -3963,6 +4079,76 @@ module Aws::LocationService
|
|
|
3963
4079
|
req.send_request(options)
|
|
3964
4080
|
end
|
|
3965
4081
|
|
|
4082
|
+
# `ListJobs` retrieves a list of jobs with optional filtering and
|
|
4083
|
+
# pagination support.
|
|
4084
|
+
#
|
|
4085
|
+
# For more information, see [Job concepts][1] in the *Amazon Location
|
|
4086
|
+
# Service Developer Guide*.
|
|
4087
|
+
#
|
|
4088
|
+
#
|
|
4089
|
+
#
|
|
4090
|
+
# [1]: https://docs.aws.amazon.com/location/latest/developerguide/jobs-concepts.html
|
|
4091
|
+
#
|
|
4092
|
+
# @option params [Types::JobsFilter] :filter
|
|
4093
|
+
# An optional structure containing criteria by which to filter job
|
|
4094
|
+
# results.
|
|
4095
|
+
#
|
|
4096
|
+
# @option params [Integer] :max_results
|
|
4097
|
+
# Maximum number of jobs to return.
|
|
4098
|
+
#
|
|
4099
|
+
# @option params [String] :next_token
|
|
4100
|
+
# The pagination token specifying which page of results to return in the
|
|
4101
|
+
# response. If no token is provided, the default page is the first page.
|
|
4102
|
+
#
|
|
4103
|
+
# @return [Types::ListJobsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
|
4104
|
+
#
|
|
4105
|
+
# * {Types::ListJobsResponse#entries #data.entries} => Array<Types::ListJobsResponseEntry> (This method conflicts with a method on Response, call it through the data member)
|
|
4106
|
+
# * {Types::ListJobsResponse#next_token #next_token} => String
|
|
4107
|
+
#
|
|
4108
|
+
# The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
|
|
4109
|
+
#
|
|
4110
|
+
# @example Request syntax with placeholder values
|
|
4111
|
+
#
|
|
4112
|
+
# resp = client.list_jobs({
|
|
4113
|
+
# filter: {
|
|
4114
|
+
# job_status: "Pending", # accepts Pending, Running, Completed, Failed, Cancelling, Cancelled
|
|
4115
|
+
# },
|
|
4116
|
+
# max_results: 1,
|
|
4117
|
+
# next_token: "LargeToken",
|
|
4118
|
+
# })
|
|
4119
|
+
#
|
|
4120
|
+
# @example Response structure
|
|
4121
|
+
#
|
|
4122
|
+
# resp.data.entries #=> Array
|
|
4123
|
+
# resp.data.entries[0].action #=> String, one of "ValidateAddress"
|
|
4124
|
+
# resp.data.entries[0].action_options.validate_address.additional_features #=> Array
|
|
4125
|
+
# resp.data.entries[0].action_options.validate_address.additional_features[0] #=> String, one of "Position", "CountrySpecificAttributes"
|
|
4126
|
+
# resp.data.entries[0].created_at #=> Time
|
|
4127
|
+
# resp.data.entries[0].execution_role_arn #=> String
|
|
4128
|
+
# resp.data.entries[0].ended_at #=> Time
|
|
4129
|
+
# resp.data.entries[0].error.code #=> String, one of "ValidationError", "InternalServerError"
|
|
4130
|
+
# resp.data.entries[0].error.messages #=> Array
|
|
4131
|
+
# resp.data.entries[0].error.messages[0] #=> String
|
|
4132
|
+
# resp.data.entries[0].input_options.location #=> String
|
|
4133
|
+
# resp.data.entries[0].input_options.format #=> String, one of "Parquet"
|
|
4134
|
+
# resp.data.entries[0].job_id #=> String
|
|
4135
|
+
# resp.data.entries[0].job_arn #=> String
|
|
4136
|
+
# resp.data.entries[0].name #=> String
|
|
4137
|
+
# resp.data.entries[0].output_options.format #=> String, one of "Parquet"
|
|
4138
|
+
# resp.data.entries[0].output_options.location #=> String
|
|
4139
|
+
# resp.data.entries[0].status #=> String, one of "Pending", "Running", "Completed", "Failed", "Cancelling", "Cancelled"
|
|
4140
|
+
# resp.data.entries[0].updated_at #=> Time
|
|
4141
|
+
# resp.next_token #=> String
|
|
4142
|
+
#
|
|
4143
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/location-2020-11-19/ListJobs AWS API Documentation
|
|
4144
|
+
#
|
|
4145
|
+
# @overload list_jobs(params = {})
|
|
4146
|
+
# @param [Hash] params ({})
|
|
4147
|
+
def list_jobs(params = {}, options = {})
|
|
4148
|
+
req = build_request(:list_jobs, params)
|
|
4149
|
+
req.send_request(options)
|
|
4150
|
+
end
|
|
4151
|
+
|
|
3966
4152
|
# Lists API key resources in your Amazon Web Services account.
|
|
3967
4153
|
#
|
|
3968
4154
|
# For more information, see [Use API keys to authenticate][1] in the
|
|
@@ -5010,6 +5196,113 @@ module Aws::LocationService
|
|
|
5010
5196
|
req.send_request(options)
|
|
5011
5197
|
end
|
|
5012
5198
|
|
|
5199
|
+
# `StartJob` starts a new asynchronous bulk processing job. You specify
|
|
5200
|
+
# the input data location in Amazon S3, the action to perform, and the
|
|
5201
|
+
# output location where results are written.
|
|
5202
|
+
#
|
|
5203
|
+
# For more information, see [Job concepts][1] in the *Amazon Location
|
|
5204
|
+
# Service Developer Guide*.
|
|
5205
|
+
#
|
|
5206
|
+
#
|
|
5207
|
+
#
|
|
5208
|
+
# [1]: https://docs.aws.amazon.com/location/latest/developerguide/jobs-concepts.html
|
|
5209
|
+
#
|
|
5210
|
+
# @option params [String] :client_token
|
|
5211
|
+
# A unique identifier for this request to ensure idempotency.
|
|
5212
|
+
#
|
|
5213
|
+
# **A suitable default value is auto-generated.** You should normally
|
|
5214
|
+
# not need to pass this option.**
|
|
5215
|
+
#
|
|
5216
|
+
# @option params [required, String] :action
|
|
5217
|
+
# The action to perform on the input data.
|
|
5218
|
+
#
|
|
5219
|
+
# @option params [Types::JobActionOptions] :action_options
|
|
5220
|
+
# Additional parameters that can be requested for each result.
|
|
5221
|
+
#
|
|
5222
|
+
# @option params [required, String] :execution_role_arn
|
|
5223
|
+
# The Amazon Resource Name (ARN) of the IAM role that Amazon Location
|
|
5224
|
+
# Service assumes during job processing. Amazon Location Service uses
|
|
5225
|
+
# this role to access the input and output locations specified for the
|
|
5226
|
+
# job.
|
|
5227
|
+
#
|
|
5228
|
+
# <note markdown="1"> The IAM role must be created in the same Amazon Web Services account
|
|
5229
|
+
# where you plan to run your job.
|
|
5230
|
+
#
|
|
5231
|
+
# </note>
|
|
5232
|
+
#
|
|
5233
|
+
# For more information about configuring IAM roles for Amazon Location
|
|
5234
|
+
# jobs, see [Configure IAM permissions][1] in the *Amazon Location
|
|
5235
|
+
# Service Developer Guide*.
|
|
5236
|
+
#
|
|
5237
|
+
#
|
|
5238
|
+
#
|
|
5239
|
+
# [1]: https://docs.aws.amazon.com/location/latest/developerguide/configure-iam-role-policy-credentials.html
|
|
5240
|
+
#
|
|
5241
|
+
# @option params [required, Types::JobInputOptions] :input_options
|
|
5242
|
+
# Configuration for input data location and format.
|
|
5243
|
+
#
|
|
5244
|
+
# <note markdown="1"> Input files have a limitation of 10gb per file, and 1gb per Parquet
|
|
5245
|
+
# row-group within the file.
|
|
5246
|
+
#
|
|
5247
|
+
# </note>
|
|
5248
|
+
#
|
|
5249
|
+
# @option params [String] :name
|
|
5250
|
+
# An optional name for the job resource.
|
|
5251
|
+
#
|
|
5252
|
+
# @option params [required, Types::JobOutputOptions] :output_options
|
|
5253
|
+
# Configuration for output data location and format.
|
|
5254
|
+
#
|
|
5255
|
+
# @option params [Hash<String,String>] :tags
|
|
5256
|
+
# Tags and corresponding values to be associated with the job.
|
|
5257
|
+
#
|
|
5258
|
+
# @return [Types::StartJobResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
|
5259
|
+
#
|
|
5260
|
+
# * {Types::StartJobResponse#created_at #created_at} => Time
|
|
5261
|
+
# * {Types::StartJobResponse#job_arn #job_arn} => String
|
|
5262
|
+
# * {Types::StartJobResponse#job_id #job_id} => String
|
|
5263
|
+
# * {Types::StartJobResponse#status #status} => String
|
|
5264
|
+
#
|
|
5265
|
+
# @example Request syntax with placeholder values
|
|
5266
|
+
#
|
|
5267
|
+
# resp = client.start_job({
|
|
5268
|
+
# client_token: "ClientToken",
|
|
5269
|
+
# action: "ValidateAddress", # required, accepts ValidateAddress
|
|
5270
|
+
# action_options: {
|
|
5271
|
+
# validate_address: {
|
|
5272
|
+
# additional_features: ["Position"], # accepts Position, CountrySpecificAttributes
|
|
5273
|
+
# },
|
|
5274
|
+
# },
|
|
5275
|
+
# execution_role_arn: "IamRoleArn", # required
|
|
5276
|
+
# input_options: { # required
|
|
5277
|
+
# location: "JobInputLocation", # required
|
|
5278
|
+
# format: "Parquet", # required, accepts Parquet
|
|
5279
|
+
# },
|
|
5280
|
+
# name: "ResourceName",
|
|
5281
|
+
# output_options: { # required
|
|
5282
|
+
# format: "Parquet", # required, accepts Parquet
|
|
5283
|
+
# location: "JobOutputLocation", # required
|
|
5284
|
+
# },
|
|
5285
|
+
# tags: {
|
|
5286
|
+
# "TagKey" => "TagValue",
|
|
5287
|
+
# },
|
|
5288
|
+
# })
|
|
5289
|
+
#
|
|
5290
|
+
# @example Response structure
|
|
5291
|
+
#
|
|
5292
|
+
# resp.created_at #=> Time
|
|
5293
|
+
# resp.job_arn #=> String
|
|
5294
|
+
# resp.job_id #=> String
|
|
5295
|
+
# resp.status #=> String, one of "Pending", "Running", "Completed", "Failed", "Cancelling", "Cancelled"
|
|
5296
|
+
#
|
|
5297
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/location-2020-11-19/StartJob AWS API Documentation
|
|
5298
|
+
#
|
|
5299
|
+
# @overload start_job(params = {})
|
|
5300
|
+
# @param [Hash] params ({})
|
|
5301
|
+
def start_job(params = {}, options = {})
|
|
5302
|
+
req = build_request(:start_job, params)
|
|
5303
|
+
req.send_request(options)
|
|
5304
|
+
end
|
|
5305
|
+
|
|
5013
5306
|
# Assigns one or more tags (key-value pairs) to the specified Amazon
|
|
5014
5307
|
# Location Service resource.
|
|
5015
5308
|
#
|
|
@@ -5668,14 +5961,127 @@ module Aws::LocationService
|
|
|
5668
5961
|
tracer: tracer
|
|
5669
5962
|
)
|
|
5670
5963
|
context[:gem_name] = 'aws-sdk-locationservice'
|
|
5671
|
-
context[:gem_version] = '1.
|
|
5964
|
+
context[:gem_version] = '1.85.0'
|
|
5672
5965
|
Seahorse::Client::Request.new(handlers, context)
|
|
5673
5966
|
end
|
|
5674
5967
|
|
|
5968
|
+
# Polls an API operation until a resource enters a desired state.
|
|
5969
|
+
#
|
|
5970
|
+
# ## Basic Usage
|
|
5971
|
+
#
|
|
5972
|
+
# A waiter will call an API operation until:
|
|
5973
|
+
#
|
|
5974
|
+
# * It is successful
|
|
5975
|
+
# * It enters a terminal state
|
|
5976
|
+
# * It makes the maximum number of attempts
|
|
5977
|
+
#
|
|
5978
|
+
# In between attempts, the waiter will sleep.
|
|
5979
|
+
#
|
|
5980
|
+
# # polls in a loop, sleeping between attempts
|
|
5981
|
+
# client.wait_until(waiter_name, params)
|
|
5982
|
+
#
|
|
5983
|
+
# ## Configuration
|
|
5984
|
+
#
|
|
5985
|
+
# You can configure the maximum number of polling attempts, and the
|
|
5986
|
+
# delay (in seconds) between each polling attempt. You can pass
|
|
5987
|
+
# configuration as the final arguments hash.
|
|
5988
|
+
#
|
|
5989
|
+
# # poll for ~25 seconds
|
|
5990
|
+
# client.wait_until(waiter_name, params, {
|
|
5991
|
+
# max_attempts: 5,
|
|
5992
|
+
# delay: 5,
|
|
5993
|
+
# })
|
|
5994
|
+
#
|
|
5995
|
+
# ## Callbacks
|
|
5996
|
+
#
|
|
5997
|
+
# You can be notified before each polling attempt and before each
|
|
5998
|
+
# delay. If you throw `:success` or `:failure` from these callbacks,
|
|
5999
|
+
# it will terminate the waiter.
|
|
6000
|
+
#
|
|
6001
|
+
# started_at = Time.now
|
|
6002
|
+
# client.wait_until(waiter_name, params, {
|
|
6003
|
+
#
|
|
6004
|
+
# # disable max attempts
|
|
6005
|
+
# max_attempts: nil,
|
|
6006
|
+
#
|
|
6007
|
+
# # poll for 1 hour, instead of a number of attempts
|
|
6008
|
+
# before_wait: -> (attempts, response) do
|
|
6009
|
+
# throw :failure if Time.now - started_at > 3600
|
|
6010
|
+
# end
|
|
6011
|
+
# })
|
|
6012
|
+
#
|
|
6013
|
+
# ## Handling Errors
|
|
6014
|
+
#
|
|
6015
|
+
# When a waiter is unsuccessful, it will raise an error.
|
|
6016
|
+
# All of the failure errors extend from
|
|
6017
|
+
# {Aws::Waiters::Errors::WaiterFailed}.
|
|
6018
|
+
#
|
|
6019
|
+
# begin
|
|
6020
|
+
# client.wait_until(...)
|
|
6021
|
+
# rescue Aws::Waiters::Errors::WaiterFailed
|
|
6022
|
+
# # resource did not enter the desired state in time
|
|
6023
|
+
# end
|
|
6024
|
+
#
|
|
6025
|
+
# ## Valid Waiters
|
|
6026
|
+
#
|
|
6027
|
+
# The following table lists the valid waiter names, the operations they call,
|
|
6028
|
+
# and the default `:delay` and `:max_attempts` values.
|
|
6029
|
+
#
|
|
6030
|
+
# | waiter_name | params | :delay | :max_attempts |
|
|
6031
|
+
# | ------------- | ---------------- | -------- | ------------- |
|
|
6032
|
+
# | job_completed | {Client#get_job} | 60 | 5 |
|
|
6033
|
+
#
|
|
6034
|
+
# @raise [Errors::FailureStateError] Raised when the waiter terminates
|
|
6035
|
+
# because the waiter has entered a state that it will not transition
|
|
6036
|
+
# out of, preventing success.
|
|
6037
|
+
#
|
|
6038
|
+
# @raise [Errors::TooManyAttemptsError] Raised when the configured
|
|
6039
|
+
# maximum number of attempts have been made, and the waiter is not
|
|
6040
|
+
# yet successful.
|
|
6041
|
+
#
|
|
6042
|
+
# @raise [Errors::UnexpectedError] Raised when an error is encounted
|
|
6043
|
+
# while polling for a resource that is not expected.
|
|
6044
|
+
#
|
|
6045
|
+
# @raise [Errors::NoSuchWaiterError] Raised when you request to wait
|
|
6046
|
+
# for an unknown state.
|
|
6047
|
+
#
|
|
6048
|
+
# @return [Boolean] Returns `true` if the waiter was successful.
|
|
6049
|
+
# @param [Symbol] waiter_name
|
|
6050
|
+
# @param [Hash] params ({})
|
|
6051
|
+
# @param [Hash] options ({})
|
|
6052
|
+
# @option options [Integer] :max_attempts
|
|
6053
|
+
# @option options [Integer] :delay
|
|
6054
|
+
# @option options [Proc] :before_attempt
|
|
6055
|
+
# @option options [Proc] :before_wait
|
|
6056
|
+
def wait_until(waiter_name, params = {}, options = {})
|
|
6057
|
+
w = waiter(waiter_name, options)
|
|
6058
|
+
yield(w.waiter) if block_given? # deprecated
|
|
6059
|
+
w.wait(params)
|
|
6060
|
+
end
|
|
6061
|
+
|
|
5675
6062
|
# @api private
|
|
5676
6063
|
# @deprecated
|
|
5677
6064
|
def waiter_names
|
|
5678
|
-
|
|
6065
|
+
waiters.keys
|
|
6066
|
+
end
|
|
6067
|
+
|
|
6068
|
+
private
|
|
6069
|
+
|
|
6070
|
+
# @param [Symbol] waiter_name
|
|
6071
|
+
# @param [Hash] options ({})
|
|
6072
|
+
def waiter(waiter_name, options = {})
|
|
6073
|
+
waiter_class = waiters[waiter_name]
|
|
6074
|
+
if waiter_class
|
|
6075
|
+
waiter_class.new(options.merge(client: self))
|
|
6076
|
+
else
|
|
6077
|
+
raise Aws::Waiters::Errors::NoSuchWaiterError.new(waiter_name, waiters.keys)
|
|
6078
|
+
end
|
|
6079
|
+
end
|
|
6080
|
+
|
|
6081
|
+
def waiters
|
|
6082
|
+
{
|
|
6083
|
+
job_completed: Waiters::JobCompleted
|
|
6084
|
+
}
|
|
5679
6085
|
end
|
|
5680
6086
|
|
|
5681
6087
|
class << self
|