oci 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -1
  3. data/lib/oci.rb +8 -0
  4. data/lib/oci/api_client.rb +11 -5
  5. data/lib/oci/config.rb +3 -2
  6. data/lib/oci/config_file_loader.rb +5 -5
  7. data/lib/oci/core/blockstorage_client.rb +1 -1
  8. data/lib/oci/core/compute_client.rb +58 -4
  9. data/lib/oci/core/core.rb +1 -0
  10. data/lib/oci/core/models/capture_console_history_details.rb +13 -1
  11. data/lib/oci/core/models/create_instance_console_connection_details.rb +2 -2
  12. data/lib/oci/core/models/create_vnic_details.rb +18 -1
  13. data/lib/oci/core/models/create_volume_details.rb +14 -1
  14. data/lib/oci/core/models/instance_console_connection.rb +6 -6
  15. data/lib/oci/core/models/route_rule.rb +4 -1
  16. data/lib/oci/core/models/update_console_history_details.rb +121 -0
  17. data/lib/oci/core/models/update_vnic_details.rb +21 -4
  18. data/lib/oci/core/models/vnic.rb +18 -1
  19. data/lib/oci/core/models/volume.rb +13 -2
  20. data/lib/oci/core/models/volume_backup.rb +29 -2
  21. data/lib/oci/core/virtual_network_client.rb +7 -1
  22. data/lib/oci/database/database.rb +43 -0
  23. data/lib/oci/database/database_client.rb +1246 -0
  24. data/lib/oci/database/models/create_data_guard_association_details.rb +225 -0
  25. data/lib/oci/database/models/create_data_guard_association_to_existing_db_system_details.rb +138 -0
  26. data/lib/oci/database/models/create_database_details.rb +194 -0
  27. data/lib/oci/database/models/create_db_home_details.rb +141 -0
  28. data/lib/oci/database/models/create_db_home_with_db_system_id_details.rb +152 -0
  29. data/lib/oci/database/models/data_guard_association.rb +374 -0
  30. data/lib/oci/database/models/database.rb +261 -0
  31. data/lib/oci/database/models/database_summary.rb +261 -0
  32. data/lib/oci/database/models/db_home.rb +216 -0
  33. data/lib/oci/database/models/db_home_summary.rb +216 -0
  34. data/lib/oci/database/models/db_node.rb +220 -0
  35. data/lib/oci/database/models/db_node_summary.rb +220 -0
  36. data/lib/oci/database/models/db_system.rb +518 -0
  37. data/lib/oci/database/models/db_system_shape_summary.rb +142 -0
  38. data/lib/oci/database/models/db_system_summary.rb +518 -0
  39. data/lib/oci/database/models/db_version_summary.rb +131 -0
  40. data/lib/oci/database/models/failover_data_guard_association_details.rb +120 -0
  41. data/lib/oci/database/models/launch_db_system_details.rb +394 -0
  42. data/lib/oci/database/models/patch.rb +247 -0
  43. data/lib/oci/database/models/patch_details.rb +144 -0
  44. data/lib/oci/database/models/patch_history_entry.rb +218 -0
  45. data/lib/oci/database/models/patch_history_entry_summary.rb +218 -0
  46. data/lib/oci/database/models/patch_summary.rb +247 -0
  47. data/lib/oci/database/models/reinstate_data_guard_association_details.rb +120 -0
  48. data/lib/oci/database/models/switchover_data_guard_association_details.rb +120 -0
  49. data/lib/oci/database/models/update_db_home_details.rb +119 -0
  50. data/lib/oci/database/models/update_db_system_details.rb +153 -0
  51. data/lib/oci/database/util.rb +1 -0
  52. data/lib/oci/errors.rb +3 -4
  53. data/lib/oci/regions.rb +4 -2
  54. data/lib/oci/response_headers.rb +0 -1
  55. data/lib/oci/signer.rb +8 -7
  56. data/lib/oci/version.rb +1 -1
  57. data/lib/oraclebmc.rb +3 -1
  58. metadata +33 -2
