oci 2.3.4 → 2.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/oci/core/models/create_virtual_circuit_public_prefix_details.rb +1 -1
- data/lib/oci/core/models/update_boot_volume_details.rb +18 -4
- data/lib/oci/core/models/update_volume_details.rb +18 -4
- data/lib/oci/core/models/virtual_circuit.rb +1 -1
- data/lib/oci/core/models/vnic.rb +1 -1
- data/lib/oci/core/models/volume_group.rb +18 -4
- data/lib/oci/database/database.rb +18 -0
- data/lib/oci/database/database_client.rb +1779 -427
- data/lib/oci/database/database_client_composite_operations.rb +316 -0
- data/lib/oci/database/models/autonomous_data_warehouse.rb +391 -0
- data/lib/oci/database/models/autonomous_data_warehouse_backup.rb +316 -0
- data/lib/oci/database/models/autonomous_data_warehouse_backup_summary.rb +316 -0
- data/lib/oci/database/models/autonomous_data_warehouse_connection_strings.rb +167 -0
- data/lib/oci/database/models/autonomous_data_warehouse_summary.rb +391 -0
- data/lib/oci/database/models/autonomous_database.rb +391 -0
- data/lib/oci/database/models/autonomous_database_backup.rb +316 -0
- data/lib/oci/database/models/autonomous_database_backup_summary.rb +316 -0
- data/lib/oci/database/models/autonomous_database_connection_strings.rb +167 -0
- data/lib/oci/database/models/autonomous_database_summary.rb +391 -0
- data/lib/oci/database/models/create_autonomous_data_warehouse_backup_details.rb +165 -0
- data/lib/oci/database/models/create_autonomous_data_warehouse_details.rb +287 -0
- data/lib/oci/database/models/create_autonomous_database_backup_details.rb +165 -0
- data/lib/oci/database/models/create_autonomous_database_details.rb +287 -0
- data/lib/oci/database/models/db_system.rb +1 -1
- data/lib/oci/database/models/db_system_summary.rb +1 -1
- data/lib/oci/database/models/launch_db_system_details.rb +1 -1
- data/lib/oci/database/models/launch_db_system_from_backup_details.rb +1 -1
- data/lib/oci/database/models/restore_autonomous_data_warehouse_details.rb +147 -0
- data/lib/oci/database/models/restore_autonomous_database_details.rb +147 -0
- data/lib/oci/database/models/update_autonomous_data_warehouse_details.rb +230 -0
- data/lib/oci/database/models/update_autonomous_database_details.rb +230 -0
- data/lib/oci/identity/identity.rb +1 -0
- data/lib/oci/identity/identity_client.rb +64 -1
- data/lib/oci/identity/models/availability_domain.rb +11 -1
- data/lib/oci/identity/models/fault_domain.rb +187 -0
- data/lib/oci/version.rb +1 -1
- metadata +21 -2
@@ -24,6 +24,162 @@ module OCI
|
|
24
24
|
# rubocop:disable Layout/EmptyLines
|
25
25
|
|
26
26
|
|
27
|
+
# Calls {OCI::Database::DatabaseClient#create_autonomous_data_warehouse} and then waits for the {OCI::Database::Models::AutonomousDataWarehouse} acted upon
|
28
|
+
# to enter the given state(s).
|
29
|
+
#
|
30
|
+
# @param [OCI::Database::Models::CreateAutonomousDataWarehouseDetails] create_autonomous_data_warehouse_details Request to create a new Autonomous Data Warehouse.
|
31
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Database::Models::AutonomousDataWarehouse#lifecycle_state}
|
32
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Database::DatabaseClient#create_autonomous_data_warehouse}
|
33
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
34
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
35
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
36
|
+
#
|
37
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Database::Models::AutonomousDataWarehouse}
|
38
|
+
def create_autonomous_data_warehouse_and_wait_for_state(create_autonomous_data_warehouse_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
39
|
+
operation_result = @service_client.create_autonomous_data_warehouse(create_autonomous_data_warehouse_details, base_operation_opts)
|
40
|
+
|
41
|
+
return operation_result if wait_for_states.empty?
|
42
|
+
|
43
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
44
|
+
wait_for_resource_id = operation_result.data.id
|
45
|
+
|
46
|
+
begin
|
47
|
+
waiter_result = @service_client.get_autonomous_data_warehouse(wait_for_resource_id).wait_until(
|
48
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
49
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
50
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
51
|
+
)
|
52
|
+
result_to_return = waiter_result
|
53
|
+
|
54
|
+
return result_to_return
|
55
|
+
rescue StandardError
|
56
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
57
|
+
end
|
58
|
+
end
|
59
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
60
|
+
# rubocop:enable Layout/EmptyLines
|
61
|
+
|
62
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
63
|
+
# rubocop:disable Layout/EmptyLines
|
64
|
+
|
65
|
+
|
66
|
+
# Calls {OCI::Database::DatabaseClient#create_autonomous_data_warehouse_backup} and then waits for the {OCI::Database::Models::AutonomousDataWarehouseBackup} acted upon
|
67
|
+
# to enter the given state(s).
|
68
|
+
#
|
69
|
+
# @param [OCI::Database::Models::CreateAutonomousDataWarehouseBackupDetails] create_autonomous_data_warehouse_backup_details Request to create a new Autonomous Data Warehouse backup.
|
70
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Database::Models::AutonomousDataWarehouseBackup#lifecycle_state}
|
71
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Database::DatabaseClient#create_autonomous_data_warehouse_backup}
|
72
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
73
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
74
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
75
|
+
#
|
76
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Database::Models::AutonomousDataWarehouseBackup}
|
77
|
+
def create_autonomous_data_warehouse_backup_and_wait_for_state(create_autonomous_data_warehouse_backup_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
78
|
+
operation_result = @service_client.create_autonomous_data_warehouse_backup(create_autonomous_data_warehouse_backup_details, base_operation_opts)
|
79
|
+
|
80
|
+
return operation_result if wait_for_states.empty?
|
81
|
+
|
82
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
83
|
+
wait_for_resource_id = operation_result.data.id
|
84
|
+
|
85
|
+
begin
|
86
|
+
waiter_result = @service_client.get_autonomous_data_warehouse_backup(wait_for_resource_id).wait_until(
|
87
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
88
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
89
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
90
|
+
)
|
91
|
+
result_to_return = waiter_result
|
92
|
+
|
93
|
+
return result_to_return
|
94
|
+
rescue StandardError
|
95
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
96
|
+
end
|
97
|
+
end
|
98
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
99
|
+
# rubocop:enable Layout/EmptyLines
|
100
|
+
|
101
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
102
|
+
# rubocop:disable Layout/EmptyLines
|
103
|
+
|
104
|
+
|
105
|
+
# Calls {OCI::Database::DatabaseClient#create_autonomous_database} and then waits for the {OCI::Database::Models::AutonomousDatabase} acted upon
|
106
|
+
# to enter the given state(s).
|
107
|
+
#
|
108
|
+
# @param [OCI::Database::Models::CreateAutonomousDatabaseDetails] create_autonomous_database_details Request to create a new Autonomous Database.
|
109
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Database::Models::AutonomousDatabase#lifecycle_state}
|
110
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Database::DatabaseClient#create_autonomous_database}
|
111
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
112
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
113
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
114
|
+
#
|
115
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Database::Models::AutonomousDatabase}
|
116
|
+
def create_autonomous_database_and_wait_for_state(create_autonomous_database_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
117
|
+
operation_result = @service_client.create_autonomous_database(create_autonomous_database_details, base_operation_opts)
|
118
|
+
|
119
|
+
return operation_result if wait_for_states.empty?
|
120
|
+
|
121
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
122
|
+
wait_for_resource_id = operation_result.data.id
|
123
|
+
|
124
|
+
begin
|
125
|
+
waiter_result = @service_client.get_autonomous_database(wait_for_resource_id).wait_until(
|
126
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
127
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
128
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
129
|
+
)
|
130
|
+
result_to_return = waiter_result
|
131
|
+
|
132
|
+
return result_to_return
|
133
|
+
rescue StandardError
|
134
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
135
|
+
end
|
136
|
+
end
|
137
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
138
|
+
# rubocop:enable Layout/EmptyLines
|
139
|
+
|
140
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
141
|
+
# rubocop:disable Layout/EmptyLines
|
142
|
+
|
143
|
+
|
144
|
+
# Calls {OCI::Database::DatabaseClient#create_autonomous_database_backup} and then waits for the {OCI::Database::Models::AutonomousDatabaseBackup} acted upon
|
145
|
+
# to enter the given state(s).
|
146
|
+
#
|
147
|
+
# @param [OCI::Database::Models::CreateAutonomousDatabaseBackupDetails] create_autonomous_database_backup_details Request to create a new Autonomous Database backup.
|
148
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Database::Models::AutonomousDatabaseBackup#lifecycle_state}
|
149
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Database::DatabaseClient#create_autonomous_database_backup}
|
150
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
151
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
152
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
153
|
+
#
|
154
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Database::Models::AutonomousDatabaseBackup}
|
155
|
+
def create_autonomous_database_backup_and_wait_for_state(create_autonomous_database_backup_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
156
|
+
operation_result = @service_client.create_autonomous_database_backup(create_autonomous_database_backup_details, base_operation_opts)
|
157
|
+
|
158
|
+
return operation_result if wait_for_states.empty?
|
159
|
+
|
160
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
161
|
+
wait_for_resource_id = operation_result.data.id
|
162
|
+
|
163
|
+
begin
|
164
|
+
waiter_result = @service_client.get_autonomous_database_backup(wait_for_resource_id).wait_until(
|
165
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
166
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
167
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
168
|
+
)
|
169
|
+
result_to_return = waiter_result
|
170
|
+
|
171
|
+
return result_to_return
|
172
|
+
rescue StandardError
|
173
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
174
|
+
end
|
175
|
+
end
|
176
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
177
|
+
# rubocop:enable Layout/EmptyLines
|
178
|
+
|
179
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
180
|
+
# rubocop:disable Layout/EmptyLines
|
181
|
+
|
182
|
+
|
27
183
|
# Calls {OCI::Database::DatabaseClient#create_backup} and then waits for the {OCI::Database::Models::Backup} acted upon
|
28
184
|
# to enter the given state(s).
|
29
185
|
#
|
@@ -183,6 +339,86 @@ module OCI
|
|
183
339
|
# rubocop:disable Layout/EmptyLines
|
184
340
|
|
185
341
|
|
342
|
+
# Calls {OCI::Database::DatabaseClient#delete_autonomous_data_warehouse} and then waits for the {OCI::Database::Models::AutonomousDataWarehouse} acted upon
|
343
|
+
# to enter the given state(s).
|
344
|
+
#
|
345
|
+
# @param [String] autonomous_data_warehouse_id The database [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
|
346
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Database::Models::AutonomousDataWarehouse#lifecycle_state}
|
347
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Database::DatabaseClient#delete_autonomous_data_warehouse}
|
348
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
349
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
350
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
351
|
+
#
|
352
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type nil
|
353
|
+
def delete_autonomous_data_warehouse_and_wait_for_state(autonomous_data_warehouse_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
354
|
+
initial_get_result = @service_client.get_autonomous_data_warehouse(autonomous_data_warehouse_id)
|
355
|
+
operation_result = @service_client.delete_autonomous_data_warehouse(autonomous_data_warehouse_id, base_operation_opts)
|
356
|
+
|
357
|
+
return operation_result if wait_for_states.empty?
|
358
|
+
|
359
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
360
|
+
|
361
|
+
begin
|
362
|
+
waiter_result = initial_get_result.wait_until(
|
363
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
364
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
365
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200,
|
366
|
+
succeed_on_not_found: true
|
367
|
+
)
|
368
|
+
result_to_return = waiter_result
|
369
|
+
|
370
|
+
return result_to_return
|
371
|
+
rescue StandardError
|
372
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
373
|
+
end
|
374
|
+
end
|
375
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
376
|
+
# rubocop:enable Layout/EmptyLines
|
377
|
+
|
378
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
379
|
+
# rubocop:disable Layout/EmptyLines
|
380
|
+
|
381
|
+
|
382
|
+
# Calls {OCI::Database::DatabaseClient#delete_autonomous_database} and then waits for the {OCI::Database::Models::AutonomousDatabase} acted upon
|
383
|
+
# to enter the given state(s).
|
384
|
+
#
|
385
|
+
# @param [String] autonomous_database_id The database [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
|
386
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Database::Models::AutonomousDatabase#lifecycle_state}
|
387
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Database::DatabaseClient#delete_autonomous_database}
|
388
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
389
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
390
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
391
|
+
#
|
392
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type nil
|
393
|
+
def delete_autonomous_database_and_wait_for_state(autonomous_database_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
394
|
+
initial_get_result = @service_client.get_autonomous_database(autonomous_database_id)
|
395
|
+
operation_result = @service_client.delete_autonomous_database(autonomous_database_id, base_operation_opts)
|
396
|
+
|
397
|
+
return operation_result if wait_for_states.empty?
|
398
|
+
|
399
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
400
|
+
|
401
|
+
begin
|
402
|
+
waiter_result = initial_get_result.wait_until(
|
403
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
404
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
405
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200,
|
406
|
+
succeed_on_not_found: true
|
407
|
+
)
|
408
|
+
result_to_return = waiter_result
|
409
|
+
|
410
|
+
return result_to_return
|
411
|
+
rescue StandardError
|
412
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
413
|
+
end
|
414
|
+
end
|
415
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
416
|
+
# rubocop:enable Layout/EmptyLines
|
417
|
+
|
418
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
419
|
+
# rubocop:disable Layout/EmptyLines
|
420
|
+
|
421
|
+
|
186
422
|
# Calls {OCI::Database::DatabaseClient#delete_backup} and then waits for the {OCI::Database::Models::Backup} acted upon
|
187
423
|
# to enter the given state(s).
|
188
424
|
#
|
@@ -342,6 +578,86 @@ module OCI
|
|
342
578
|
# rubocop:disable Layout/EmptyLines
|
343
579
|
|
344
580
|
|
581
|
+
# Calls {OCI::Database::DatabaseClient#update_autonomous_data_warehouse} and then waits for the {OCI::Database::Models::AutonomousDataWarehouse} acted upon
|
582
|
+
# to enter the given state(s).
|
583
|
+
#
|
584
|
+
# @param [String] autonomous_data_warehouse_id The database [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
|
585
|
+
# @param [OCI::Database::Models::UpdateAutonomousDataWarehouseDetails] update_autonomous_data_warehouse_details Request to update the properties of an Autonomous Data Warehouse.
|
586
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Database::Models::AutonomousDataWarehouse#lifecycle_state}
|
587
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Database::DatabaseClient#update_autonomous_data_warehouse}
|
588
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
589
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
590
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
591
|
+
#
|
592
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Database::Models::AutonomousDataWarehouse}
|
593
|
+
def update_autonomous_data_warehouse_and_wait_for_state(autonomous_data_warehouse_id, update_autonomous_data_warehouse_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
594
|
+
operation_result = @service_client.update_autonomous_data_warehouse(autonomous_data_warehouse_id, update_autonomous_data_warehouse_details, base_operation_opts)
|
595
|
+
|
596
|
+
return operation_result if wait_for_states.empty?
|
597
|
+
|
598
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
599
|
+
wait_for_resource_id = operation_result.data.id
|
600
|
+
|
601
|
+
begin
|
602
|
+
waiter_result = @service_client.get_autonomous_data_warehouse(wait_for_resource_id).wait_until(
|
603
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
604
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
605
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
606
|
+
)
|
607
|
+
result_to_return = waiter_result
|
608
|
+
|
609
|
+
return result_to_return
|
610
|
+
rescue StandardError
|
611
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
612
|
+
end
|
613
|
+
end
|
614
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
615
|
+
# rubocop:enable Layout/EmptyLines
|
616
|
+
|
617
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
618
|
+
# rubocop:disable Layout/EmptyLines
|
619
|
+
|
620
|
+
|
621
|
+
# Calls {OCI::Database::DatabaseClient#update_autonomous_database} and then waits for the {OCI::Database::Models::AutonomousDatabase} acted upon
|
622
|
+
# to enter the given state(s).
|
623
|
+
#
|
624
|
+
# @param [String] autonomous_database_id The database [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
|
625
|
+
# @param [OCI::Database::Models::UpdateAutonomousDatabaseDetails] update_autonomous_database_details Request to update the properties of an Autonomous Database.
|
626
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Database::Models::AutonomousDatabase#lifecycle_state}
|
627
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Database::DatabaseClient#update_autonomous_database}
|
628
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
629
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
630
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
631
|
+
#
|
632
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Database::Models::AutonomousDatabase}
|
633
|
+
def update_autonomous_database_and_wait_for_state(autonomous_database_id, update_autonomous_database_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
634
|
+
operation_result = @service_client.update_autonomous_database(autonomous_database_id, update_autonomous_database_details, base_operation_opts)
|
635
|
+
|
636
|
+
return operation_result if wait_for_states.empty?
|
637
|
+
|
638
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
639
|
+
wait_for_resource_id = operation_result.data.id
|
640
|
+
|
641
|
+
begin
|
642
|
+
waiter_result = @service_client.get_autonomous_database(wait_for_resource_id).wait_until(
|
643
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
644
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
645
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
646
|
+
)
|
647
|
+
result_to_return = waiter_result
|
648
|
+
|
649
|
+
return result_to_return
|
650
|
+
rescue StandardError
|
651
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
652
|
+
end
|
653
|
+
end
|
654
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
655
|
+
# rubocop:enable Layout/EmptyLines
|
656
|
+
|
657
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
658
|
+
# rubocop:disable Layout/EmptyLines
|
659
|
+
|
660
|
+
|
345
661
|
# Calls {OCI::Database::DatabaseClient#update_database} and then waits for the {OCI::Database::Models::Database} acted upon
|
346
662
|
# to enter the given state(s).
|
347
663
|
#
|
@@ -0,0 +1,391 @@
|
|
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
|
+
# An Oracle Autonomous Data Warehouse.
|
9
|
+
#
|
10
|
+
class Database::Models::AutonomousDataWarehouse # rubocop:disable Metrics/LineLength
|
11
|
+
LICENSE_MODEL_ENUM = [
|
12
|
+
LICENSE_MODEL_LICENSE_INCLUDED = 'LICENSE_INCLUDED'.freeze,
|
13
|
+
LICENSE_MODEL_BRING_YOUR_OWN_LICENSE = 'BRING_YOUR_OWN_LICENSE'.freeze,
|
14
|
+
LICENSE_MODEL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
|
15
|
+
].freeze
|
16
|
+
|
17
|
+
LIFECYCLE_STATE_ENUM = [
|
18
|
+
LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING'.freeze,
|
19
|
+
LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE'.freeze,
|
20
|
+
LIFECYCLE_STATE_STOPPING = 'STOPPING'.freeze,
|
21
|
+
LIFECYCLE_STATE_STOPPED = 'STOPPED'.freeze,
|
22
|
+
LIFECYCLE_STATE_STARTING = 'STARTING'.freeze,
|
23
|
+
LIFECYCLE_STATE_TERMINATING = 'TERMINATING'.freeze,
|
24
|
+
LIFECYCLE_STATE_TERMINATED = 'TERMINATED'.freeze,
|
25
|
+
LIFECYCLE_STATE_UNAVAILABLE = 'UNAVAILABLE'.freeze,
|
26
|
+
LIFECYCLE_STATE_RESTORE_IN_PROGRESS = 'RESTORE_IN_PROGRESS'.freeze,
|
27
|
+
LIFECYCLE_STATE_BACKUP_IN_PROGRESS = 'BACKUP_IN_PROGRESS'.freeze,
|
28
|
+
LIFECYCLE_STATE_SCALE_IN_PROGRESS = 'SCALE_IN_PROGRESS'.freeze,
|
29
|
+
LIFECYCLE_STATE_AVAILABLE_NEEDS_ATTENTION = 'AVAILABLE_NEEDS_ATTENTION'.freeze,
|
30
|
+
LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
|
31
|
+
].freeze
|
32
|
+
|
33
|
+
# **[Required]** The OCID of the compartment.
|
34
|
+
# @return [String]
|
35
|
+
attr_accessor :compartment_id
|
36
|
+
|
37
|
+
# The connection string used to connect to the Data Warehouse. The username for the Service Console is ADMIN. Use the password you entered when creating the Autonomous Data Warehouse for the password value.
|
38
|
+
# @return [OCI::Database::Models::AutonomousDataWarehouseConnectionStrings]
|
39
|
+
attr_accessor :connection_strings
|
40
|
+
|
41
|
+
# **[Required]** The number of CPU cores to be made available to the database.
|
42
|
+
# @return [Integer]
|
43
|
+
attr_accessor :cpu_core_count
|
44
|
+
|
45
|
+
# **[Required]** The quantity of data in the database, in terabytes.
|
46
|
+
# @return [Integer]
|
47
|
+
attr_accessor :data_storage_size_in_tbs
|
48
|
+
|
49
|
+
# **[Required]** The database name.
|
50
|
+
# @return [String]
|
51
|
+
attr_accessor :db_name
|
52
|
+
|
53
|
+
# Defined tags for this resource. Each key is predefined and scoped to a namespace.
|
54
|
+
# For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
|
55
|
+
#
|
56
|
+
# Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
|
57
|
+
#
|
58
|
+
# @return [Hash<String, Hash<String, Object>>]
|
59
|
+
attr_accessor :defined_tags
|
60
|
+
|
61
|
+
# The user-friendly name for the Autonomous Data Warehouse. The name does not have to be unique.
|
62
|
+
# @return [String]
|
63
|
+
attr_accessor :display_name
|
64
|
+
|
65
|
+
# Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
|
66
|
+
# For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
|
67
|
+
#
|
68
|
+
# Example: `{\"Department\": \"Finance\"}`
|
69
|
+
#
|
70
|
+
# @return [Hash<String, String>]
|
71
|
+
attr_accessor :freeform_tags
|
72
|
+
|
73
|
+
# **[Required]** The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the Autonomous Data Warehouse.
|
74
|
+
# @return [String]
|
75
|
+
attr_accessor :id
|
76
|
+
|
77
|
+
# The Oracle license model that applies to the Oracle Autonomous Data Warehouse. The default is BRING_YOUR_OWN_LICENSE.
|
78
|
+
#
|
79
|
+
# @return [String]
|
80
|
+
attr_reader :license_model
|
81
|
+
|
82
|
+
# Additional information about the current lifecycle state.
|
83
|
+
# @return [String]
|
84
|
+
attr_accessor :lifecycle_details
|
85
|
+
|
86
|
+
# **[Required]** The current state of the database.
|
87
|
+
# @return [String]
|
88
|
+
attr_reader :lifecycle_state
|
89
|
+
|
90
|
+
# The URL of the Service Console for the Data Warehouse.
|
91
|
+
# @return [String]
|
92
|
+
attr_accessor :service_console_url
|
93
|
+
|
94
|
+
# The date and time the database was created.
|
95
|
+
# @return [DateTime]
|
96
|
+
attr_accessor :time_created
|
97
|
+
|
98
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
99
|
+
def self.attribute_map
|
100
|
+
{
|
101
|
+
# rubocop:disable Style/SymbolLiteral
|
102
|
+
'compartment_id': :'compartmentId',
|
103
|
+
'connection_strings': :'connectionStrings',
|
104
|
+
'cpu_core_count': :'cpuCoreCount',
|
105
|
+
'data_storage_size_in_tbs': :'dataStorageSizeInTBs',
|
106
|
+
'db_name': :'dbName',
|
107
|
+
'defined_tags': :'definedTags',
|
108
|
+
'display_name': :'displayName',
|
109
|
+
'freeform_tags': :'freeformTags',
|
110
|
+
'id': :'id',
|
111
|
+
'license_model': :'licenseModel',
|
112
|
+
'lifecycle_details': :'lifecycleDetails',
|
113
|
+
'lifecycle_state': :'lifecycleState',
|
114
|
+
'service_console_url': :'serviceConsoleUrl',
|
115
|
+
'time_created': :'timeCreated'
|
116
|
+
# rubocop:enable Style/SymbolLiteral
|
117
|
+
}
|
118
|
+
end
|
119
|
+
|
120
|
+
# Attribute type mapping.
|
121
|
+
def self.swagger_types
|
122
|
+
{
|
123
|
+
# rubocop:disable Style/SymbolLiteral
|
124
|
+
'compartment_id': :'String',
|
125
|
+
'connection_strings': :'OCI::Database::Models::AutonomousDataWarehouseConnectionStrings',
|
126
|
+
'cpu_core_count': :'Integer',
|
127
|
+
'data_storage_size_in_tbs': :'Integer',
|
128
|
+
'db_name': :'String',
|
129
|
+
'defined_tags': :'Hash<String, Hash<String, Object>>',
|
130
|
+
'display_name': :'String',
|
131
|
+
'freeform_tags': :'Hash<String, String>',
|
132
|
+
'id': :'String',
|
133
|
+
'license_model': :'String',
|
134
|
+
'lifecycle_details': :'String',
|
135
|
+
'lifecycle_state': :'String',
|
136
|
+
'service_console_url': :'String',
|
137
|
+
'time_created': :'DateTime'
|
138
|
+
# rubocop:enable Style/SymbolLiteral
|
139
|
+
}
|
140
|
+
end
|
141
|
+
|
142
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
143
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
144
|
+
|
145
|
+
|
146
|
+
# Initializes the object
|
147
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
148
|
+
# @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
|
149
|
+
# @option attributes [OCI::Database::Models::AutonomousDataWarehouseConnectionStrings] :connection_strings The value to assign to the {#connection_strings} property
|
150
|
+
# @option attributes [Integer] :cpu_core_count The value to assign to the {#cpu_core_count} property
|
151
|
+
# @option attributes [Integer] :data_storage_size_in_tbs The value to assign to the {#data_storage_size_in_tbs} property
|
152
|
+
# @option attributes [String] :db_name The value to assign to the {#db_name} property
|
153
|
+
# @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
|
154
|
+
# @option attributes [String] :display_name The value to assign to the {#display_name} property
|
155
|
+
# @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
|
156
|
+
# @option attributes [String] :id The value to assign to the {#id} property
|
157
|
+
# @option attributes [String] :license_model The value to assign to the {#license_model} property
|
158
|
+
# @option attributes [String] :lifecycle_details The value to assign to the {#lifecycle_details} property
|
159
|
+
# @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
|
160
|
+
# @option attributes [String] :service_console_url The value to assign to the {#service_console_url} property
|
161
|
+
# @option attributes [DateTime] :time_created The value to assign to the {#time_created} property
|
162
|
+
def initialize(attributes = {})
|
163
|
+
return unless attributes.is_a?(Hash)
|
164
|
+
|
165
|
+
# convert string to symbol for hash key
|
166
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
167
|
+
|
168
|
+
self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
|
169
|
+
|
170
|
+
raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
|
171
|
+
|
172
|
+
self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
|
173
|
+
|
174
|
+
self.connection_strings = attributes[:'connectionStrings'] if attributes[:'connectionStrings']
|
175
|
+
|
176
|
+
raise 'You cannot provide both :connectionStrings and :connection_strings' if attributes.key?(:'connectionStrings') && attributes.key?(:'connection_strings')
|
177
|
+
|
178
|
+
self.connection_strings = attributes[:'connection_strings'] if attributes[:'connection_strings']
|
179
|
+
|
180
|
+
self.cpu_core_count = attributes[:'cpuCoreCount'] if attributes[:'cpuCoreCount']
|
181
|
+
|
182
|
+
raise 'You cannot provide both :cpuCoreCount and :cpu_core_count' if attributes.key?(:'cpuCoreCount') && attributes.key?(:'cpu_core_count')
|
183
|
+
|
184
|
+
self.cpu_core_count = attributes[:'cpu_core_count'] if attributes[:'cpu_core_count']
|
185
|
+
|
186
|
+
self.data_storage_size_in_tbs = attributes[:'dataStorageSizeInTBs'] if attributes[:'dataStorageSizeInTBs']
|
187
|
+
|
188
|
+
raise 'You cannot provide both :dataStorageSizeInTBs and :data_storage_size_in_tbs' if attributes.key?(:'dataStorageSizeInTBs') && attributes.key?(:'data_storage_size_in_tbs')
|
189
|
+
|
190
|
+
self.data_storage_size_in_tbs = attributes[:'data_storage_size_in_tbs'] if attributes[:'data_storage_size_in_tbs']
|
191
|
+
|
192
|
+
self.db_name = attributes[:'dbName'] if attributes[:'dbName']
|
193
|
+
|
194
|
+
raise 'You cannot provide both :dbName and :db_name' if attributes.key?(:'dbName') && attributes.key?(:'db_name')
|
195
|
+
|
196
|
+
self.db_name = attributes[:'db_name'] if attributes[:'db_name']
|
197
|
+
|
198
|
+
self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
|
199
|
+
|
200
|
+
raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
|
201
|
+
|
202
|
+
self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
|
203
|
+
|
204
|
+
self.display_name = attributes[:'displayName'] if attributes[:'displayName']
|
205
|
+
|
206
|
+
raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
|
207
|
+
|
208
|
+
self.display_name = attributes[:'display_name'] if attributes[:'display_name']
|
209
|
+
|
210
|
+
self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
|
211
|
+
|
212
|
+
raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
|
213
|
+
|
214
|
+
self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
|
215
|
+
|
216
|
+
self.id = attributes[:'id'] if attributes[:'id']
|
217
|
+
|
218
|
+
self.license_model = attributes[:'licenseModel'] if attributes[:'licenseModel']
|
219
|
+
|
220
|
+
raise 'You cannot provide both :licenseModel and :license_model' if attributes.key?(:'licenseModel') && attributes.key?(:'license_model')
|
221
|
+
|
222
|
+
self.license_model = attributes[:'license_model'] if attributes[:'license_model']
|
223
|
+
|
224
|
+
self.lifecycle_details = attributes[:'lifecycleDetails'] if attributes[:'lifecycleDetails']
|
225
|
+
|
226
|
+
raise 'You cannot provide both :lifecycleDetails and :lifecycle_details' if attributes.key?(:'lifecycleDetails') && attributes.key?(:'lifecycle_details')
|
227
|
+
|
228
|
+
self.lifecycle_details = attributes[:'lifecycle_details'] if attributes[:'lifecycle_details']
|
229
|
+
|
230
|
+
self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']
|
231
|
+
|
232
|
+
raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')
|
233
|
+
|
234
|
+
self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']
|
235
|
+
|
236
|
+
self.service_console_url = attributes[:'serviceConsoleUrl'] if attributes[:'serviceConsoleUrl']
|
237
|
+
|
238
|
+
raise 'You cannot provide both :serviceConsoleUrl and :service_console_url' if attributes.key?(:'serviceConsoleUrl') && attributes.key?(:'service_console_url')
|
239
|
+
|
240
|
+
self.service_console_url = attributes[:'service_console_url'] if attributes[:'service_console_url']
|
241
|
+
|
242
|
+
self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']
|
243
|
+
|
244
|
+
raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')
|
245
|
+
|
246
|
+
self.time_created = attributes[:'time_created'] if attributes[:'time_created']
|
247
|
+
end
|
248
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
249
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
250
|
+
|
251
|
+
# Custom attribute writer method checking allowed values (enum).
|
252
|
+
# @param [Object] license_model Object to be assigned
|
253
|
+
def license_model=(license_model)
|
254
|
+
# rubocop:disable Style/ConditionalAssignment
|
255
|
+
if license_model && !LICENSE_MODEL_ENUM.include?(license_model)
|
256
|
+
# rubocop: disable Metrics/LineLength
|
257
|
+
OCI.logger.debug("Unknown value for 'license_model' [" + license_model + "]. Mapping to 'LICENSE_MODEL_UNKNOWN_ENUM_VALUE'") if OCI.logger
|
258
|
+
# rubocop: enable Metrics/LineLength
|
259
|
+
@license_model = LICENSE_MODEL_UNKNOWN_ENUM_VALUE
|
260
|
+
else
|
261
|
+
@license_model = license_model
|
262
|
+
end
|
263
|
+
# rubocop:enable Style/ConditionalAssignment
|
264
|
+
end
|
265
|
+
|
266
|
+
# Custom attribute writer method checking allowed values (enum).
|
267
|
+
# @param [Object] lifecycle_state Object to be assigned
|
268
|
+
def lifecycle_state=(lifecycle_state)
|
269
|
+
# rubocop:disable Style/ConditionalAssignment
|
270
|
+
if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
|
271
|
+
# rubocop: disable Metrics/LineLength
|
272
|
+
OCI.logger.debug("Unknown value for 'lifecycle_state' [" + lifecycle_state + "]. Mapping to 'LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE'") if OCI.logger
|
273
|
+
# rubocop: enable Metrics/LineLength
|
274
|
+
@lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
|
275
|
+
else
|
276
|
+
@lifecycle_state = lifecycle_state
|
277
|
+
end
|
278
|
+
# rubocop:enable Style/ConditionalAssignment
|
279
|
+
end
|
280
|
+
|
281
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
282
|
+
|
283
|
+
|
284
|
+
# Checks equality by comparing each attribute.
|
285
|
+
# @param [Object] other the other object to be compared
|
286
|
+
def ==(other)
|
287
|
+
return true if equal?(other)
|
288
|
+
self.class == other.class &&
|
289
|
+
compartment_id == other.compartment_id &&
|
290
|
+
connection_strings == other.connection_strings &&
|
291
|
+
cpu_core_count == other.cpu_core_count &&
|
292
|
+
data_storage_size_in_tbs == other.data_storage_size_in_tbs &&
|
293
|
+
db_name == other.db_name &&
|
294
|
+
defined_tags == other.defined_tags &&
|
295
|
+
display_name == other.display_name &&
|
296
|
+
freeform_tags == other.freeform_tags &&
|
297
|
+
id == other.id &&
|
298
|
+
license_model == other.license_model &&
|
299
|
+
lifecycle_details == other.lifecycle_details &&
|
300
|
+
lifecycle_state == other.lifecycle_state &&
|
301
|
+
service_console_url == other.service_console_url &&
|
302
|
+
time_created == other.time_created
|
303
|
+
end
|
304
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
305
|
+
|
306
|
+
# @see the `==` method
|
307
|
+
# @param [Object] other the other object to be compared
|
308
|
+
def eql?(other)
|
309
|
+
self == other
|
310
|
+
end
|
311
|
+
|
312
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
313
|
+
|
314
|
+
|
315
|
+
# Calculates hash code according to all attributes.
|
316
|
+
# @return [Fixnum] Hash code
|
317
|
+
def hash
|
318
|
+
[compartment_id, connection_strings, cpu_core_count, data_storage_size_in_tbs, db_name, defined_tags, display_name, freeform_tags, id, license_model, lifecycle_details, lifecycle_state, service_console_url, time_created].hash
|
319
|
+
end
|
320
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
321
|
+
|
322
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
323
|
+
|
324
|
+
|
325
|
+
# Builds the object from hash
|
326
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
327
|
+
# @return [Object] Returns the model itself
|
328
|
+
def build_from_hash(attributes)
|
329
|
+
return nil unless attributes.is_a?(Hash)
|
330
|
+
self.class.swagger_types.each_pair do |key, type|
|
331
|
+
if type =~ /^Array<(.*)>/i
|
332
|
+
# check to ensure the input is an array given that the the attribute
|
333
|
+
# is documented as an array but the input is not
|
334
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
335
|
+
public_method("#{key}=").call(
|
336
|
+
attributes[self.class.attribute_map[key]]
|
337
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
338
|
+
)
|
339
|
+
end
|
340
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
341
|
+
public_method("#{key}=").call(
|
342
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
343
|
+
)
|
344
|
+
end
|
345
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
346
|
+
end
|
347
|
+
|
348
|
+
self
|
349
|
+
end
|
350
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
351
|
+
|
352
|
+
# Returns the string representation of the object
|
353
|
+
# @return [String] String presentation of the object
|
354
|
+
def to_s
|
355
|
+
to_hash.to_s
|
356
|
+
end
|
357
|
+
|
358
|
+
# Returns the object in the form of hash
|
359
|
+
# @return [Hash] Returns the object in the form of hash
|
360
|
+
def to_hash
|
361
|
+
hash = {}
|
362
|
+
self.class.attribute_map.each_pair do |attr, param|
|
363
|
+
value = public_method(attr).call
|
364
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
365
|
+
hash[param] = _to_hash(value)
|
366
|
+
end
|
367
|
+
hash
|
368
|
+
end
|
369
|
+
|
370
|
+
private
|
371
|
+
|
372
|
+
# Outputs non-array value in the form of hash
|
373
|
+
# For object, use to_hash. Otherwise, just return the value
|
374
|
+
# @param [Object] value Any valid value
|
375
|
+
# @return [Hash] Returns the value in the form of hash
|
376
|
+
def _to_hash(value)
|
377
|
+
if value.is_a?(Array)
|
378
|
+
value.compact.map { |v| _to_hash(v) }
|
379
|
+
elsif value.is_a?(Hash)
|
380
|
+
{}.tap do |hash|
|
381
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
382
|
+
end
|
383
|
+
elsif value.respond_to? :to_hash
|
384
|
+
value.to_hash
|
385
|
+
else
|
386
|
+
value
|
387
|
+
end
|
388
|
+
end
|
389
|
+
end
|
390
|
+
end
|
391
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|