Class: OCI::Psql::PostgresqlClientCompositeOperations

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/psql/postgresql_client_composite_operations.rb

Overview

This class provides a wrapper around PostgresqlClient and offers convenience methods for operations that would otherwise need to be chained together. For example, instead of performing an action on a resource (e.g. launching an instance, creating a load balancer) and then using a waiter to wait for the resource to enter a given state, you can call a single method in this class to accomplish the same functionality

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service_client = OCI::Psql::PostgresqlClient.new) ⇒ PostgresqlClientCompositeOperations

Initializes a new PostgresqlClientCompositeOperations

Parameters:



22
23
24
# File 'lib/oci/psql/postgresql_client_composite_operations.rb', line 22

def initialize(service_client = OCI::Psql::PostgresqlClient.new)
  @service_client = service_client
end

Instance Attribute Details

#service_clientOCI::Psql::PostgresqlClient (readonly)

The OCI::Psql::PostgresqlClient used to communicate with the service_client



16
17
18
# File 'lib/oci/psql/postgresql_client_composite_operations.rb', line 16

def service_client
  @service_client
end

Instance Method Details

#change_backup_compartment_and_wait_for_state(backup_id, change_backup_compartment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) ⇒ OCI::Response

Calls OCI::Psql::PostgresqlClient#change_backup_compartment and then waits for the Models::WorkRequest to enter the given state(s).

Parameters:

  • backup_id (String)

    unique Backup identifier

  • change_backup_compartment_details (OCI::Psql::Models::ChangeBackupCompartmentDetails)

    The information to be updated.

  • wait_for_states (Array<String>) (defaults to: [])

    An array of states to wait on. These should be valid values for Models::WorkRequest#status

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

    Any optional arguments accepted by OCI::Psql::PostgresqlClient#change_backup_compartment

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

    Optional arguments for the waiter. Keys should be symbols, and the following keys are supported: * max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds

Returns:



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/oci/psql/postgresql_client_composite_operations.rb', line 42

