oci 2.2.1 → 2.3.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/README.md +2 -1
- data/lib/oci.rb +1 -0
- data/lib/oci/audit/audit_client_composite_operations.rb +16 -6
- data/lib/oci/container_engine/container_engine.rb +47 -0
- data/lib/oci/container_engine/container_engine_client.rb +1276 -0
- data/lib/oci/container_engine/container_engine_client_composite_operations.rb +320 -0
- data/lib/oci/container_engine/models/add_on_options.rb +164 -0
- data/lib/oci/container_engine/models/cluster.rb +296 -0
- data/lib/oci/container_engine/models/cluster_create_options.rb +178 -0
- data/lib/oci/container_engine/models/cluster_endpoints.rb +146 -0
- data/lib/oci/container_engine/models/cluster_lifecycle_state.rb +14 -0
- data/lib/oci/container_engine/models/cluster_metadata.rb +262 -0
- data/lib/oci/container_engine/models/cluster_options.rb +150 -0
- data/lib/oci/container_engine/models/cluster_summary.rb +296 -0
- data/lib/oci/container_engine/models/create_cluster_details.rb +198 -0
- data/lib/oci/container_engine/models/create_cluster_kubeconfig_content_details.rb +162 -0
- data/lib/oci/container_engine/models/create_node_pool_details.rb +272 -0
- data/lib/oci/container_engine/models/key_value.rb +156 -0
- data/lib/oci/container_engine/models/kubernetes_network_config.rb +164 -0
- data/lib/oci/container_engine/models/node.rb +281 -0
- data/lib/oci/container_engine/models/node_error.rb +180 -0
- data/lib/oci/container_engine/models/node_pool.rb +306 -0
- data/lib/oci/container_engine/models/node_pool_options.rb +170 -0
- data/lib/oci/container_engine/models/node_pool_summary.rb +296 -0
- data/lib/oci/container_engine/models/sort_order.rb +10 -0
- data/lib/oci/container_engine/models/update_cluster_details.rb +160 -0
- data/lib/oci/container_engine/models/update_node_pool_details.rb +202 -0
- data/lib/oci/container_engine/models/work_request.rb +288 -0
- data/lib/oci/container_engine/models/work_request_error.rb +167 -0
- data/lib/oci/container_engine/models/work_request_log_entry.rb +156 -0
- data/lib/oci/container_engine/models/work_request_operation_type.rb +15 -0
- data/lib/oci/container_engine/models/work_request_resource.rb +214 -0
- data/lib/oci/container_engine/models/work_request_status.rb +14 -0
- data/lib/oci/container_engine/models/work_request_summary.rb +288 -0
- data/lib/oci/container_engine/util.rb +46 -0
- data/lib/oci/errors.rb +21 -2
- data/lib/oci/load_balancer/load_balancer_client_composite_operations.rb +336 -133
- data/lib/oci/load_balancer/util.rb +19 -32
- data/lib/oci/regions.rb +2 -1
- data/lib/oci/version.rb +1 -1
- data/lib/oci/waiter.rb +47 -0
- metadata +34 -2
@@ -0,0 +1,14 @@
|
|
1
|
+
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
module OCI
|
4
|
+
module ContainerEngine::Models
|
5
|
+
WORK_REQUEST_STATUS_ENUM = [
|
6
|
+
WORK_REQUEST_STATUS_ACCEPTED = 'ACCEPTED'.freeze,
|
7
|
+
WORK_REQUEST_STATUS_IN_PROGRESS = 'IN_PROGRESS'.freeze,
|
8
|
+
WORK_REQUEST_STATUS_FAILED = 'FAILED'.freeze,
|
9
|
+
WORK_REQUEST_STATUS_SUCCEEDED = 'SUCCEEDED'.freeze,
|
10
|
+
WORK_REQUEST_STATUS_CANCELING = 'CANCELING'.freeze,
|
11
|
+
WORK_REQUEST_STATUS_CANCELED = 'CANCELED'.freeze
|
12
|
+
].freeze
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,288 @@
|
|
1
|
+
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
require 'logger'
|
5
|
+
|
6
|
+
# rubocop:disable Lint/UnneededCopDisableDirective
|
7
|
+
module OCI
|
8
|
+
# The properties that define a work request summary.
|
9
|
+
class ContainerEngine::Models::WorkRequestSummary # rubocop:disable Metrics/LineLength
|
10
|
+
OPERATION_TYPE_ENUM = [
|
11
|
+
OPERATION_TYPE_CLUSTER_CREATE = 'CLUSTER_CREATE'.freeze,
|
12
|
+
OPERATION_TYPE_CLUSTER_UPDATE = 'CLUSTER_UPDATE'.freeze,
|
13
|
+
OPERATION_TYPE_CLUSTER_DELETE = 'CLUSTER_DELETE'.freeze,
|
14
|
+
OPERATION_TYPE_NODEPOOL_CREATE = 'NODEPOOL_CREATE'.freeze,
|
15
|
+
OPERATION_TYPE_NODEPOOL_UPDATE = 'NODEPOOL_UPDATE'.freeze,
|
16
|
+
OPERATION_TYPE_NODEPOOL_DELETE = 'NODEPOOL_DELETE'.freeze,
|
17
|
+
OPERATION_TYPE_WORKREQUEST_CANCEL = 'WORKREQUEST_CANCEL'.freeze,
|
18
|
+
OPERATION_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
|
19
|
+
].freeze
|
20
|
+
|
21
|
+
STATUS_ENUM = [
|
22
|
+
STATUS_ACCEPTED = 'ACCEPTED'.freeze,
|
23
|
+
STATUS_IN_PROGRESS = 'IN_PROGRESS'.freeze,
|
24
|
+
STATUS_FAILED = 'FAILED'.freeze,
|
25
|
+
STATUS_SUCCEEDED = 'SUCCEEDED'.freeze,
|
26
|
+
STATUS_CANCELING = 'CANCELING'.freeze,
|
27
|
+
STATUS_CANCELED = 'CANCELED'.freeze,
|
28
|
+
STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
|
29
|
+
].freeze
|
30
|
+
|
31
|
+
# The OCID of the work request.
|
32
|
+
# @return [String]
|
33
|
+
attr_accessor :id
|
34
|
+
|
35
|
+
# The type of work the work request is doing.
|
36
|
+
# @return [String]
|
37
|
+
attr_reader :operation_type
|
38
|
+
|
39
|
+
# The current status of the work request.
|
40
|
+
# @return [String]
|
41
|
+
attr_reader :status
|
42
|
+
|
43
|
+
# The OCID of the compartment in which the work request exists.
|
44
|
+
# @return [String]
|
45
|
+
attr_accessor :compartment_id
|
46
|
+
|
47
|
+
# The resources this work request affects.
|
48
|
+
# @return [Array<OCI::ContainerEngine::Models::WorkRequestResource>]
|
49
|
+
attr_accessor :resources
|
50
|
+
|
51
|
+
# The time the work request was accepted.
|
52
|
+
# @return [DateTime]
|
53
|
+
attr_accessor :time_accepted
|
54
|
+
|
55
|
+
# The time the work request was started.
|
56
|
+
# @return [DateTime]
|
57
|
+
attr_accessor :time_started
|
58
|
+
|
59
|
+
# The time the work request was finished.
|
60
|
+
# @return [DateTime]
|
61
|
+
attr_accessor :time_finished
|
62
|
+
|
63
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
64
|
+
def self.attribute_map
|
65
|
+
{
|
66
|
+
# rubocop:disable Style/SymbolLiteral
|
67
|
+
'id': :'id',
|
68
|
+
'operation_type': :'operationType',
|
69
|
+
'status': :'status',
|
70
|
+
'compartment_id': :'compartmentId',
|
71
|
+
'resources': :'resources',
|
72
|
+
'time_accepted': :'timeAccepted',
|
73
|
+
'time_started': :'timeStarted',
|
74
|
+
'time_finished': :'timeFinished'
|
75
|
+
# rubocop:enable Style/SymbolLiteral
|
76
|
+
}
|
77
|
+
end
|
78
|
+
|
79
|
+
# Attribute type mapping.
|
80
|
+
def self.swagger_types
|
81
|
+
{
|
82
|
+
# rubocop:disable Style/SymbolLiteral
|
83
|
+
'id': :'String',
|
84
|
+
'operation_type': :'String',
|
85
|
+
'status': :'String',
|
86
|
+
'compartment_id': :'String',
|
87
|
+
'resources': :'Array<OCI::ContainerEngine::Models::WorkRequestResource>',
|
88
|
+
'time_accepted': :'DateTime',
|
89
|
+
'time_started': :'DateTime',
|
90
|
+
'time_finished': :'DateTime'
|
91
|
+
# rubocop:enable Style/SymbolLiteral
|
92
|
+
}
|
93
|
+
end
|
94
|
+
|
95
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
96
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
97
|
+
|
98
|
+
|
99
|
+
# Initializes the object
|
100
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
101
|
+
# @option attributes [String] :id The value to assign to the {#id} property
|
102
|
+
# @option attributes [String] :operation_type The value to assign to the {#operation_type} property
|
103
|
+
# @option attributes [String] :status The value to assign to the {#status} property
|
104
|
+
# @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
|
105
|
+
# @option attributes [Array<OCI::ContainerEngine::Models::WorkRequestResource>] :resources The value to assign to the {#resources} property
|
106
|
+
# @option attributes [DateTime] :time_accepted The value to assign to the {#time_accepted} property
|
107
|
+
# @option attributes [DateTime] :time_started The value to assign to the {#time_started} property
|
108
|
+
# @option attributes [DateTime] :time_finished The value to assign to the {#time_finished} property
|
109
|
+
def initialize(attributes = {})
|
110
|
+
return unless attributes.is_a?(Hash)
|
111
|
+
|
112
|
+
# convert string to symbol for hash key
|
113
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
114
|
+
|
115
|
+
self.id = attributes[:'id'] if attributes[:'id']
|
116
|
+
|
117
|
+
self.operation_type = attributes[:'operationType'] if attributes[:'operationType']
|
118
|
+
|
119
|
+
raise 'You cannot provide both :operationType and :operation_type' if attributes.key?(:'operationType') && attributes.key?(:'operation_type')
|
120
|
+
|
121
|
+
self.operation_type = attributes[:'operation_type'] if attributes[:'operation_type']
|
122
|
+
|
123
|
+
self.status = attributes[:'status'] if attributes[:'status']
|
124
|
+
|
125
|
+
self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
|
126
|
+
|
127
|
+
raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
|
128
|
+
|
129
|
+
self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
|
130
|
+
|
131
|
+
self.resources = attributes[:'resources'] if attributes[:'resources']
|
132
|
+
|
133
|
+
self.time_accepted = attributes[:'timeAccepted'] if attributes[:'timeAccepted']
|
134
|
+
|
135
|
+
raise 'You cannot provide both :timeAccepted and :time_accepted' if attributes.key?(:'timeAccepted') && attributes.key?(:'time_accepted')
|
136
|
+
|
137
|
+
self.time_accepted = attributes[:'time_accepted'] if attributes[:'time_accepted']
|
138
|
+
|
139
|
+
self.time_started = attributes[:'timeStarted'] if attributes[:'timeStarted']
|
140
|
+
|
141
|
+
raise 'You cannot provide both :timeStarted and :time_started' if attributes.key?(:'timeStarted') && attributes.key?(:'time_started')
|
142
|
+
|
143
|
+
self.time_started = attributes[:'time_started'] if attributes[:'time_started']
|
144
|
+
|
145
|
+
self.time_finished = attributes[:'timeFinished'] if attributes[:'timeFinished']
|
146
|
+
|
147
|
+
raise 'You cannot provide both :timeFinished and :time_finished' if attributes.key?(:'timeFinished') && attributes.key?(:'time_finished')
|
148
|
+
|
149
|
+
self.time_finished = attributes[:'time_finished'] if attributes[:'time_finished']
|
150
|
+
end
|
151
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
152
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
153
|
+
|
154
|
+
# Custom attribute writer method checking allowed values (enum).
|
155
|
+
# @param [Object] operation_type Object to be assigned
|
156
|
+
def operation_type=(operation_type)
|
157
|
+
# rubocop:disable Style/ConditionalAssignment
|
158
|
+
if operation_type && !OPERATION_TYPE_ENUM.include?(operation_type)
|
159
|
+
# rubocop: disable Metrics/LineLength
|
160
|
+
OCI.logger.debug("Unknown value for 'operation_type' [" + operation_type + "]. Mapping to 'OPERATION_TYPE_UNKNOWN_ENUM_VALUE'") if OCI.logger
|
161
|
+
# rubocop: enable Metrics/LineLength
|
162
|
+
@operation_type = OPERATION_TYPE_UNKNOWN_ENUM_VALUE
|
163
|
+
else
|
164
|
+
@operation_type = operation_type
|
165
|
+
end
|
166
|
+
# rubocop:enable Style/ConditionalAssignment
|
167
|
+
end
|
168
|
+
|
169
|
+
# Custom attribute writer method checking allowed values (enum).
|
170
|
+
# @param [Object] status Object to be assigned
|
171
|
+
def status=(status)
|
172
|
+
# rubocop:disable Style/ConditionalAssignment
|
173
|
+
if status && !STATUS_ENUM.include?(status)
|
174
|
+
# rubocop: disable Metrics/LineLength
|
175
|
+
OCI.logger.debug("Unknown value for 'status' [" + status + "]. Mapping to 'STATUS_UNKNOWN_ENUM_VALUE'") if OCI.logger
|
176
|
+
# rubocop: enable Metrics/LineLength
|
177
|
+
@status = STATUS_UNKNOWN_ENUM_VALUE
|
178
|
+
else
|
179
|
+
@status = status
|
180
|
+
end
|
181
|
+
# rubocop:enable Style/ConditionalAssignment
|
182
|
+
end
|
183
|
+
|
184
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
185
|
+
|
186
|
+
|
187
|
+
# Checks equality by comparing each attribute.
|
188
|
+
# @param [Object] other the other object to be compared
|
189
|
+
def ==(other)
|
190
|
+
return true if equal?(other)
|
191
|
+
self.class == other.class &&
|
192
|
+
id == other.id &&
|
193
|
+
operation_type == other.operation_type &&
|
194
|
+
status == other.status &&
|
195
|
+
compartment_id == other.compartment_id &&
|
196
|
+
resources == other.resources &&
|
197
|
+
time_accepted == other.time_accepted &&
|
198
|
+
time_started == other.time_started &&
|
199
|
+
time_finished == other.time_finished
|
200
|
+
end
|
201
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
202
|
+
|
203
|
+
# @see the `==` method
|
204
|
+
# @param [Object] other the other object to be compared
|
205
|
+
def eql?(other)
|
206
|
+
self == other
|
207
|
+
end
|
208
|
+
|
209
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
210
|
+
|
211
|
+
|
212
|
+
# Calculates hash code according to all attributes.
|
213
|
+
# @return [Fixnum] Hash code
|
214
|
+
def hash
|
215
|
+
[id, operation_type, status, compartment_id, resources, time_accepted, time_started, time_finished].hash
|
216
|
+
end
|
217
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
218
|
+
|
219
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
220
|
+
|
221
|
+
|
222
|
+
# Builds the object from hash
|
223
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
224
|
+
# @return [Object] Returns the model itself
|
225
|
+
def build_from_hash(attributes)
|
226
|
+
return nil unless attributes.is_a?(Hash)
|
227
|
+
self.class.swagger_types.each_pair do |key, type|
|
228
|
+
if type =~ /^Array<(.*)>/i
|
229
|
+
# check to ensure the input is an array given that the the attribute
|
230
|
+
# is documented as an array but the input is not
|
231
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
232
|
+
public_method("#{key}=").call(
|
233
|
+
attributes[self.class.attribute_map[key]]
|
234
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
235
|
+
)
|
236
|
+
end
|
237
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
238
|
+
public_method("#{key}=").call(
|
239
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
240
|
+
)
|
241
|
+
end
|
242
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
243
|
+
end
|
244
|
+
|
245
|
+
self
|
246
|
+
end
|
247
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
248
|
+
|
249
|
+
# Returns the string representation of the object
|
250
|
+
# @return [String] String presentation of the object
|
251
|
+
def to_s
|
252
|
+
to_hash.to_s
|
253
|
+
end
|
254
|
+
|
255
|
+
# Returns the object in the form of hash
|
256
|
+
# @return [Hash] Returns the object in the form of hash
|
257
|
+
def to_hash
|
258
|
+
hash = {}
|
259
|
+
self.class.attribute_map.each_pair do |attr, param|
|
260
|
+
value = public_method(attr).call
|
261
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
262
|
+
hash[param] = _to_hash(value)
|
263
|
+
end
|
264
|
+
hash
|
265
|
+
end
|
266
|
+
|
267
|
+
private
|
268
|
+
|
269
|
+
# Outputs non-array value in the form of hash
|
270
|
+
# For object, use to_hash. Otherwise, just return the value
|
271
|
+
# @param [Object] value Any valid value
|
272
|
+
# @return [Hash] Returns the value in the form of hash
|
273
|
+
def _to_hash(value)
|
274
|
+
if value.is_a?(Array)
|
275
|
+
value.compact.map { |v| _to_hash(v) }
|
276
|
+
elsif value.is_a?(Hash)
|
277
|
+
{}.tap do |hash|
|
278
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
279
|
+
end
|
280
|
+
elsif value.respond_to? :to_hash
|
281
|
+
value.to_hash
|
282
|
+
else
|
283
|
+
value
|
284
|
+
end
|
285
|
+
end
|
286
|
+
end
|
287
|
+
end
|
288
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
module OCI
|
4
|
+
module ContainerEngine
|
5
|
+
# Container Engine utility methods
|
6
|
+
module Util
|
7
|
+
# Wait until the work request succeeds or fails, or max_wait_seconds is reached.
|
8
|
+
# The work request will be polled at an increasing rate, with a maximum of
|
9
|
+
# max_interval_seconds between requests.
|
10
|
+
#
|
11
|
+
# @param [ContainerEngineClient] client A container engine client
|
12
|
+
# @param [String] the work request identifier
|
13
|
+
# @param [Integer] max_interval_seconds The maximum interval between queries, in seconds.
|
14
|
+
# @param [Integer] max_wait_seconds The maximum total time to wait, in seconds.
|
15
|
+
# @param [Boolean] raise_error_on_failure If true, then a WorkRequestFailedError will be
|
16
|
+
# raised if the work request is in a failed state. Similarly, if true, a WorkRequestCanceledError
|
17
|
+
# will be raised if the work request is in a canceled state.
|
18
|
+
# @return [OCI::Response] A {OCI::Response} object containing the completed
|
19
|
+
# {OCI::ContainerEngine::Models::WorkRequest}
|
20
|
+
def self.wait_on_work_request(client,
|
21
|
+
work_request_id,
|
22
|
+
max_interval_seconds: 30,
|
23
|
+
max_wait_seconds: 1200,
|
24
|
+
raise_error_on_failure: true)
|
25
|
+
OCI::Waiter::WorkRequest.wait_for_state(
|
26
|
+
client,
|
27
|
+
work_request_id,
|
28
|
+
->(work_request) { work_request.status == OCI::ContainerEngine::Models::WorkRequest::STATUS_SUCCEEDED },
|
29
|
+
lambda do |work_request|
|
30
|
+
is_terminal_state = work_request.status == OCI::ContainerEngine::Models::WorkRequest::STATUS_FAILED
|
31
|
+
raise OCI::Errors::WorkRequestFailedError.new(work_request, work_request.status) \
|
32
|
+
if raise_error_on_failure && is_terminal_state
|
33
|
+
|
34
|
+
is_terminal_state = work_request.status == OCI::ContainerEngine::Models::WorkRequest::STATUS_CANCELED
|
35
|
+
raise OCI::Errors::WorkRequestCanceledError.new(work_request, work_request.status) \
|
36
|
+
if raise_error_on_failure && is_terminal_state
|
37
|
+
|
38
|
+
is_terminal_state
|
39
|
+
end,
|
40
|
+
max_interval_seconds: max_interval_seconds,
|
41
|
+
max_wait_seconds: max_wait_seconds
|
42
|
+
)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
data/lib/oci/errors.rb
CHANGED
@@ -163,10 +163,29 @@ module OCI
|
|
163
163
|
# The failed work request.
|
164
164
|
attr_reader :work_request
|
165
165
|
|
166
|
-
|
166
|
+
# The status associated with the failed work request.
|
167
|
+
attr_reader :status
|
168
|
+
|
169
|
+
def initialize(work_request, status)
|
167
170
|
# TODO: May also want to include error_details.
|
168
|
-
super "Work request failed. ID: #{work_request.id}"
|
171
|
+
super "Work request failed. ID: #{work_request.id}, Status: #{status}"
|
172
|
+
@work_request = work_request
|
173
|
+
@status = status
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
# Raised when a work request returns as canceled while waiting on completion.
|
178
|
+
class WorkRequestCanceledError < StandardError
|
179
|
+
# The failed work request.
|
180
|
+
attr_reader :work_request
|
181
|
+
|
182
|
+
# The status associated with the failed work request.
|
183
|
+
attr_reader :status
|
184
|
+
|
185
|
+
def initialize(work_request, status)
|
186
|
+
super "Work request canceled. ID: #{work_request.id}, Status: #{status}"
|
169
187
|
@work_request = work_request
|
188
|
+
@status = status
|
170
189
|
end
|
171
190
|
end
|
172
191
|
|
@@ -42,18 +42,28 @@ module OCI
|
|
42
42
|
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
43
43
|
def create_backend_and_wait_for_state(create_backend_details, load_balancer_id, backend_set_name, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
44
44
|
operation_result = @service_client.create_backend(create_backend_details, load_balancer_id, backend_set_name, base_operation_opts)
|
45
|
+
use_util = OCI::LoadBalancer::Util.respond_to?(:wait_on_work_request)
|
45
46
|
|
46
|
-
return operation_result if wait_for_states.empty?
|
47
|
+
return operation_result if wait_for_states.empty? && !use_util
|
47
48
|
|
48
49
|
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
49
50
|
wait_for_resource_id = operation_result.headers['opc-work-request-id']
|
50
51
|
|
51
52
|
begin
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
53
|
+
if use_util
|
54
|
+
waiter_result = OCI::LoadBalancer::Util.wait_on_work_request(
|
55
|
+
@service_client,
|
56
|
+
wait_for_resource_id,
|
57
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
58
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
59
|
+
)
|
60
|
+
else
|
61
|
+
waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
|
62
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
63
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
64
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
65
|
+
)
|
66
|
+
end
|
57
67
|
result_to_return = waiter_result
|
58
68
|
|
59
69
|
return result_to_return
|
@@ -82,18 +92,28 @@ module OCI
|
|
82
92
|
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
83
93
|
def create_backend_set_and_wait_for_state(create_backend_set_details, load_balancer_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
84
94
|
operation_result = @service_client.create_backend_set(create_backend_set_details, load_balancer_id, base_operation_opts)
|
95
|
+
use_util = OCI::LoadBalancer::Util.respond_to?(:wait_on_work_request)
|
85
96
|
|
86
|
-
return operation_result if wait_for_states.empty?
|
97
|
+
return operation_result if wait_for_states.empty? && !use_util
|
87
98
|
|
88
99
|
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
89
100
|
wait_for_resource_id = operation_result.headers['opc-work-request-id']
|
90
101
|
|
91
102
|
begin
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
103
|
+
if use_util
|
104
|
+
waiter_result = OCI::LoadBalancer::Util.wait_on_work_request(
|
105
|
+
@service_client,
|
106
|
+
wait_for_resource_id,
|
107
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
108
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
109
|
+
)
|
110
|
+
else
|
111
|
+
waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
|
112
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
113
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
114
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
115
|
+
)
|
116
|
+
end
|
97
117
|
result_to_return = waiter_result
|
98
118
|
|
99
119
|
return result_to_return
|
@@ -122,18 +142,28 @@ module OCI
|
|
122
142
|
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
123
143
|
def create_certificate_and_wait_for_state(create_certificate_details, load_balancer_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
124
144
|
operation_result = @service_client.create_certificate(create_certificate_details, load_balancer_id, base_operation_opts)
|
145
|
+
use_util = OCI::LoadBalancer::Util.respond_to?(:wait_on_work_request)
|
125
146
|
|
126
|
-
return operation_result if wait_for_states.empty?
|
147
|
+
return operation_result if wait_for_states.empty? && !use_util
|
127
148
|
|
128
149
|
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
129
150
|
wait_for_resource_id = operation_result.headers['opc-work-request-id']
|
130
151
|
|
131
152
|
begin
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
153
|
+
if use_util
|
154
|
+
waiter_result = OCI::LoadBalancer::Util.wait_on_work_request(
|
155
|
+
@service_client,
|
156
|
+
wait_for_resource_id,
|
157
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
158
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
159
|
+
)
|
160
|
+
else
|
161
|
+
waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
|
162
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
163
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
164
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
165
|
+
)
|
166
|
+
end
|
137
167
|
result_to_return = waiter_result
|
138
168
|
|
139
169
|
return result_to_return
|
@@ -162,18 +192,28 @@ module OCI
|
|
162
192
|
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
163
193
|
def create_hostname_and_wait_for_state(create_hostname_details, load_balancer_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
164
194
|
operation_result = @service_client.create_hostname(create_hostname_details, load_balancer_id, base_operation_opts)
|
195
|
+
use_util = OCI::LoadBalancer::Util.respond_to?(:wait_on_work_request)
|
165
196
|
|
166
|
-
return operation_result if wait_for_states.empty?
|
197
|
+
return operation_result if wait_for_states.empty? && !use_util
|
167
198
|
|
168
199
|
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
169
200
|
wait_for_resource_id = operation_result.headers['opc-work-request-id']
|
170
201
|
|
171
202
|
begin
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
203
|
+
if use_util
|
204
|
+
waiter_result = OCI::LoadBalancer::Util.wait_on_work_request(
|
205
|
+
@service_client,
|
206
|
+
wait_for_resource_id,
|
207
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
208
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
209
|
+
)
|
210
|
+
else
|
211
|
+
waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
|
212
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
213
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
214
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
215
|
+
)
|
216
|
+
end
|
177
217
|
result_to_return = waiter_result
|
178
218
|
|
179
219
|
return result_to_return
|
@@ -202,18 +242,28 @@ module OCI
|
|
202
242
|
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
203
243
|
def create_listener_and_wait_for_state(create_listener_details, load_balancer_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
204
244
|
operation_result = @service_client.create_listener(create_listener_details, load_balancer_id, base_operation_opts)
|
245
|
+
use_util = OCI::LoadBalancer::Util.respond_to?(:wait_on_work_request)
|
205
246
|
|
206
|
-
return operation_result if wait_for_states.empty?
|
247
|
+
return operation_result if wait_for_states.empty? && !use_util
|
207
248
|
|
208
249
|
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
209
250
|
wait_for_resource_id = operation_result.headers['opc-work-request-id']
|
210
251
|
|
211
252
|
begin
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
253
|
+
if use_util
|
254
|
+
waiter_result = OCI::LoadBalancer::Util.wait_on_work_request(
|
255
|
+
@service_client,
|
256
|
+
wait_for_resource_id,
|
257
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
258
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
259
|
+
)
|
260
|
+
else
|
261
|
+
waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
|
262
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
263
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
264
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
265
|
+
)
|
266
|
+
end
|
217
267
|
result_to_return = waiter_result
|
218
268
|
|
219
269
|
return result_to_return
|
@@ -241,18 +291,28 @@ module OCI
|
|
241
291
|
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::LoadBalancer::Models::LoadBalancer}
|
242
292
|
def create_load_balancer_and_wait_for_state(create_load_balancer_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
243
293
|
operation_result = @service_client.create_load_balancer(create_load_balancer_details, base_operation_opts)
|
294
|
+
use_util = OCI::LoadBalancer::Util.respond_to?(:wait_on_work_request)
|
244
295
|
|
245
|
-
return operation_result if wait_for_states.empty?
|
296
|
+
return operation_result if wait_for_states.empty? && !use_util
|
246
297
|
|
247
298
|
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
248
299
|
wait_for_resource_id = operation_result.headers['opc-work-request-id']
|
249
300
|
|
250
301
|
begin
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
302
|
+
if use_util
|
303
|
+
waiter_result = OCI::LoadBalancer::Util.wait_on_work_request(
|
304
|
+
@service_client,
|
305
|
+
wait_for_resource_id,
|
306
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
307
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
308
|
+
)
|
309
|
+
else
|
310
|
+
waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
|
311
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
312
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
313
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
314
|
+
)
|
315
|
+
end
|
256
316
|
result_to_return = @service_client.get_load_balancer(waiter_result.data.load_balancer_id)
|
257
317
|
|
258
318
|
return result_to_return
|
@@ -281,18 +341,28 @@ module OCI
|
|
281
341
|
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
282
342
|
def create_path_route_set_and_wait_for_state(create_path_route_set_details, load_balancer_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
283
343
|
operation_result = @service_client.create_path_route_set(create_path_route_set_details, load_balancer_id, base_operation_opts)
|
344
|
+
use_util = OCI::LoadBalancer::Util.respond_to?(:wait_on_work_request)
|
284
345
|
|
285
|
-
return operation_result if wait_for_states.empty?
|
346
|
+
return operation_result if wait_for_states.empty? && !use_util
|
286
347
|
|
287
348
|
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
288
349
|
wait_for_resource_id = operation_result.headers['opc-work-request-id']
|
289
350
|
|
290
351
|
begin
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
352
|
+
if use_util
|
353
|
+
waiter_result = OCI::LoadBalancer::Util.wait_on_work_request(
|
354
|
+
@service_client,
|
355
|
+
wait_for_resource_id,
|
356
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
357
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
358
|
+
)
|
359
|
+
else
|
360
|
+
waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
|
361
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
362
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
363
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
364
|
+
)
|
365
|
+
end
|
296
366
|
result_to_return = waiter_result
|
297
367
|
|
298
368
|
return result_to_return
|
@@ -326,21 +396,30 @@ module OCI
|
|
326
396
|
# * max_wait_seconds The maximum time to wait, in seconds
|
327
397
|
#
|
328
398
|
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
329
|
-
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
330
399
|
def delete_backend_and_wait_for_state(load_balancer_id, backend_set_name, backend_name, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
331
400
|
operation_result = @service_client.delete_backend(load_balancer_id, backend_set_name, backend_name, base_operation_opts)
|
401
|
+
use_util = OCI::LoadBalancer::Util.respond_to?(:wait_on_work_request)
|
332
402
|
|
333
|
-
return operation_result if wait_for_states.empty?
|
403
|
+
return operation_result if wait_for_states.empty? && !use_util
|
334
404
|
|
335
405
|
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
336
406
|
wait_for_resource_id = operation_result.headers['opc-work-request-id']
|
337
407
|
|
338
408
|
begin
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
409
|
+
if use_util
|
410
|
+
waiter_result = OCI::LoadBalancer::Util.wait_on_work_request(
|
411
|
+
@service_client,
|
412
|
+
wait_for_resource_id,
|
413
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
414
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
415
|
+
)
|
416
|
+
else
|
417
|
+
waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
|
418
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
419
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
420
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
421
|
+
)
|
422
|
+
end
|
344
423
|
result_to_return = waiter_result
|
345
424
|
|
346
425
|
return result_to_return
|
@@ -370,21 +449,30 @@ module OCI
|
|
370
449
|
# * max_wait_seconds The maximum time to wait, in seconds
|
371
450
|
#
|
372
451
|
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
373
|
-
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
374
452
|
def delete_backend_set_and_wait_for_state(load_balancer_id, backend_set_name, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
375
453
|
operation_result = @service_client.delete_backend_set(load_balancer_id, backend_set_name, base_operation_opts)
|
454
|
+
use_util = OCI::LoadBalancer::Util.respond_to?(:wait_on_work_request)
|
376
455
|
|
377
|
-
return operation_result if wait_for_states.empty?
|
456
|
+
return operation_result if wait_for_states.empty? && !use_util
|
378
457
|
|
379
458
|
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
380
459
|
wait_for_resource_id = operation_result.headers['opc-work-request-id']
|
381
460
|
|
382
461
|
begin
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
462
|
+
if use_util
|
463
|
+
waiter_result = OCI::LoadBalancer::Util.wait_on_work_request(
|
464
|
+
@service_client,
|
465
|
+
wait_for_resource_id,
|
466
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
467
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
468
|
+
)
|
469
|
+
else
|
470
|
+
waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
|
471
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
472
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
473
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
474
|
+
)
|
475
|
+
end
|
388
476
|
result_to_return = waiter_result
|
389
477
|
|
390
478
|
return result_to_return
|
@@ -416,21 +504,30 @@ module OCI
|
|
416
504
|
# * max_wait_seconds The maximum time to wait, in seconds
|
417
505
|
#
|
418
506
|
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
419
|
-
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
420
507
|
def delete_certificate_and_wait_for_state(load_balancer_id, certificate_name, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
421
508
|
operation_result = @service_client.delete_certificate(load_balancer_id, certificate_name, base_operation_opts)
|
509
|
+
use_util = OCI::LoadBalancer::Util.respond_to?(:wait_on_work_request)
|
422
510
|
|
423
|
-
return operation_result if wait_for_states.empty?
|
511
|
+
return operation_result if wait_for_states.empty? && !use_util
|
424
512
|
|
425
513
|
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
426
514
|
wait_for_resource_id = operation_result.headers['opc-work-request-id']
|
427
515
|
|
428
516
|
begin
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
517
|
+
if use_util
|
518
|
+
waiter_result = OCI::LoadBalancer::Util.wait_on_work_request(
|
519
|
+
@service_client,
|
520
|
+
wait_for_resource_id,
|
521
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
522
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
523
|
+
)
|
524
|
+
else
|
525
|
+
waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
|
526
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
527
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
528
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
529
|
+
)
|
530
|
+
end
|
434
531
|
result_to_return = waiter_result
|
435
532
|
|
436
533
|
return result_to_return
|
@@ -460,21 +557,30 @@ module OCI
|
|
460
557
|
# * max_wait_seconds The maximum time to wait, in seconds
|
461
558
|
#
|
462
559
|
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
463
|
-
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
464
560
|
def delete_hostname_and_wait_for_state(load_balancer_id, name, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
465
561
|
operation_result = @service_client.delete_hostname(load_balancer_id, name, base_operation_opts)
|
562
|
+
use_util = OCI::LoadBalancer::Util.respond_to?(:wait_on_work_request)
|
466
563
|
|
467
|
-
return operation_result if wait_for_states.empty?
|
564
|
+
return operation_result if wait_for_states.empty? && !use_util
|
468
565
|
|
469
566
|
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
470
567
|
wait_for_resource_id = operation_result.headers['opc-work-request-id']
|
471
568
|
|
472
569
|
begin
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
570
|
+
if use_util
|
571
|
+
waiter_result = OCI::LoadBalancer::Util.wait_on_work_request(
|
572
|
+
@service_client,
|
573
|
+
wait_for_resource_id,
|
574
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
575
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
576
|
+
)
|
577
|
+
else
|
578
|
+
waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
|
579
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
580
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
581
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
582
|
+
)
|
583
|
+
end
|
478
584
|
result_to_return = waiter_result
|
479
585
|
|
480
586
|
return result_to_return
|
@@ -504,21 +610,30 @@ module OCI
|
|
504
610
|
# * max_wait_seconds The maximum time to wait, in seconds
|
505
611
|
#
|
506
612
|
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
507
|
-
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
508
613
|
def delete_listener_and_wait_for_state(load_balancer_id, listener_name, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
509
614
|
operation_result = @service_client.delete_listener(load_balancer_id, listener_name, base_operation_opts)
|
615
|
+
use_util = OCI::LoadBalancer::Util.respond_to?(:wait_on_work_request)
|
510
616
|
|
511
|
-
return operation_result if wait_for_states.empty?
|
617
|
+
return operation_result if wait_for_states.empty? && !use_util
|
512
618
|
|
513
619
|
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
514
620
|
wait_for_resource_id = operation_result.headers['opc-work-request-id']
|
515
621
|
|
516
622
|
begin
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
623
|
+
if use_util
|
624
|
+
waiter_result = OCI::LoadBalancer::Util.wait_on_work_request(
|
625
|
+
@service_client,
|
626
|
+
wait_for_resource_id,
|
627
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
628
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
629
|
+
)
|
630
|
+
else
|
631
|
+
waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
|
632
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
633
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
634
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
635
|
+
)
|
636
|
+
end
|
522
637
|
result_to_return = waiter_result
|
523
638
|
|
524
639
|
return result_to_return
|
@@ -544,21 +659,30 @@ module OCI
|
|
544
659
|
# * max_wait_seconds The maximum time to wait, in seconds
|
545
660
|
#
|
546
661
|
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
547
|
-
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
548
662
|
def delete_load_balancer_and_wait_for_state(load_balancer_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
549
663
|
operation_result = @service_client.delete_load_balancer(load_balancer_id, base_operation_opts)
|
664
|
+
use_util = OCI::LoadBalancer::Util.respond_to?(:wait_on_work_request)
|
550
665
|
|
551
|
-
return operation_result if wait_for_states.empty?
|
666
|
+
return operation_result if wait_for_states.empty? && !use_util
|
552
667
|
|
553
668
|
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
554
669
|
wait_for_resource_id = operation_result.headers['opc-work-request-id']
|
555
670
|
|
556
671
|
begin
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
672
|
+
if use_util
|
673
|
+
waiter_result = OCI::LoadBalancer::Util.wait_on_work_request(
|
674
|
+
@service_client,
|
675
|
+
wait_for_resource_id,
|
676
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
677
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
678
|
+
)
|
679
|
+
else
|
680
|
+
waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
|
681
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
682
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
683
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
684
|
+
)
|
685
|
+
end
|
562
686
|
result_to_return = waiter_result
|
563
687
|
|
564
688
|
return result_to_return
|
@@ -588,21 +712,30 @@ module OCI
|
|
588
712
|
# * max_wait_seconds The maximum time to wait, in seconds
|
589
713
|
#
|
590
714
|
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
591
|
-
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
592
715
|
def delete_path_route_set_and_wait_for_state(load_balancer_id, path_route_set_name, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
593
716
|
operation_result = @service_client.delete_path_route_set(load_balancer_id, path_route_set_name, base_operation_opts)
|
717
|
+
use_util = OCI::LoadBalancer::Util.respond_to?(:wait_on_work_request)
|
594
718
|
|
595
|
-
return operation_result if wait_for_states.empty?
|
719
|
+
return operation_result if wait_for_states.empty? && !use_util
|
596
720
|
|
597
721
|
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
598
722
|
wait_for_resource_id = operation_result.headers['opc-work-request-id']
|
599
723
|
|
600
724
|
begin
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
725
|
+
if use_util
|
726
|
+
waiter_result = OCI::LoadBalancer::Util.wait_on_work_request(
|
727
|
+
@service_client,
|
728
|
+
wait_for_resource_id,
|
729
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
730
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
731
|
+
)
|
732
|
+
else
|
733
|
+
waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
|
734
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
735
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
736
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
737
|
+
)
|
738
|
+
end
|
606
739
|
result_to_return = waiter_result
|
607
740
|
|
608
741
|
return result_to_return
|
@@ -639,18 +772,28 @@ module OCI
|
|
639
772
|
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
640
773
|
def update_backend_and_wait_for_state(update_backend_details, load_balancer_id, backend_set_name, backend_name, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
641
774
|
operation_result = @service_client.update_backend(update_backend_details, load_balancer_id, backend_set_name, backend_name, base_operation_opts)
|
775
|
+
use_util = OCI::LoadBalancer::Util.respond_to?(:wait_on_work_request)
|
642
776
|
|
643
|
-
return operation_result if wait_for_states.empty?
|
777
|
+
return operation_result if wait_for_states.empty? && !use_util
|
644
778
|
|
645
779
|
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
646
780
|
wait_for_resource_id = operation_result.headers['opc-work-request-id']
|
647
781
|
|
648
782
|
begin
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
783
|
+
if use_util
|
784
|
+
waiter_result = OCI::LoadBalancer::Util.wait_on_work_request(
|
785
|
+
@service_client,
|
786
|
+
wait_for_resource_id,
|
787
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
788
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
789
|
+
)
|
790
|
+
else
|
791
|
+
waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
|
792
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
793
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
794
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
795
|
+
)
|
796
|
+
end
|
654
797
|
result_to_return = waiter_result
|
655
798
|
|
656
799
|
return result_to_return
|
@@ -683,18 +826,28 @@ module OCI
|
|
683
826
|
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
684
827
|
def update_backend_set_and_wait_for_state(update_backend_set_details, load_balancer_id, backend_set_name, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
685
828
|
operation_result = @service_client.update_backend_set(update_backend_set_details, load_balancer_id, backend_set_name, base_operation_opts)
|
829
|
+
use_util = OCI::LoadBalancer::Util.respond_to?(:wait_on_work_request)
|
686
830
|
|
687
|
-
return operation_result if wait_for_states.empty?
|
831
|
+
return operation_result if wait_for_states.empty? && !use_util
|
688
832
|
|
689
833
|
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
690
834
|
wait_for_resource_id = operation_result.headers['opc-work-request-id']
|
691
835
|
|
692
836
|
begin
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
837
|
+
if use_util
|
838
|
+
waiter_result = OCI::LoadBalancer::Util.wait_on_work_request(
|
839
|
+
@service_client,
|
840
|
+
wait_for_resource_id,
|
841
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
842
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
843
|
+
)
|
844
|
+
else
|
845
|
+
waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
|
846
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
847
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
848
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
849
|
+
)
|
850
|
+
end
|
698
851
|
result_to_return = waiter_result
|
699
852
|
|
700
853
|
return result_to_return
|
@@ -727,18 +880,28 @@ module OCI
|
|
727
880
|
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
728
881
|
def update_health_checker_and_wait_for_state(health_checker, load_balancer_id, backend_set_name, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
729
882
|
operation_result = @service_client.update_health_checker(health_checker, load_balancer_id, backend_set_name, base_operation_opts)
|
883
|
+
use_util = OCI::LoadBalancer::Util.respond_to?(:wait_on_work_request)
|
730
884
|
|
731
|
-
return operation_result if wait_for_states.empty?
|
885
|
+
return operation_result if wait_for_states.empty? && !use_util
|
732
886
|
|
733
887
|
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
734
888
|
wait_for_resource_id = operation_result.headers['opc-work-request-id']
|
735
889
|
|
736
890
|
begin
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
891
|
+
if use_util
|
892
|
+
waiter_result = OCI::LoadBalancer::Util.wait_on_work_request(
|
893
|
+
@service_client,
|
894
|
+
wait_for_resource_id,
|
895
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
896
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
897
|
+
)
|
898
|
+
else
|
899
|
+
waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
|
900
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
901
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
902
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
903
|
+
)
|
904
|
+
end
|
742
905
|
result_to_return = waiter_result
|
743
906
|
|
744
907
|
return result_to_return
|
@@ -773,18 +936,28 @@ module OCI
|
|
773
936
|
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
774
937
|
def update_hostname_and_wait_for_state(update_hostname_details, load_balancer_id, name, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
775
938
|
operation_result = @service_client.update_hostname(update_hostname_details, load_balancer_id, name, base_operation_opts)
|
939
|
+
use_util = OCI::LoadBalancer::Util.respond_to?(:wait_on_work_request)
|
776
940
|
|
777
|
-
return operation_result if wait_for_states.empty?
|
941
|
+
return operation_result if wait_for_states.empty? && !use_util
|
778
942
|
|
779
943
|
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
780
944
|
wait_for_resource_id = operation_result.headers['opc-work-request-id']
|
781
945
|
|
782
946
|
begin
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
947
|
+
if use_util
|
948
|
+
waiter_result = OCI::LoadBalancer::Util.wait_on_work_request(
|
949
|
+
@service_client,
|
950
|
+
wait_for_resource_id,
|
951
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
952
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
953
|
+
)
|
954
|
+
else
|
955
|
+
waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
|
956
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
957
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
958
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
959
|
+
)
|
960
|
+
end
|
788
961
|
result_to_return = waiter_result
|
789
962
|
|
790
963
|
return result_to_return
|
@@ -817,18 +990,28 @@ module OCI
|
|
817
990
|
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
818
991
|
def update_listener_and_wait_for_state(update_listener_details, load_balancer_id, listener_name, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
819
992
|
operation_result = @service_client.update_listener(update_listener_details, load_balancer_id, listener_name, base_operation_opts)
|
993
|
+
use_util = OCI::LoadBalancer::Util.respond_to?(:wait_on_work_request)
|
820
994
|
|
821
|
-
return operation_result if wait_for_states.empty?
|
995
|
+
return operation_result if wait_for_states.empty? && !use_util
|
822
996
|
|
823
997
|
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
824
998
|
wait_for_resource_id = operation_result.headers['opc-work-request-id']
|
825
999
|
|
826
1000
|
begin
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
1001
|
+
if use_util
|
1002
|
+
waiter_result = OCI::LoadBalancer::Util.wait_on_work_request(
|
1003
|
+
@service_client,
|
1004
|
+
wait_for_resource_id,
|
1005
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
1006
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
1007
|
+
)
|
1008
|
+
else
|
1009
|
+
waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
|
1010
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
1011
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
1012
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
1013
|
+
)
|
1014
|
+
end
|
832
1015
|
result_to_return = waiter_result
|
833
1016
|
|
834
1017
|
return result_to_return
|
@@ -857,18 +1040,28 @@ module OCI
|
|
857
1040
|
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::LoadBalancer::Models::LoadBalancer}
|
858
1041
|
def update_load_balancer_and_wait_for_state(update_load_balancer_details, load_balancer_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
859
1042
|
operation_result = @service_client.update_load_balancer(update_load_balancer_details, load_balancer_id, base_operation_opts)
|
1043
|
+
use_util = OCI::LoadBalancer::Util.respond_to?(:wait_on_work_request)
|
860
1044
|
|
861
|
-
return operation_result if wait_for_states.empty?
|
1045
|
+
return operation_result if wait_for_states.empty? && !use_util
|
862
1046
|
|
863
1047
|
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
864
1048
|
wait_for_resource_id = operation_result.headers['opc-work-request-id']
|
865
1049
|
|
866
1050
|
begin
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
1051
|
+
if use_util
|
1052
|
+
waiter_result = OCI::LoadBalancer::Util.wait_on_work_request(
|
1053
|
+
@service_client,
|
1054
|
+
wait_for_resource_id,
|
1055
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
1056
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
1057
|
+
)
|
1058
|
+
else
|
1059
|
+
waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
|
1060
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
1061
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
1062
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
1063
|
+
)
|
1064
|
+
end
|
872
1065
|
result_to_return = @service_client.get_load_balancer(waiter_result.data.load_balancer_id)
|
873
1066
|
|
874
1067
|
return result_to_return
|
@@ -901,18 +1094,28 @@ module OCI
|
|
901
1094
|
# @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::LoadBalancer::Models::WorkRequest}
|
902
1095
|
def update_path_route_set_and_wait_for_state(update_path_route_set_details, load_balancer_id, path_route_set_name, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
903
1096
|
operation_result = @service_client.update_path_route_set(update_path_route_set_details, load_balancer_id, path_route_set_name, base_operation_opts)
|
1097
|
+
use_util = OCI::LoadBalancer::Util.respond_to?(:wait_on_work_request)
|
904
1098
|
|
905
|
-
return operation_result if wait_for_states.empty?
|
1099
|
+
return operation_result if wait_for_states.empty? && !use_util
|
906
1100
|
|
907
1101
|
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
908
1102
|
wait_for_resource_id = operation_result.headers['opc-work-request-id']
|
909
1103
|
|
910
1104
|
begin
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
1105
|
+
if use_util
|
1106
|
+
waiter_result = OCI::LoadBalancer::Util.wait_on_work_request(
|
1107
|
+
@service_client,
|
1108
|
+
wait_for_resource_id,
|
1109
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
1110
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
1111
|
+
)
|
1112
|
+
else
|
1113
|
+
waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
|
1114
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
1115
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
1116
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
1117
|
+
)
|
1118
|
+
end
|
916
1119
|
result_to_return = waiter_result
|
917
1120
|
|
918
1121
|
return result_to_return
|