@@ -0,0 +1,220 @@
1
+ # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OCI
6
+ class Database::Models::DbNodeSummary
7
+
8
+ LIFECYCLE_STATE_ENUM = [LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING',
9
+ LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE',
10
+ LIFECYCLE_STATE_UPDATING = 'UPDATING',
11
+ LIFECYCLE_STATE_STOPPING = 'STOPPING',
12
+ LIFECYCLE_STATE_STOPPED = 'STOPPED',
13
+ LIFECYCLE_STATE_STARTING = 'STARTING',
14
+ LIFECYCLE_STATE_TERMINATING = 'TERMINATING',
15
+ LIFECYCLE_STATE_TERMINATED = 'TERMINATED',
16
+ LIFECYCLE_STATE_FAILED = 'FAILED',
17
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
18
+
19
+ # The OCID of the backup VNIC.
20
+ # @return [String]
21
+ attr_accessor :backup_vnic_id
22
+
23
+ # The OCID of the DB System.
24
+ # @return [String]
25
+ attr_accessor :db_system_id
26
+
27
+ # The host name for the DB Node.
28
+ # @return [String]
29
+ attr_accessor :hostname
30
+
31
+ # The OCID of the DB Node.
32
+ # @return [String]
33
+ attr_accessor :id
34
+
35
+ # The current state of the database node.
36
+ # @return [String]
37
+ attr_accessor :lifecycle_state
38
+
39
+ # Storage size, in GBs, of the software volume that is allocated to the DB system. This is applicable only for VM-based DBs.
40
+ #
41
+ # @return [Integer]
42
+ attr_accessor :software_storage_size_in_gb
43
+
44
+ # The date and time that the DB Node was created.
45
+ # @return [DateTime]
46
+ attr_accessor :time_created
47
+
48
+ # The OCID of the VNIC.
49
+ # @return [String]
50
+ attr_accessor :vnic_id
51
+
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ return unless attributes.is_a?(Hash)
57
+
58
+ # convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
60
+
61
+ if attributes[:'backupVnicId']
62
+ self.backup_vnic_id = attributes[:'backupVnicId']
63
+ end
64
+
65
+ if attributes[:'dbSystemId']
66
+ self.db_system_id = attributes[:'dbSystemId']
67
+ end
68
+
69
+ if attributes[:'hostname']
70
+ self.hostname = attributes[:'hostname']
71
+ end
72
+
73
+ if attributes[:'id']
74
+ self.id = attributes[:'id']
75
+ end
76
+
77
+ if attributes[:'lifecycleState']
78
+ self.lifecycle_state = attributes[:'lifecycleState']
79
+ end
80
+
81
+ if attributes[:'softwareStorageSizeInGB']
82
+ self.software_storage_size_in_gb = attributes[:'softwareStorageSizeInGB']
83
+ end
84
+
85
+ if attributes[:'timeCreated']
86
+ self.time_created = attributes[:'timeCreated']
87
+ end
88
+
89
+ if attributes[:'vnicId']
90
+ self.vnic_id = attributes[:'vnicId']
91
+ end
92
+
93
+ end
94
+
95
+ # Custom attribute writer method checking allowed values (enum).
96
+ # @param [Object] lifecycle_state Object to be assigned
97
+ def lifecycle_state=(lifecycle_state)
98
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
99
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
100
+ else
101
+ @lifecycle_state = lifecycle_state
102
+ end
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] other_object to be compared
107
+ def ==(other_object)
108
+ return true if self.equal?(other_object)
109
+ self.class == other_object.class &&
110
+ backup_vnic_id == other_object.backup_vnic_id &&
111
+ db_system_id == other_object.db_system_id &&
112
+ hostname == other_object.hostname &&
113
+ id == other_object.id &&
114
+ lifecycle_state == other_object.lifecycle_state &&
115
+ software_storage_size_in_gb == other_object.software_storage_size_in_gb &&
116
+ time_created == other_object.time_created &&
117
+ vnic_id == other_object.vnic_id
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] other_object to be compared
122
+ def eql?(other_object)
123
+ self == other_object
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Fixnum] Hash code
128
+ def hash
129
+ [backup_vnic_id, db_system_id, hostname, id, lifecycle_state, software_storage_size_in_gb, time_created, vnic_id].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ self.class.swagger_types.each_pair do |key, type|
138
+ if type =~ /^Array<(.*)>/i
139
+ # check to ensure the input is an array given that the the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
142
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
143
+ end
144
+ elsif !attributes[self.class.attribute_map[key]].nil?
145
+ self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
146
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
147
+ end
148
+
149
+ self
150
+ end
151
+
152
+ # Returns the string representation of the object
153
+ # @return [String] String presentation of the object
154
+ def to_s
155
+ to_hash.to_s
156
+ end
157
+
158
+ # Returns the object in the form of hash
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_hash
161
+ hash = {}
162
+ self.class.attribute_map.each_pair do |attr, param|
163
+ value = self.send(attr)
164
+ next if value.nil?
165
+ hash[param] = _to_hash(value)
166
+ end
167
+ hash
168
+ end
169
+
170
+ private
171
+
172
+ # Outputs non-array value in the form of hash
173
+ # For object, use to_hash. Otherwise, just return the value
174
+ # @param [Object] value Any valid value
175
+ # @return [Hash] Returns the value in the form of hash
176
+ def _to_hash(value)
177
+ if value.is_a?(Array)
178
+ value.compact.map{ |v| _to_hash(v) }
179
+ elsif value.is_a?(Hash)
180
+ {}.tap do |hash|
181
+ value.each { |k, v| hash[k] = _to_hash(v) }
182
+ end
183
+ elsif value.respond_to? :to_hash
184
+ value.to_hash
185
+ else
186
+ value
187
+ end
188
+ end
189
+
190
+
191
+
192
+ # Attribute mapping from ruby-style variable name to JSON key.
193
+ def self.attribute_map
194
+ {
195
+ :'backup_vnic_id' => :'backupVnicId',
196
+ :'db_system_id' => :'dbSystemId',
197
+ :'hostname' => :'hostname',
198
+ :'id' => :'id',
199
+ :'lifecycle_state' => :'lifecycleState',
200
+ :'software_storage_size_in_gb' => :'softwareStorageSizeInGB',
201
+ :'time_created' => :'timeCreated',
202
+ :'vnic_id' => :'vnicId'
203
+ }
204
+ end
205
+
206
+ # Attribute type mapping.
207
+ def self.swagger_types
208
+ {
209
+ :'backup_vnic_id' => :'String',
210
+ :'db_system_id' => :'String',
211
+ :'hostname' => :'String',
212
+ :'id' => :'String',
213
+ :'lifecycle_state' => :'String',
214
+ :'software_storage_size_in_gb' => :'Integer',
215
+ :'time_created' => :'DateTime',
216
+ :'vnic_id' => :'String'
217
+ }
218
+ end
219
+ end
220
+ end
@@ -0,0 +1,518 @@
1
+ # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OCI
6
+ class Database::Models::DbSystem
7
+
8
+ DATABASE_EDITION_ENUM = [DATABASE_EDITION_STANDARD_EDITION = 'STANDARD_EDITION',
9
+ DATABASE_EDITION_ENTERPRISE_EDITION = 'ENTERPRISE_EDITION',
10
+ DATABASE_EDITION_ENTERPRISE_EDITION_EXTREME_PERFORMANCE = 'ENTERPRISE_EDITION_EXTREME_PERFORMANCE',
11
+ DATABASE_EDITION_ENTERPRISE_EDITION_HIGH_PERFORMANCE = 'ENTERPRISE_EDITION_HIGH_PERFORMANCE',
12
+ DATABASE_EDITION_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
13
+
14
+
15
+ DISK_REDUNDANCY_ENUM = [DISK_REDUNDANCY_HIGH = 'HIGH',
16
+ DISK_REDUNDANCY_NORMAL = 'NORMAL',
17
+ DISK_REDUNDANCY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
18
+
19
+
20
+ LICENSE_MODEL_ENUM = [LICENSE_MODEL_LICENSE_INCLUDED = 'LICENSE_INCLUDED',
21
+ LICENSE_MODEL_BRING_YOUR_OWN_LICENSE = 'BRING_YOUR_OWN_LICENSE',
22
+ LICENSE_MODEL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
23
+
24
+
25
+ LIFECYCLE_STATE_ENUM = [LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING',
26
+ LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE',
27
+ LIFECYCLE_STATE_UPDATING = 'UPDATING',
28
+ LIFECYCLE_STATE_TERMINATING = 'TERMINATING',
29
+ LIFECYCLE_STATE_TERMINATED = 'TERMINATED',
30
+ LIFECYCLE_STATE_FAILED = 'FAILED',
31
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
32
+
33
+ # The name of the Availability Domain that the DB System is located in.
34
+ # @return [String]
35
+ attr_accessor :availability_domain
36
+
37
+ # The OCID of the backup network subnet the DB System is associated with. Applicable only to Exadata.
38
+ #
39
+ # **Subnet Restriction:** See above subnetId's 'Subnet Restriction'.
40
+ # to malfunction.
41
+ #
42
+ # @return [String]
43
+ attr_accessor :backup_subnet_id
44
+
45
+ # Cluster name for Exadata and 2-node RAC DB Systems. The cluster name must begin with an an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The cluster name can be no longer than 11 characters and is not case sensitive.
46
+ #
47
+ # @return [String]
48
+ attr_accessor :cluster_name
49
+
50
+ # The OCID of the compartment.
51
+ # @return [String]
52
+ attr_accessor :compartment_id
53
+
54
+ # The number of CPU cores enabled on the DB System.
55
+ # @return [Integer]
56
+ attr_accessor :cpu_core_count
57
+
58
+ # The percentage assigned to DATA storage (user data and database files).
59
+ # The remaining percentage is assigned to RECO storage (database redo logs, archive logs, and recovery manager backups). Accepted values are 40 and 80.
60
+ #
61
+ # @return [Integer]
62
+ attr_accessor :data_storage_percentage
63
+
64
+ # Data storage size, in GBs, that is currently available to the DB system. This is applicable only for VM-based DBs.
65
+ #
66
+ # @return [Integer]
67
+ attr_accessor :data_storage_size_in_gb
68
+
69
+ # The Oracle Database Edition that applies to all the databases on the DB System.
70
+ #
71
+ # @return [String]
72
+ attr_accessor :database_edition
73
+
74
+ # The type of redundancy configured for the DB System.
75
+ # Normal is 2-way redundancy.
76
+ # High is 3-way redundancy.
77
+ #
78
+ # @return [String]
79
+ attr_accessor :disk_redundancy
80
+
81
+ # The user-friendly name for the DB System. It does not have to be unique.
82
+ # @return [String]
83
+ attr_accessor :display_name
84
+
85
+ # The domain name for the DB System.
86
+ # @return [String]
87
+ attr_accessor :domain
88
+
89
+ # The host name for the DB Node.
90
+ # @return [String]
91
+ attr_accessor :hostname
92
+
93
+ # The OCID of the DB System.
94
+ # @return [String]
95
+ attr_accessor :id
96
+
97
+ # The OCID of the last patch history. This is updated as soon as a patch operation is started.
98
+ # @return [String]
99
+ attr_accessor :last_patch_history_entry_id
100
+
101
+ # The Oracle license model that applies to all the databases on the DB System. The default is LICENSE_INCLUDED.
102
+ #
103
+ # @return [String]
104
+ attr_accessor :license_model
105
+
106
+ # Additional information about the current lifecycleState.
107
+ # @return [String]
108
+ attr_accessor :lifecycle_details
109
+
110
+ # The current state of the DB System.
111
+ # @return [String]
112
+ attr_accessor :lifecycle_state
113
+
114
+ # The port number configured for the listener on the DB System.
115
+ # @return [Integer]
116
+ attr_accessor :listener_port
117
+
118
+ # Number of nodes in this DB system. For RAC DBs, this will be greater than 1.
119
+ #
120
+ # @return [Integer]
121
+ attr_accessor :node_count
122
+
123
+ # RECO/REDO storage size, in GBs, that is currently allocated to the DB system. This is applicable only for VM-based DBs.
124
+ #
125
+ # @return [Integer]
126
+ attr_accessor :reco_storage_size_in_gb
127
+
128
+ # The OCID of the DNS record for the SCAN IP addresses that are associated with the DB System.
129
+ #
130
+ # @return [String]
131
+ attr_accessor :scan_dns_record_id
132
+
133
+ # The OCID of the Single Client Access Name (SCAN) IP addresses associated with the DB System.
134
+ # SCAN IP addresses are typically used for load balancing and are not assigned to any interface.
135
+ # Clusterware directs the requests to the appropriate nodes in the cluster.
136
+ #
137
+ # - For a single-node DB System, this list is empty.
138
+ #
139
+ # @return [Array<String>]
140
+ attr_accessor :scan_ip_ids
141
+
142
+ # The shape of the DB System. The shape determines resources to allocate to the DB system - CPU cores and memory for VM shapes; CPU cores, memory and storage for non-VM (or bare metal) shapes.
143
+ # @return [String]
144
+ attr_accessor :shape
145
+
146
+ # The public key portion of one or more key pairs used for SSH access to the DB System.
147
+ # @return [Array<String>]
148
+ attr_accessor :ssh_public_keys
149
+
150
+ # The OCID of the subnet the DB System is associated with.
151
+ #
152
+ # **Subnet Restrictions:**
153
+ # - For single node and 2-node (RAC) DB Systems, do not use a subnet that overlaps with 192.168.16.16/28
154
+ # - For Exadata and VM-based RAC DB Systems, do not use a subnet that overlaps with 192.168.128.0/20
155
+ #
156
+ # These subnets are used by the Oracle Clusterware private interconnect on the database instance.
157
+ # Specifying an overlapping subnet will cause the private interconnect to malfunction.
158
+ # This restriction applies to both the client subnet and backup subnet.
159
+ #
160
+ # @return [String]
161
+ attr_accessor :subnet_id
162
+
163
+ # The date and time the DB System was created.
164
+ # @return [DateTime]
165
+ attr_accessor :time_created
166
+
167
+ # The version of the DB System.
168
+ # @return [String]
169
+ attr_accessor :version
170
+
171
+ # The OCID of the virtual IP (VIP) addresses associated with the DB System.
172
+ # The Cluster Ready Services (CRS) creates and maintains one VIP address for each node in the DB System to
173
+ # enable failover. If one node fails, the VIP is reassigned to another active node in the cluster.
174
+ #
175
+ # - For a single-node DB System, this list is empty.
176
+ #
177
+ # @return [Array<String>]
178
+ attr_accessor :vip_ids
179
+
180
+
181
+ # Initializes the object
182
+ # @param [Hash] attributes Model attributes in the form of hash
183
+ def initialize(attributes = {})
184
+ return unless attributes.is_a?(Hash)
185
+
186
+ # convert string to symbol for hash key
187
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
188
+
189
+ if attributes[:'availabilityDomain']
190
+ self.availability_domain = attributes[:'availabilityDomain']
191
+ end
192
+
193
+ if attributes[:'backupSubnetId']
194
+ self.backup_subnet_id = attributes[:'backupSubnetId']
195
+ end
196
+
197
+ if attributes[:'clusterName']
198
+ self.cluster_name = attributes[:'clusterName']
199
+ end
200
+
201
+ if attributes[:'compartmentId']
202
+ self.compartment_id = attributes[:'compartmentId']
203
+ end
204
+
205
+ if attributes[:'cpuCoreCount']
206
+ self.cpu_core_count = attributes[:'cpuCoreCount']
207
+ end
208
+
209
+ if attributes[:'dataStoragePercentage']
210
+ self.data_storage_percentage = attributes[:'dataStoragePercentage']
211
+ end
212
+
213
+ if attributes[:'dataStorageSizeInGB']
214
+ self.data_storage_size_in_gb = attributes[:'dataStorageSizeInGB']
215
+ end
216
+
217
+ if attributes[:'databaseEdition']
218
+ self.database_edition = attributes[:'databaseEdition']
219
+ end
220
+
221
+ if attributes[:'diskRedundancy']
222
+ self.disk_redundancy = attributes[:'diskRedundancy']
223
+ end
224
+
225
+ if attributes[:'displayName']
226
+ self.display_name = attributes[:'displayName']
227
+ end
228
+
229
+ if attributes[:'domain']
230
+ self.domain = attributes[:'domain']
231
+ end
232
+
233
+ if attributes[:'hostname']
234
+ self.hostname = attributes[:'hostname']
235
+ end
236
+
237
+ if attributes[:'id']
238
+ self.id = attributes[:'id']
239
+ end
240
+
241
+ if attributes[:'lastPatchHistoryEntryId']
242
+ self.last_patch_history_entry_id = attributes[:'lastPatchHistoryEntryId']
243
+ end
244
+
245
+ if attributes[:'licenseModel']
246
+ self.license_model = attributes[:'licenseModel']
247
+ end
248
+
249
+ if attributes[:'lifecycleDetails']
250
+ self.lifecycle_details = attributes[:'lifecycleDetails']
251
+ end
252
+
253
+ if attributes[:'lifecycleState']
254
+ self.lifecycle_state = attributes[:'lifecycleState']
255
+ end
256
+
257
+ if attributes[:'listenerPort']
258
+ self.listener_port = attributes[:'listenerPort']
259
+ end
260
+
261
+ if attributes[:'nodeCount']
262
+ self.node_count = attributes[:'nodeCount']
263
+ end
264
+
265
+ if attributes[:'recoStorageSizeInGB']
266
+ self.reco_storage_size_in_gb = attributes[:'recoStorageSizeInGB']
267
+ end
268
+
269
+ if attributes[:'scanDnsRecordId']
270
+ self.scan_dns_record_id = attributes[:'scanDnsRecordId']
271
+ end
272
+
273
+ if attributes[:'scanIpIds']
274
+ self.scan_ip_ids = attributes[:'scanIpIds']
275
+ end
276
+
277
+ if attributes[:'shape']
278
+ self.shape = attributes[:'shape']
279
+ end
280
+
281
+ if attributes[:'sshPublicKeys']
282
+ self.ssh_public_keys = attributes[:'sshPublicKeys']
283
+ end
284
+
285
+ if attributes[:'subnetId']
286
+ self.subnet_id = attributes[:'subnetId']
287
+ end
288
+
289
+ if attributes[:'timeCreated']
290
+ self.time_created = attributes[:'timeCreated']
291
+ end
292
+
293
+ if attributes[:'version']
294
+ self.version = attributes[:'version']
295
+ end
296
+
297
+ if attributes[:'vipIds']
298
+ self.vip_ids = attributes[:'vipIds']
299
+ end
300
+
301
+ end
302
+
303
+ # Custom attribute writer method checking allowed values (enum).
304
+ # @param [Object] database_edition Object to be assigned
305
+ def database_edition=(database_edition)
306
+ if database_edition && !DATABASE_EDITION_ENUM.include?(database_edition)
307
+ @database_edition = DATABASE_EDITION_UNKNOWN_ENUM_VALUE
308
+ else
309
+ @database_edition = database_edition
310
+ end
311
+ end
312
+
313
+ # Custom attribute writer method checking allowed values (enum).
314
+ # @param [Object] disk_redundancy Object to be assigned
315
+ def disk_redundancy=(disk_redundancy)
316
+ if disk_redundancy && !DISK_REDUNDANCY_ENUM.include?(disk_redundancy)
317
+ @disk_redundancy = DISK_REDUNDANCY_UNKNOWN_ENUM_VALUE
318
+ else
319
+ @disk_redundancy = disk_redundancy
320
+ end
321
+ end
322
+
323
+ # Custom attribute writer method checking allowed values (enum).
324
+ # @param [Object] license_model Object to be assigned
325
+ def license_model=(license_model)
326
+ if license_model && !LICENSE_MODEL_ENUM.include?(license_model)
327
+ @license_model = LICENSE_MODEL_UNKNOWN_ENUM_VALUE
328
+ else
329
+ @license_model = license_model
330
+ end
331
+ end
332
+
333
+ # Custom attribute writer method checking allowed values (enum).
334
+ # @param [Object] lifecycle_state Object to be assigned
335
+ def lifecycle_state=(lifecycle_state)
336
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
337
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
338
+ else
339
+ @lifecycle_state = lifecycle_state
340
+ end
341
+ end
342
+
343
+ # Checks equality by comparing each attribute.
344
+ # @param [Object] other_object to be compared
345
+ def ==(other_object)
346
+ return true if self.equal?(other_object)
347
+ self.class == other_object.class &&
348
+ availability_domain == other_object.availability_domain &&
349
+ backup_subnet_id == other_object.backup_subnet_id &&
350
+ cluster_name == other_object.cluster_name &&
351
+ compartment_id == other_object.compartment_id &&
352
+ cpu_core_count == other_object.cpu_core_count &&
353
+ data_storage_percentage == other_object.data_storage_percentage &&
354
+ data_storage_size_in_gb == other_object.data_storage_size_in_gb &&
355
+ database_edition == other_object.database_edition &&
356
+ disk_redundancy == other_object.disk_redundancy &&
357
+ display_name == other_object.display_name &&
358
+ domain == other_object.domain &&
359
+ hostname == other_object.hostname &&
360
+ id == other_object.id &&
361
+ last_patch_history_entry_id == other_object.last_patch_history_entry_id &&
362
+ license_model == other_object.license_model &&
363
+ lifecycle_details == other_object.lifecycle_details &&
364
+ lifecycle_state == other_object.lifecycle_state &&
365
+ listener_port == other_object.listener_port &&
366
+ node_count == other_object.node_count &&
367
+ reco_storage_size_in_gb == other_object.reco_storage_size_in_gb &&
368
+ scan_dns_record_id == other_object.scan_dns_record_id &&
369
+ scan_ip_ids == other_object.scan_ip_ids &&
370
+ shape == other_object.shape &&
371
+ ssh_public_keys == other_object.ssh_public_keys &&
372
+ subnet_id == other_object.subnet_id &&
373
+ time_created == other_object.time_created &&
374
+ version == other_object.version &&
375
+ vip_ids == other_object.vip_ids
376
+ end
377
+
378
+ # @see the `==` method
379
+ # @param [Object] other_object to be compared
380
+ def eql?(other_object)
381
+ self == other_object
382
+ end
383
+
384
+ # Calculates hash code according to all attributes.
385
+ # @return [Fixnum] Hash code
386
+ def hash
387
+ [availability_domain, backup_subnet_id, cluster_name, compartment_id, cpu_core_count, data_storage_percentage, data_storage_size_in_gb, database_edition, disk_redundancy, display_name, domain, hostname, id, last_patch_history_entry_id, license_model, lifecycle_details, lifecycle_state, listener_port, node_count, reco_storage_size_in_gb, scan_dns_record_id, scan_ip_ids, shape, ssh_public_keys, subnet_id, time_created, version, vip_ids].hash
388
+ end
389
+
390
+ # Builds the object from hash
391
+ # @param [Hash] attributes Model attributes in the form of hash
392
+ # @return [Object] Returns the model itself
393
+ def build_from_hash(attributes)
394
+ return nil unless attributes.is_a?(Hash)
395
+ self.class.swagger_types.each_pair do |key, type|
396
+ if type =~ /^Array<(.*)>/i
397
+ # check to ensure the input is an array given that the the attribute
398
+ # is documented as an array but the input is not
399
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
400
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
401
+ end
402
+ elsif !attributes[self.class.attribute_map[key]].nil?
403
+ self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
404
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
405
+ end
406
+
407
+ self
408
+ end
409
+
410
+ # Returns the string representation of the object
411
+ # @return [String] String presentation of the object
412
+ def to_s
413
+ to_hash.to_s
414
+ end
415
+
416
+ # Returns the object in the form of hash
417
+ # @return [Hash] Returns the object in the form of hash
418
+ def to_hash
419
+ hash = {}
420
+ self.class.attribute_map.each_pair do |attr, param|
421
+ value = self.send(attr)
422
+ next if value.nil?
423
+ hash[param] = _to_hash(value)
424
+ end
425
+ hash
426
+ end
427
+
428
+ private
429
+
430
+ # Outputs non-array value in the form of hash
431
+ # For object, use to_hash. Otherwise, just return the value
432
+ # @param [Object] value Any valid value
433
+ # @return [Hash] Returns the value in the form of hash
434
+ def _to_hash(value)
435
+ if value.is_a?(Array)
436
+ value.compact.map{ |v| _to_hash(v) }
437
+ elsif value.is_a?(Hash)
438
+ {}.tap do |hash|
439
+ value.each { |k, v| hash[k] = _to_hash(v) }
440
+ end
441
+ elsif value.respond_to? :to_hash
442
+ value.to_hash
443
+ else
444
+ value
445
+ end
446
+ end
447
+
448
+
449
+
450
+ # Attribute mapping from ruby-style variable name to JSON key.
451
+ def self.attribute_map
452
+ {
453
+ :'availability_domain' => :'availabilityDomain',
454
+ :'backup_subnet_id' => :'backupSubnetId',
455
+ :'cluster_name' => :'clusterName',
456
+ :'compartment_id' => :'compartmentId',
457
+ :'cpu_core_count' => :'cpuCoreCount',
458
+ :'data_storage_percentage' => :'dataStoragePercentage',
459
+ :'data_storage_size_in_gb' => :'dataStorageSizeInGB',
460
+ :'database_edition' => :'databaseEdition',
461
+ :'disk_redundancy' => :'diskRedundancy',
462
+ :'display_name' => :'displayName',
463
+ :'domain' => :'domain',
464
+ :'hostname' => :'hostname',
465
+ :'id' => :'id',
466
+ :'last_patch_history_entry_id' => :'lastPatchHistoryEntryId',
467
+ :'license_model' => :'licenseModel',
468
+ :'lifecycle_details' => :'lifecycleDetails',
469
+ :'lifecycle_state' => :'lifecycleState',
470
+ :'listener_port' => :'listenerPort',
471
+ :'node_count' => :'nodeCount',
472
+ :'reco_storage_size_in_gb' => :'recoStorageSizeInGB',
473
+ :'scan_dns_record_id' => :'scanDnsRecordId',
474
+ :'scan_ip_ids' => :'scanIpIds',
475
+ :'shape' => :'shape',
476
+ :'ssh_public_keys' => :'sshPublicKeys',
477
+ :'subnet_id' => :'subnetId',
478
+ :'time_created' => :'timeCreated',
479
+ :'version' => :'version',
480
+ :'vip_ids' => :'vipIds'
481
+ }
482
+ end
483
+
484
+ # Attribute type mapping.
485
+ def self.swagger_types
486
+ {
487
+ :'availability_domain' => :'String',
488
+ :'backup_subnet_id' => :'String',
489
+ :'cluster_name' => :'String',
490
+ :'compartment_id' => :'String',
491
+ :'cpu_core_count' => :'Integer',
492
+ :'data_storage_percentage' => :'Integer',
493
+ :'data_storage_size_in_gb' => :'Integer',
494
+ :'database_edition' => :'String',
495
+ :'disk_redundancy' => :'String',
496
+ :'display_name' => :'String',
497
+ :'domain' => :'String',
498
+ :'hostname' => :'String',
499
+ :'id' => :'String',
500
+ :'last_patch_history_entry_id' => :'String',
501
+ :'license_model' => :'String',
502
+ :'lifecycle_details' => :'String',
503
+ :'lifecycle_state' => :'String',
504
+ :'listener_port' => :'Integer',
505
+ :'node_count' => :'Integer',
506
+ :'reco_storage_size_in_gb' => :'Integer',
507
+ :'scan_dns_record_id' => :'String',
508
+ :'scan_ip_ids' => :'Array<String>',
509
+ :'shape' => :'String',
510
+ :'ssh_public_keys' => :'Array<String>',
511
+ :'subnet_id' => :'String',
512
+ :'time_created' => :'DateTime',
513
+ :'version' => :'String',
514
+ :'vip_ids' => :'Array<String>'
515
+ }
516
+ end
517
+ end
518
+ end