def change_backup_compartment_and_wait_for_state(backup_id, change_backup_compartment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.change_backup_compartment(backup_id, change_backup_compartment_details, base_operation_opts)
  use_util = OCI::Psql::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Psql::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end

#change_configuration_compartment_and_wait_for_state(configuration_id, change_configuration_compartment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) ⇒ OCI::Response

Calls OCI::Psql::PostgresqlClient#change_configuration_compartment and then waits for the Models::Configuration acted upon to enter the given state(s).

Parameters:

  • configuration_id (String)

    unique Configuration identifier

  • change_configuration_compartment_details (OCI::Psql::Models::ChangeConfigurationCompartmentDetails)

    The information to be updated.

  • wait_for_states (Array<String>) (defaults to: [])

    An array of states to wait on. These should be valid values for Models::Configuration#lifecycle_state

  • base_operation_opts (Hash) (defaults to: {})
  • waiter_opts (Hash) (defaults to: {})

    Optional arguments for the waiter. Keys should be symbols, and the following keys are supported: * max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds

Returns:



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/oci/psql/postgresql_client_composite_operations.rb', line 92

def change_configuration_compartment_and_wait_for_state(configuration_id, change_configuration_compartment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.change_configuration_compartment(configuration_id, change_configuration_compartment_details, base_operation_opts)

  return operation_result if wait_for_states.empty?

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.data.id

  begin
    waiter_result = @service_client.get_configuration(wait_for_resource_id).wait_until(
      eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
      max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
      max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
    )
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end

#change_db_system_compartment_and_wait_for_state(db_system_id, change_db_system_compartment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) ⇒ OCI::Response

Calls OCI::Psql::PostgresqlClient#change_db_system_compartment and then waits for the Models::WorkRequest to enter the given state(s).

Parameters:

  • db_system_id (String)

    unique DbSystem identifier

  • change_db_system_compartment_details (OCI::Psql::Models::ChangeDbSystemCompartmentDetails)

    The information to be updated.

  • wait_for_states (Array<String>) (defaults to: [])

    An array of states to wait on. These should be valid values for Models::WorkRequest#status

  • base_operation_opts (Hash) (defaults to: {})
  • waiter_opts (Hash) (defaults to: {})

    Optional arguments for the waiter. Keys should be symbols, and the following keys are supported: * max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds

Returns:



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/oci/psql/postgresql_client_composite_operations.rb', line 132

def change_db_system_compartment_and_wait_for_state(db_system_id, change_db_system_compartment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.change_db_system_compartment(db_system_id, change_db_system_compartment_details, base_operation_opts)
  use_util = OCI::Psql::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Psql::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end

#create_backup_and_wait_for_state(create_backup_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) ⇒ OCI::Response

Calls OCI::Psql::PostgresqlClient#create_backup and then waits for the Models::WorkRequest to enter the given state(s).

Parameters:

  • create_backup_details (OCI::Psql::Models::CreateBackupDetails)

    Details for the new Backup.

  • wait_for_states (Array<String>) (defaults to: [])

    An array of states to wait on. These should be valid values for Models::WorkRequest#status

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

    Any optional arguments accepted by OCI::Psql::PostgresqlClient#create_backup

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

    Optional arguments for the waiter. Keys should be symbols, and the following keys are supported: * max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds

Returns:



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/oci/psql/postgresql_client_composite_operations.rb', line 181

def create_backup_and_wait_for_state(create_backup_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.create_backup(create_backup_details, base_operation_opts)
  use_util = OCI::Psql::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Psql::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end

#create_configuration_and_wait_for_state(create_configuration_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) ⇒ OCI::Response

Calls OCI::Psql::PostgresqlClient#create_configuration and then waits for the Models::Configuration acted upon to enter the given state(s).

Parameters:

  • create_configuration_details (OCI::Psql::Models::CreateConfigurationDetails)

    Details for the new Configuration.

  • wait_for_states (Array<String>) (defaults to: [])

    An array of states to wait on. These should be valid values for Models::Configuration#lifecycle_state

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

    Any optional arguments accepted by OCI::Psql::PostgresqlClient#create_configuration

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

    Optional arguments for the waiter. Keys should be symbols, and the following keys are supported: * max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds

Returns:



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/oci/psql/postgresql_client_composite_operations.rb', line 230

def create_configuration_and_wait_for_state(create_configuration_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.create_configuration(create_configuration_details, base_operation_opts)

  return operation_result if wait_for_states.empty?

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.data.id

  begin
    waiter_result = @service_client.get_configuration(wait_for_resource_id).wait_until(
      eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
      max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
      max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
    )
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end

#create_db_system_and_wait_for_state(create_db_system_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) ⇒ OCI::Response

Calls OCI::Psql::PostgresqlClient#create_db_system and then waits for the Models::WorkRequest to enter the given state(s).

Parameters:

  • create_db_system_details (OCI::Psql::Models::CreateDbSystemDetails)

    Details for the new DbSystem.

  • wait_for_states (Array<String>) (defaults to: [])

    An array of states to wait on. These should be valid values for Models::WorkRequest#status

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

    Any optional arguments accepted by OCI::Psql::PostgresqlClient#create_db_system

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

    Optional arguments for the waiter. Keys should be symbols, and the following keys are supported: * max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds

Returns:



269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
# File 'lib/oci/psql/postgresql_client_composite_operations.rb', line 269

def create_db_system_and_wait_for_state(create_db_system_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.create_db_system(create_db_system_details, base_operation_opts)
  use_util = OCI::Psql::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Psql::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end

#delete_backup_and_wait_for_state(backup_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) ⇒ OCI::Response

Calls OCI::Psql::PostgresqlClient#delete_backup and then waits for the Models::WorkRequest to enter the given state(s).

Parameters:

  • backup_id (String)

    unique Backup identifier

  • wait_for_states (Array<String>) (defaults to: [])

    An array of states to wait on. These should be valid values for Models::WorkRequest#status

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

    Any optional arguments accepted by OCI::Psql::PostgresqlClient#delete_backup

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

    Optional arguments for the waiter. Keys should be symbols, and the following keys are supported: * max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds

Returns:



318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
# File 'lib/oci/psql/postgresql_client_composite_operations.rb', line 318

def delete_backup_and_wait_for_state(backup_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.delete_backup(backup_id, base_operation_opts)
  use_util = OCI::Psql::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Psql::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end

#delete_configuration_and_wait_for_state(configuration_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) ⇒ OCI::Response

Calls OCI::Psql::PostgresqlClient#delete_configuration and then waits for the Models::Configuration acted upon to enter the given state(s).

Parameters:

  • configuration_id (String)

    unique Configuration identifier

  • wait_for_states (Array<String>) (defaults to: [])

    An array of states to wait on. These should be valid values for Models::Configuration#lifecycle_state

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

    Any optional arguments accepted by OCI::Psql::PostgresqlClient#delete_configuration

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

    Optional arguments for the waiter. Keys should be symbols, and the following keys are supported: * max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds

Returns:



367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
# File 'lib/oci/psql/postgresql_client_composite_operations.rb', line 367

def delete_configuration_and_wait_for_state(configuration_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  initial_get_result = @service_client.get_configuration(configuration_id)
  operation_result = @service_client.delete_configuration(configuration_id, base_operation_opts)

  return operation_result if wait_for_states.empty?

  lowered_wait_for_states = wait_for_states.map(&:downcase)

  begin
    waiter_result = initial_get_result.wait_until(
      eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
      max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
      max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200,
      succeed_on_not_found: true
    )
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end

#delete_db_system_and_wait_for_state(db_system_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) ⇒ OCI::Response

Calls OCI::Psql::PostgresqlClient#delete_db_system and then waits for the Models::WorkRequest to enter the given state(s).

Parameters:

  • db_system_id (String)

    unique DbSystem identifier

  • wait_for_states (Array<String>) (defaults to: [])

    An array of states to wait on. These should be valid values for Models::WorkRequest#status

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

    Any optional arguments accepted by OCI::Psql::PostgresqlClient#delete_db_system

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

    Optional arguments for the waiter. Keys should be symbols, and the following keys are supported: * max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds

Returns:



407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
# File 'lib/oci/psql/postgresql_client_composite_operations.rb', line 407

def delete_db_system_and_wait_for_state(db_system_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.delete_db_system(db_system_id, base_operation_opts)
  use_util = OCI::Psql::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Psql::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end

#failover_db_system_and_wait_for_state(db_system_id, failover_db_system_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) ⇒ OCI::Response

Calls OCI::Psql::PostgresqlClient#failover_db_system and then waits for the Models::WorkRequest to enter the given state(s).

Parameters:

  • db_system_id (String)

    unique DbSystem identifier

  • failover_db_system_details (OCI::Psql::Models::FailoverDbSystemDetails)

    The information to be updated.

  • wait_for_states (Array<String>) (defaults to: [])

    An array of states to wait on. These should be valid values for Models::WorkRequest#status

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

    Any optional arguments accepted by OCI::Psql::PostgresqlClient#failover_db_system

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

    Optional arguments for the waiter. Keys should be symbols, and the following keys are supported: * max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds

Returns:



457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
# File 'lib/oci/psql/postgresql_client_composite_operations.rb', line 457

def failover_db_system_and_wait_for_state(db_system_id, failover_db_system_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.failover_db_system(db_system_id, failover_db_system_details, base_operation_opts)
  use_util = OCI::Psql::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Psql::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end

#patch_db_system_and_wait_for_state(db_system_id, patch_db_system_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) ⇒ OCI::Response

Calls OCI::Psql::PostgresqlClient#patch_db_system and then waits for the Models::WorkRequest to enter the given state(s).

Parameters:

  • db_system_id (String)

    unique DbSystem identifier

  • patch_db_system_details (OCI::Psql::Models::PatchDbSystemDetails)

    The information to be patched.

  • wait_for_states (Array<String>) (defaults to: [])

    An array of states to wait on. These should be valid values for Models::WorkRequest#status

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

    Any optional arguments accepted by OCI::Psql::PostgresqlClient#patch_db_system

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

    Optional arguments for the waiter. Keys should be symbols, and the following keys are supported: * max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds

Returns:



507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
# File 'lib/oci/psql/postgresql_client_composite_operations.rb', line 507

def patch_db_system_and_wait_for_state(db_system_id, patch_db_system_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.patch_db_system(db_system_id, patch_db_system_details, base_operation_opts)
  use_util = OCI::Psql::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Psql::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end

#reset_master_user_password_and_wait_for_state(db_system_id, reset_master_user_password_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) ⇒ OCI::Response

Calls OCI::Psql::PostgresqlClient#reset_master_user_password and then waits for the Models::WorkRequest to enter the given state(s).

Parameters:

  • db_system_id (String)

    unique DbSystem identifier

  • reset_master_user_password_details (OCI::Psql::Models::ResetMasterUserPasswordDetails)

    The information to be updated.

  • wait_for_states (Array<String>) (defaults to: [])

    An array of states to wait on. These should be valid values for Models::WorkRequest#status

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

    Any optional arguments accepted by OCI::Psql::PostgresqlClient#reset_master_user_password

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

    Optional arguments for the waiter. Keys should be symbols, and the following keys are supported: * max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds

Returns:



557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
# File 'lib/oci/psql/postgresql_client_composite_operations.rb', line 557

def reset_master_user_password_and_wait_for_state(db_system_id, reset_master_user_password_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.reset_master_user_password(db_system_id, reset_master_user_password_details, base_operation_opts)
  use_util = OCI::Psql::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Psql::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end

#restart_db_instance_in_db_system_and_wait_for_state(db_system_id, restart_db_instance_in_db_system_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) ⇒ OCI::Response

Calls OCI::Psql::PostgresqlClient#restart_db_instance_in_db_system and then waits for the Models::WorkRequest to enter the given state(s).

Parameters:

  • db_system_id (String)

    unique DbSystem identifier

  • restart_db_instance_in_db_system_details (OCI::Psql::Models::RestartDbInstanceInDbSystemDetails)

    DdInstance restart parameters.

  • wait_for_states (Array<String>) (defaults to: [])

    An array of states to wait on. These should be valid values for Models::WorkRequest#status

  • base_operation_opts (Hash) (defaults to: {})
  • waiter_opts (Hash) (defaults to: {})

    Optional arguments for the waiter. Keys should be symbols, and the following keys are supported: * max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds

Returns:



607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
# File 'lib/oci/psql/postgresql_client_composite_operations.rb', line 607

def restart_db_instance_in_db_system_and_wait_for_state(db_system_id, restart_db_instance_in_db_system_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.restart_db_instance_in_db_system(db_system_id, restart_db_instance_in_db_system_details, base_operation_opts)
  use_util = OCI::Psql::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Psql::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end

#restore_db_system_and_wait_for_state(db_system_id, restore_db_system_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) ⇒ OCI::Response

Calls OCI::Psql::PostgresqlClient#restore_db_system and then waits for the Models::WorkRequest to enter the given state(s).

Parameters:

  • db_system_id (String)

    unique DbSystem identifier

  • restore_db_system_details (OCI::Psql::Models::RestoreDbSystemDetails)

    DB System restore parameters.

  • wait_for_states (Array<String>) (defaults to: [])

    An array of states to wait on. These should be valid values for Models::WorkRequest#status

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

    Any optional arguments accepted by OCI::Psql::PostgresqlClient#restore_db_system

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

    Optional arguments for the waiter. Keys should be symbols, and the following keys are supported: * max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds

Returns:



657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
# File 'lib/oci/psql/postgresql_client_composite_operations.rb', line 657

def restore_db_system_and_wait_for_state(db_system_id, restore_db_system_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.restore_db_system(db_system_id, restore_db_system_details, base_operation_opts)
  use_util = OCI::Psql::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Psql::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end

#update_backup_and_wait_for_state(backup_id, update_backup_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) ⇒ OCI::Response

Calls OCI::Psql::PostgresqlClient#update_backup and then waits for the Models::Backup acted upon to enter the given state(s).

Parameters:

  • backup_id (String)

    unique Backup identifier

  • update_backup_details (OCI::Psql::Models::UpdateBackupDetails)

    The information to be updated.

  • wait_for_states (Array<String>) (defaults to: [])

    An array of states to wait on. These should be valid values for Models::Backup#lifecycle_state

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

    Any optional arguments accepted by OCI::Psql::PostgresqlClient#update_backup

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

    Optional arguments for the waiter. Keys should be symbols, and the following keys are supported: * max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds

Returns:



707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
# File 'lib/oci/psql/postgresql_client_composite_operations.rb', line 707

def update_backup_and_wait_for_state(backup_id, update_backup_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.update_backup(backup_id, update_backup_details, base_operation_opts)

  return operation_result if wait_for_states.empty?

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.data.id

  begin
    waiter_result = @service_client.get_backup(wait_for_resource_id).wait_until(
      eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
      max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
      max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
    )
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end

#update_configuration_and_wait_for_state(configuration_id, update_configuration_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) ⇒ OCI::Response

Calls OCI::Psql::PostgresqlClient#update_configuration and then waits for the Models::Configuration acted upon to enter the given state(s).

Parameters:

  • configuration_id (String)

    unique Configuration identifier

  • update_configuration_details (OCI::Psql::Models::UpdateConfigurationDetails)

    Details for Updating display name or description for Configuration.

  • wait_for_states (Array<String>) (defaults to: [])

    An array of states to wait on. These should be valid values for Models::Configuration#lifecycle_state

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

    Any optional arguments accepted by OCI::Psql::PostgresqlClient#update_configuration

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

    Optional arguments for the waiter. Keys should be symbols, and the following keys are supported: * max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds

Returns:



747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
# File 'lib/oci/psql/postgresql_client_composite_operations.rb', line 747

def update_configuration_and_wait_for_state(configuration_id, update_configuration_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.update_configuration(configuration_id, update_configuration_details, base_operation_opts)

  return operation_result if wait_for_states.empty?

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.data.id

  begin
    waiter_result = @service_client.get_configuration(wait_for_resource_id).wait_until(
      eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
      max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
      max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
    )
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end

#update_db_system_and_wait_for_state(db_system_id, update_db_system_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) ⇒ OCI::Response

Calls OCI::Psql::PostgresqlClient#update_db_system and then waits for the Models::WorkRequest to enter the given state(s).

Parameters:

  • db_system_id (String)

    unique DbSystem identifier

  • update_db_system_details (OCI::Psql::Models::UpdateDbSystemDetails)

    The information to be updated.

  • wait_for_states (Array<String>) (defaults to: [])

    An array of states to wait on. These should be valid values for Models::WorkRequest#status

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

    Any optional arguments accepted by OCI::Psql::PostgresqlClient#update_db_system

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

    Optional arguments for the waiter. Keys should be symbols, and the following keys are supported: * max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds

Returns:



787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
# File 'lib/oci/psql/postgresql_client_composite_operations.rb', line 787

def update_db_system_and_wait_for_state(db_system_id, update_db_system_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.update_db_system(db_system_id, update_db_system_details, base_operation_opts)
  use_util = OCI::Psql::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Psql::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end

#update_db_system_db_instance_and_wait_for_state(db_system_id, db_instance_id, update_db_system_db_instance_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) ⇒ OCI::Response

Calls OCI::Psql::PostgresqlClient#update_db_system_db_instance and then waits for the Models::WorkRequest to enter the given state(s).

Parameters:

  • db_system_id (String)

    unique DbSystem identifier

  • db_instance_id (String)

    unique DbInstance identifier

  • update_db_system_db_instance_details (OCI::Psql::Models::UpdateDbSystemDbInstanceDetails)

    DdInstance update parameters.

  • wait_for_states (Array<String>) (defaults to: [])

    An array of states to wait on. These should be valid values for Models::WorkRequest#status

  • base_operation_opts (Hash) (defaults to: {})
  • waiter_opts (Hash) (defaults to: {})

    Optional arguments for the waiter. Keys should be symbols, and the following keys are supported: * max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds

Returns:



838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
# File 'lib/oci/psql/postgresql_client_composite_operations.rb', line 838

def update_db_system_db_instance_and_wait_for_state(db_system_id, db_instance_id, update_db_system_db_instance_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.update_db_system_db_instance(db_system_id, db_instance_id, update_db_system_db_instance_details, base_operation_opts)
  use_util = OCI::Psql::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::Psql::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end