aws-sdk-transfer 1.48.0 → 1.51.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 +15 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-transfer/client.rb +157 -4
- data/lib/aws-sdk-transfer/types.rb +77 -4
- data/lib/aws-sdk-transfer/waiters.rb +165 -0
- data/lib/aws-sdk-transfer.rb +2 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c7ebfe35b8189393b2cb7d7e2dc0075a9fc346bfecf2c8ada3775293ac64b0b
|
4
|
+
data.tar.gz: 5846819507d83c00b63ae4fb1c93d09ec088e6aa015768ca78d8b53c019970b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac4893b7513f79c391eb4d1aa813f6a31334ab38203ddfc0f47d299b88d02b65038fbec2456154a47d3f72e40ecf57410d5c82be1d4e26d787c4a44ea6f13c9d
|
7
|
+
data.tar.gz: 2810caafe6baba9e75cbaccdd9116c1f6078b3a9508fe7e4d36ca9128f6d7b9e87bbec9d049ebc02e4daec9e355df8ab8cb277ce1587c5f4723848fcf95f4144
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,21 @@
|
|
1
1
|
Unreleased Changes
|
2
2
|
------------------
|
3
3
|
|
4
|
+
1.51.0 (2022-03-10)
|
5
|
+
------------------
|
6
|
+
|
7
|
+
* Feature - Adding more descriptive error types for managed workflows
|
8
|
+
|
9
|
+
1.50.0 (2022-03-04)
|
10
|
+
------------------
|
11
|
+
|
12
|
+
* Feature - Add waiters for server online and offline.
|
13
|
+
|
14
|
+
1.49.0 (2022-02-24)
|
15
|
+
------------------
|
16
|
+
|
17
|
+
* Feature - Support automatic pagination when listing AWS Transfer Family resources.
|
18
|
+
|
4
19
|
1.48.0 (2022-02-23)
|
5
20
|
------------------
|
6
21
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.51.0
|
@@ -27,6 +27,7 @@ require 'aws-sdk-core/plugins/client_metrics_plugin.rb'
|
|
27
27
|
require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
|
28
28
|
require 'aws-sdk-core/plugins/transfer_encoding.rb'
|
29
29
|
require 'aws-sdk-core/plugins/http_checksum.rb'
|
30
|
+
require 'aws-sdk-core/plugins/checksum_algorithm.rb'
|
30
31
|
require 'aws-sdk-core/plugins/defaults_mode.rb'
|
31
32
|
require 'aws-sdk-core/plugins/recursion_detection.rb'
|
32
33
|
require 'aws-sdk-core/plugins/signature_v4.rb'
|
@@ -75,6 +76,7 @@ module Aws::Transfer
|
|
75
76
|
add_plugin(Aws::Plugins::ClientMetricsSendPlugin)
|
76
77
|
add_plugin(Aws::Plugins::TransferEncoding)
|
77
78
|
add_plugin(Aws::Plugins::HttpChecksum)
|
79
|
+
add_plugin(Aws::Plugins::ChecksumAlgorithm)
|
78
80
|
add_plugin(Aws::Plugins::DefaultsMode)
|
79
81
|
add_plugin(Aws::Plugins::RecursionDetection)
|
80
82
|
add_plugin(Aws::Plugins::SignatureV4)
|
@@ -655,8 +657,23 @@ module Aws::Transfer
|
|
655
657
|
# set, user activity can be viewed in your CloudWatch logs.
|
656
658
|
#
|
657
659
|
# @option params [String] :post_authentication_login_banner
|
660
|
+
# Specify a string to display when users connect to a server. This
|
661
|
+
# string is displayed after the user authenticates.
|
662
|
+
#
|
663
|
+
# <note markdown="1"> The SFTP protocol does not support post-authentication display
|
664
|
+
# banners.
|
665
|
+
#
|
666
|
+
# </note>
|
658
667
|
#
|
659
668
|
# @option params [String] :pre_authentication_login_banner
|
669
|
+
# Specify a string to display when users connect to a server. This
|
670
|
+
# string is displayed before the user authenticates. For example, the
|
671
|
+
# following banner displays details about using the system.
|
672
|
+
#
|
673
|
+
# `This system is for the use of authorized users only. Individuals
|
674
|
+
# using this computer system without authority, or in excess of their
|
675
|
+
# authority, are subject to having all of their activities on this
|
676
|
+
# system monitored and recorded by system personnel.`
|
660
677
|
#
|
661
678
|
# @option params [Array<String>] :protocols
|
662
679
|
# Specifies the file transfer protocol or protocols over which your file
|
@@ -1361,12 +1378,12 @@ module Aws::Transfer
|
|
1361
1378
|
# resp.execution.results.steps #=> Array
|
1362
1379
|
# resp.execution.results.steps[0].step_type #=> String, one of "COPY", "CUSTOM", "TAG", "DELETE"
|
1363
1380
|
# resp.execution.results.steps[0].outputs #=> String
|
1364
|
-
# resp.execution.results.steps[0].error.type #=> String, one of "PERMISSION_DENIED"
|
1381
|
+
# resp.execution.results.steps[0].error.type #=> String, one of "PERMISSION_DENIED", "CUSTOM_STEP_FAILED", "THROTTLED", "ALREADY_EXISTS", "NOT_FOUND", "BAD_REQUEST", "TIMEOUT", "INTERNAL_SERVER_ERROR"
|
1365
1382
|
# resp.execution.results.steps[0].error.message #=> String
|
1366
1383
|
# resp.execution.results.on_exception_steps #=> Array
|
1367
1384
|
# resp.execution.results.on_exception_steps[0].step_type #=> String, one of "COPY", "CUSTOM", "TAG", "DELETE"
|
1368
1385
|
# resp.execution.results.on_exception_steps[0].outputs #=> String
|
1369
|
-
# resp.execution.results.on_exception_steps[0].error.type #=> String, one of "PERMISSION_DENIED"
|
1386
|
+
# resp.execution.results.on_exception_steps[0].error.type #=> String, one of "PERMISSION_DENIED", "CUSTOM_STEP_FAILED", "THROTTLED", "ALREADY_EXISTS", "NOT_FOUND", "BAD_REQUEST", "TIMEOUT", "INTERNAL_SERVER_ERROR"
|
1370
1387
|
# resp.execution.results.on_exception_steps[0].error.message #=> String
|
1371
1388
|
#
|
1372
1389
|
# @see http://docs.aws.amazon.com/goto/WebAPI/transfer-2018-11-05/DescribeExecution AWS API Documentation
|
@@ -1481,6 +1498,12 @@ module Aws::Transfer
|
|
1481
1498
|
# resp.server.workflow_details.on_upload[0].workflow_id #=> String
|
1482
1499
|
# resp.server.workflow_details.on_upload[0].execution_role #=> String
|
1483
1500
|
#
|
1501
|
+
#
|
1502
|
+
# The following waiters are defined for this operation (see {Client#wait_until} for detailed usage):
|
1503
|
+
#
|
1504
|
+
# * server_offline
|
1505
|
+
# * server_online
|
1506
|
+
#
|
1484
1507
|
# @see http://docs.aws.amazon.com/goto/WebAPI/transfer-2018-11-05/DescribeServer AWS API Documentation
|
1485
1508
|
#
|
1486
1509
|
# @overload describe_server(params = {})
|
@@ -2564,8 +2587,23 @@ module Aws::Transfer
|
|
2564
2587
|
# set, user activity can be viewed in your CloudWatch logs.
|
2565
2588
|
#
|
2566
2589
|
# @option params [String] :post_authentication_login_banner
|
2590
|
+
# Specify a string to display when users connect to a server. This
|
2591
|
+
# string is displayed after the user authenticates.
|
2592
|
+
#
|
2593
|
+
# <note markdown="1"> The SFTP protocol does not support post-authentication display
|
2594
|
+
# banners.
|
2595
|
+
#
|
2596
|
+
# </note>
|
2567
2597
|
#
|
2568
2598
|
# @option params [String] :pre_authentication_login_banner
|
2599
|
+
# Specify a string to display when users connect to a server. This
|
2600
|
+
# string is displayed before the user authenticates. For example, the
|
2601
|
+
# following banner displays details about using the system.
|
2602
|
+
#
|
2603
|
+
# `This system is for the use of authorized users only. Individuals
|
2604
|
+
# using this computer system without authority, or in excess of their
|
2605
|
+
# authority, are subject to having all of their activities on this
|
2606
|
+
# system monitored and recorded by system personnel.`
|
2569
2607
|
#
|
2570
2608
|
# @option params [Array<String>] :protocols
|
2571
2609
|
# Specifies the file transfer protocol or protocols over which your file
|
@@ -2822,14 +2860,129 @@ module Aws::Transfer
|
|
2822
2860
|
params: params,
|
2823
2861
|
config: config)
|
2824
2862
|
context[:gem_name] = 'aws-sdk-transfer'
|
2825
|
-
context[:gem_version] = '1.
|
2863
|
+
context[:gem_version] = '1.51.0'
|
2826
2864
|
Seahorse::Client::Request.new(handlers, context)
|
2827
2865
|
end
|
2828
2866
|
|
2867
|
+
# Polls an API operation until a resource enters a desired state.
|
2868
|
+
#
|
2869
|
+
# ## Basic Usage
|
2870
|
+
#
|
2871
|
+
# A waiter will call an API operation until:
|
2872
|
+
#
|
2873
|
+
# * It is successful
|
2874
|
+
# * It enters a terminal state
|
2875
|
+
# * It makes the maximum number of attempts
|
2876
|
+
#
|
2877
|
+
# In between attempts, the waiter will sleep.
|
2878
|
+
#
|
2879
|
+
# # polls in a loop, sleeping between attempts
|
2880
|
+
# client.wait_until(waiter_name, params)
|
2881
|
+
#
|
2882
|
+
# ## Configuration
|
2883
|
+
#
|
2884
|
+
# You can configure the maximum number of polling attempts, and the
|
2885
|
+
# delay (in seconds) between each polling attempt. You can pass
|
2886
|
+
# configuration as the final arguments hash.
|
2887
|
+
#
|
2888
|
+
# # poll for ~25 seconds
|
2889
|
+
# client.wait_until(waiter_name, params, {
|
2890
|
+
# max_attempts: 5,
|
2891
|
+
# delay: 5,
|
2892
|
+
# })
|
2893
|
+
#
|
2894
|
+
# ## Callbacks
|
2895
|
+
#
|
2896
|
+
# You can be notified before each polling attempt and before each
|
2897
|
+
# delay. If you throw `:success` or `:failure` from these callbacks,
|
2898
|
+
# it will terminate the waiter.
|
2899
|
+
#
|
2900
|
+
# started_at = Time.now
|
2901
|
+
# client.wait_until(waiter_name, params, {
|
2902
|
+
#
|
2903
|
+
# # disable max attempts
|
2904
|
+
# max_attempts: nil,
|
2905
|
+
#
|
2906
|
+
# # poll for 1 hour, instead of a number of attempts
|
2907
|
+
# before_wait: -> (attempts, response) do
|
2908
|
+
# throw :failure if Time.now - started_at > 3600
|
2909
|
+
# end
|
2910
|
+
# })
|
2911
|
+
#
|
2912
|
+
# ## Handling Errors
|
2913
|
+
#
|
2914
|
+
# When a waiter is unsuccessful, it will raise an error.
|
2915
|
+
# All of the failure errors extend from
|
2916
|
+
# {Aws::Waiters::Errors::WaiterFailed}.
|
2917
|
+
#
|
2918
|
+
# begin
|
2919
|
+
# client.wait_until(...)
|
2920
|
+
# rescue Aws::Waiters::Errors::WaiterFailed
|
2921
|
+
# # resource did not enter the desired state in time
|
2922
|
+
# end
|
2923
|
+
#
|
2924
|
+
# ## Valid Waiters
|
2925
|
+
#
|
2926
|
+
# The following table lists the valid waiter names, the operations they call,
|
2927
|
+
# and the default `:delay` and `:max_attempts` values.
|
2928
|
+
#
|
2929
|
+
# | waiter_name | params | :delay | :max_attempts |
|
2930
|
+
# | -------------- | ------------------------ | -------- | ------------- |
|
2931
|
+
# | server_offline | {Client#describe_server} | 30 | 120 |
|
2932
|
+
# | server_online | {Client#describe_server} | 30 | 120 |
|
2933
|
+
#
|
2934
|
+
# @raise [Errors::FailureStateError] Raised when the waiter terminates
|
2935
|
+
# because the waiter has entered a state that it will not transition
|
2936
|
+
# out of, preventing success.
|
2937
|
+
#
|
2938
|
+
# @raise [Errors::TooManyAttemptsError] Raised when the configured
|
2939
|
+
# maximum number of attempts have been made, and the waiter is not
|
2940
|
+
# yet successful.
|
2941
|
+
#
|
2942
|
+
# @raise [Errors::UnexpectedError] Raised when an error is encounted
|
2943
|
+
# while polling for a resource that is not expected.
|
2944
|
+
#
|
2945
|
+
# @raise [Errors::NoSuchWaiterError] Raised when you request to wait
|
2946
|
+
# for an unknown state.
|
2947
|
+
#
|
2948
|
+
# @return [Boolean] Returns `true` if the waiter was successful.
|
2949
|
+
# @param [Symbol] waiter_name
|
2950
|
+
# @param [Hash] params ({})
|
2951
|
+
# @param [Hash] options ({})
|
2952
|
+
# @option options [Integer] :max_attempts
|
2953
|
+
# @option options [Integer] :delay
|
2954
|
+
# @option options [Proc] :before_attempt
|
2955
|
+
# @option options [Proc] :before_wait
|
2956
|
+
def wait_until(waiter_name, params = {}, options = {})
|
2957
|
+
w = waiter(waiter_name, options)
|
2958
|
+
yield(w.waiter) if block_given? # deprecated
|
2959
|
+
w.wait(params)
|
2960
|
+
end
|
2961
|
+
|
2829
2962
|
# @api private
|
2830
2963
|
# @deprecated
|
2831
2964
|
def waiter_names
|
2832
|
-
|
2965
|
+
waiters.keys
|
2966
|
+
end
|
2967
|
+
|
2968
|
+
private
|
2969
|
+
|
2970
|
+
# @param [Symbol] waiter_name
|
2971
|
+
# @param [Hash] options ({})
|
2972
|
+
def waiter(waiter_name, options = {})
|
2973
|
+
waiter_class = waiters[waiter_name]
|
2974
|
+
if waiter_class
|
2975
|
+
waiter_class.new(options.merge(client: self))
|
2976
|
+
else
|
2977
|
+
raise Aws::Waiters::Errors::NoSuchWaiterError.new(waiter_name, waiters.keys)
|
2978
|
+
end
|
2979
|
+
end
|
2980
|
+
|
2981
|
+
def waiters
|
2982
|
+
{
|
2983
|
+
server_offline: Waiters::ServerOffline,
|
2984
|
+
server_online: Waiters::ServerOnline
|
2985
|
+
}
|
2833
2986
|
end
|
2834
2987
|
|
2835
2988
|
class << self
|
@@ -465,9 +465,24 @@ module Aws::Transfer
|
|
465
465
|
# @return [String]
|
466
466
|
#
|
467
467
|
# @!attribute [rw] post_authentication_login_banner
|
468
|
+
# Specify a string to display when users connect to a server. This
|
469
|
+
# string is displayed after the user authenticates.
|
470
|
+
#
|
471
|
+
# <note markdown="1"> The SFTP protocol does not support post-authentication display
|
472
|
+
# banners.
|
473
|
+
#
|
474
|
+
# </note>
|
468
475
|
# @return [String]
|
469
476
|
#
|
470
477
|
# @!attribute [rw] pre_authentication_login_banner
|
478
|
+
# Specify a string to display when users connect to a server. This
|
479
|
+
# string is displayed before the user authenticates. For example, the
|
480
|
+
# following banner displays details about using the system.
|
481
|
+
#
|
482
|
+
# `This system is for the use of authorized users only. Individuals
|
483
|
+
# using this computer system without authority, or in excess of their
|
484
|
+
# authority, are subject to having all of their activities on this
|
485
|
+
# system monitored and recorded by system personnel.`
|
471
486
|
# @return [String]
|
472
487
|
#
|
473
488
|
# @!attribute [rw] protocols
|
@@ -1669,9 +1684,24 @@ module Aws::Transfer
|
|
1669
1684
|
# @return [String]
|
1670
1685
|
#
|
1671
1686
|
# @!attribute [rw] post_authentication_login_banner
|
1687
|
+
# Specify a string to display when users connect to a server. This
|
1688
|
+
# string is displayed after the user authenticates.
|
1689
|
+
#
|
1690
|
+
# <note markdown="1"> The SFTP protocol does not support post-authentication display
|
1691
|
+
# banners.
|
1692
|
+
#
|
1693
|
+
# </note>
|
1672
1694
|
# @return [String]
|
1673
1695
|
#
|
1674
1696
|
# @!attribute [rw] pre_authentication_login_banner
|
1697
|
+
# Specify a string to display when users connect to a server. This
|
1698
|
+
# string is displayed before the user authenticates. For example, the
|
1699
|
+
# following banner displays details about using the system.
|
1700
|
+
#
|
1701
|
+
# `This system is for the use of authorized users only. Individuals
|
1702
|
+
# using this computer system without authority, or in excess of their
|
1703
|
+
# authority, are subject to having all of their activities on this
|
1704
|
+
# system monitored and recorded by system personnel.`
|
1675
1705
|
# @return [String]
|
1676
1706
|
#
|
1677
1707
|
# @!attribute [rw] protocols
|
@@ -2027,10 +2057,38 @@ module Aws::Transfer
|
|
2027
2057
|
# the execution of the workflow.
|
2028
2058
|
#
|
2029
2059
|
# @!attribute [rw] type
|
2030
|
-
# Specifies the error type
|
2031
|
-
#
|
2032
|
-
#
|
2033
|
-
#
|
2060
|
+
# Specifies the error type.
|
2061
|
+
#
|
2062
|
+
# * `ALREADY_EXISTS`\: occurs for a copy step, if the overwrite option
|
2063
|
+
# is not selected and a file with the same name already exists in
|
2064
|
+
# the target location.
|
2065
|
+
#
|
2066
|
+
# * `BAD_REQUEST`\: a general bad request: for example, a step that
|
2067
|
+
# attempts to tag an EFS file returns `BAD_REQUEST`, as only S3
|
2068
|
+
# files can be tagged.
|
2069
|
+
#
|
2070
|
+
# * `CUSTOM_STEP_FAILED`\: occurs when the custom step provided a
|
2071
|
+
# callback that indicates failure.
|
2072
|
+
#
|
2073
|
+
# * `INTERNAL_SERVER_ERROR`\: a catch-all error that can occur for a
|
2074
|
+
# variety of reasons.
|
2075
|
+
#
|
2076
|
+
# * `NOT_FOUND`\: occurs when a requested entity, for example a source
|
2077
|
+
# file for a copy step, does not exist.
|
2078
|
+
#
|
2079
|
+
# * `PERMISSION_DENIED`\: occurs if your policy does not contain the
|
2080
|
+
# correct permissions to complete one or more of the steps in the
|
2081
|
+
# workflow.
|
2082
|
+
#
|
2083
|
+
# * `TIMEOUT`\: occurs when the execution times out.
|
2084
|
+
#
|
2085
|
+
# <note markdown="1"> You can set the `TimeoutSeconds` for a custom step, anywhere from
|
2086
|
+
# 1 second to 1800 seconds (30 minutes).
|
2087
|
+
#
|
2088
|
+
# </note>
|
2089
|
+
#
|
2090
|
+
# * `THROTTLED`\: occurs if you exceed the new execution refill rate
|
2091
|
+
# of one workflow per second.
|
2034
2092
|
# @return [String]
|
2035
2093
|
#
|
2036
2094
|
# @!attribute [rw] message
|
@@ -4031,9 +4089,24 @@ module Aws::Transfer
|
|
4031
4089
|
# @return [String]
|
4032
4090
|
#
|
4033
4091
|
# @!attribute [rw] post_authentication_login_banner
|
4092
|
+
# Specify a string to display when users connect to a server. This
|
4093
|
+
# string is displayed after the user authenticates.
|
4094
|
+
#
|
4095
|
+
# <note markdown="1"> The SFTP protocol does not support post-authentication display
|
4096
|
+
# banners.
|
4097
|
+
#
|
4098
|
+
# </note>
|
4034
4099
|
# @return [String]
|
4035
4100
|
#
|
4036
4101
|
# @!attribute [rw] pre_authentication_login_banner
|
4102
|
+
# Specify a string to display when users connect to a server. This
|
4103
|
+
# string is displayed before the user authenticates. For example, the
|
4104
|
+
# following banner displays details about using the system.
|
4105
|
+
#
|
4106
|
+
# `This system is for the use of authorized users only. Individuals
|
4107
|
+
# using this computer system without authority, or in excess of their
|
4108
|
+
# authority, are subject to having all of their activities on this
|
4109
|
+
# system monitored and recorded by system personnel.`
|
4037
4110
|
# @return [String]
|
4038
4111
|
#
|
4039
4112
|
# @!attribute [rw] protocols
|
@@ -0,0 +1,165 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# WARNING ABOUT GENERATED CODE
|
4
|
+
#
|
5
|
+
# This file is generated. See the contributing guide for more information:
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
7
|
+
#
|
8
|
+
# WARNING ABOUT GENERATED CODE
|
9
|
+
|
10
|
+
require 'aws-sdk-core/waiters'
|
11
|
+
|
12
|
+
module Aws::Transfer
|
13
|
+
# Waiters are utility methods that poll for a particular state to occur
|
14
|
+
# on a client. Waiters can fail after a number of attempts at a polling
|
15
|
+
# interval defined for the service client.
|
16
|
+
#
|
17
|
+
# For a list of operations that can be waited for and the
|
18
|
+
# client methods called for each operation, see the table below or the
|
19
|
+
# {Client#wait_until} field documentation for the {Client}.
|
20
|
+
#
|
21
|
+
# # Invoking a Waiter
|
22
|
+
# To invoke a waiter, call #wait_until on a {Client}. The first parameter
|
23
|
+
# is the waiter name, which is specific to the service client and indicates
|
24
|
+
# which operation is being waited for. The second parameter is a hash of
|
25
|
+
# parameters that are passed to the client method called by the waiter,
|
26
|
+
# which varies according to the waiter name.
|
27
|
+
#
|
28
|
+
# # Wait Failures
|
29
|
+
# To catch errors in a waiter, use WaiterFailed,
|
30
|
+
# as shown in the following example.
|
31
|
+
#
|
32
|
+
# rescue rescue Aws::Waiters::Errors::WaiterFailed => error
|
33
|
+
# puts "failed waiting for instance running: #{error.message}
|
34
|
+
# end
|
35
|
+
#
|
36
|
+
# # Configuring a Waiter
|
37
|
+
# Each waiter has a default polling interval and a maximum number of
|
38
|
+
# attempts it will make before returning control to your program.
|
39
|
+
# To set these values, use the `max_attempts` and `delay` parameters
|
40
|
+
# in your `#wait_until` call.
|
41
|
+
# The following example waits for up to 25 seconds, polling every five seconds.
|
42
|
+
#
|
43
|
+
# client.wait_until(...) do |w|
|
44
|
+
# w.max_attempts = 5
|
45
|
+
# w.delay = 5
|
46
|
+
# end
|
47
|
+
#
|
48
|
+
# To disable wait failures, set the value of either of these parameters
|
49
|
+
# to `nil`.
|
50
|
+
#
|
51
|
+
# # Extending a Waiter
|
52
|
+
# To modify the behavior of waiters, you can register callbacks that are
|
53
|
+
# triggered before each polling attempt and before waiting.
|
54
|
+
#
|
55
|
+
# The following example implements an exponential backoff in a waiter
|
56
|
+
# by doubling the amount of time to wait on every attempt.
|
57
|
+
#
|
58
|
+
# client.wait_until(...) do |w|
|
59
|
+
# w.interval = 0 # disable normal sleep
|
60
|
+
# w.before_wait do |n, resp|
|
61
|
+
# sleep(n ** 2)
|
62
|
+
# end
|
63
|
+
# end
|
64
|
+
#
|
65
|
+
# # Available Waiters
|
66
|
+
#
|
67
|
+
# The following table lists the valid waiter names, the operations they call,
|
68
|
+
# and the default `:delay` and `:max_attempts` values.
|
69
|
+
#
|
70
|
+
# | waiter_name | params | :delay | :max_attempts |
|
71
|
+
# | -------------- | ------------------------ | -------- | ------------- |
|
72
|
+
# | server_offline | {Client#describe_server} | 30 | 120 |
|
73
|
+
# | server_online | {Client#describe_server} | 30 | 120 |
|
74
|
+
#
|
75
|
+
module Waiters
|
76
|
+
|
77
|
+
class ServerOffline
|
78
|
+
|
79
|
+
# @param [Hash] options
|
80
|
+
# @option options [required, Client] :client
|
81
|
+
# @option options [Integer] :max_attempts (120)
|
82
|
+
# @option options [Integer] :delay (30)
|
83
|
+
# @option options [Proc] :before_attempt
|
84
|
+
# @option options [Proc] :before_wait
|
85
|
+
def initialize(options)
|
86
|
+
@client = options.fetch(:client)
|
87
|
+
@waiter = Aws::Waiters::Waiter.new({
|
88
|
+
max_attempts: 120,
|
89
|
+
delay: 30,
|
90
|
+
poller: Aws::Waiters::Poller.new(
|
91
|
+
operation_name: :describe_server,
|
92
|
+
acceptors: [
|
93
|
+
{
|
94
|
+
"argument" => "server.state",
|
95
|
+
"expected" => "OFFLINE",
|
96
|
+
"matcher" => "path",
|
97
|
+
"state" => "success"
|
98
|
+
},
|
99
|
+
{
|
100
|
+
"argument" => "server.state",
|
101
|
+
"expected" => "STOP_FAILED",
|
102
|
+
"matcher" => "path",
|
103
|
+
"state" => "failure"
|
104
|
+
}
|
105
|
+
]
|
106
|
+
)
|
107
|
+
}.merge(options))
|
108
|
+
end
|
109
|
+
|
110
|
+
# @option (see Client#describe_server)
|
111
|
+
# @return (see Client#describe_server)
|
112
|
+
def wait(params = {})
|
113
|
+
@waiter.wait(client: @client, params: params)
|
114
|
+
end
|
115
|
+
|
116
|
+
# @api private
|
117
|
+
attr_reader :waiter
|
118
|
+
|
119
|
+
end
|
120
|
+
|
121
|
+
class ServerOnline
|
122
|
+
|
123
|
+
# @param [Hash] options
|
124
|
+
# @option options [required, Client] :client
|
125
|
+
# @option options [Integer] :max_attempts (120)
|
126
|
+
# @option options [Integer] :delay (30)
|
127
|
+
# @option options [Proc] :before_attempt
|
128
|
+
# @option options [Proc] :before_wait
|
129
|
+
def initialize(options)
|
130
|
+
@client = options.fetch(:client)
|
131
|
+
@waiter = Aws::Waiters::Waiter.new({
|
132
|
+
max_attempts: 120,
|
133
|
+
delay: 30,
|
134
|
+
poller: Aws::Waiters::Poller.new(
|
135
|
+
operation_name: :describe_server,
|
136
|
+
acceptors: [
|
137
|
+
{
|
138
|
+
"argument" => "server.state",
|
139
|
+
"expected" => "ONLINE",
|
140
|
+
"matcher" => "path",
|
141
|
+
"state" => "success"
|
142
|
+
},
|
143
|
+
{
|
144
|
+
"argument" => "server.state",
|
145
|
+
"expected" => "START_FAILED",
|
146
|
+
"matcher" => "path",
|
147
|
+
"state" => "failure"
|
148
|
+
}
|
149
|
+
]
|
150
|
+
)
|
151
|
+
}.merge(options))
|
152
|
+
end
|
153
|
+
|
154
|
+
# @option (see Client#describe_server)
|
155
|
+
# @return (see Client#describe_server)
|
156
|
+
def wait(params = {})
|
157
|
+
@waiter.wait(client: @client, params: params)
|
158
|
+
end
|
159
|
+
|
160
|
+
# @api private
|
161
|
+
attr_reader :waiter
|
162
|
+
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
data/lib/aws-sdk-transfer.rb
CHANGED
@@ -15,6 +15,7 @@ require_relative 'aws-sdk-transfer/types'
|
|
15
15
|
require_relative 'aws-sdk-transfer/client_api'
|
16
16
|
require_relative 'aws-sdk-transfer/client'
|
17
17
|
require_relative 'aws-sdk-transfer/errors'
|
18
|
+
require_relative 'aws-sdk-transfer/waiters'
|
18
19
|
require_relative 'aws-sdk-transfer/resource'
|
19
20
|
require_relative 'aws-sdk-transfer/customizations'
|
20
21
|
|
@@ -48,6 +49,6 @@ require_relative 'aws-sdk-transfer/customizations'
|
|
48
49
|
# @!group service
|
49
50
|
module Aws::Transfer
|
50
51
|
|
51
|
-
GEM_VERSION = '1.
|
52
|
+
GEM_VERSION = '1.51.0'
|
52
53
|
|
53
54
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-transfer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.51.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '3'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 3.
|
22
|
+
version: 3.127.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '3'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 3.
|
32
|
+
version: 3.127.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: aws-sigv4
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -62,6 +62,7 @@ files:
|
|
62
62
|
- lib/aws-sdk-transfer/errors.rb
|
63
63
|
- lib/aws-sdk-transfer/resource.rb
|
64
64
|
- lib/aws-sdk-transfer/types.rb
|
65
|
+
- lib/aws-sdk-transfer/waiters.rb
|
65
66
|
homepage: https://github.com/aws/aws-sdk-ruby
|
66
67
|
licenses:
|
67
68
|
- Apache-2.0
|