oci 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,261 @@
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::Database
7
+
8
+ LIFECYCLE_STATE_ENUM = [LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING',
9
+ LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE',
10
+ LIFECYCLE_STATE_UPDATING = 'UPDATING',
11
+ LIFECYCLE_STATE_TERMINATING = 'TERMINATING',
12
+ LIFECYCLE_STATE_TERMINATED = 'TERMINATED',
13
+ LIFECYCLE_STATE_FAILED = 'FAILED',
14
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
15
+
16
+ # The character set for the database.
17
+ # @return [String]
18
+ attr_accessor :character_set
19
+
20
+ # The OCID of the compartment.
21
+ # @return [String]
22
+ attr_accessor :compartment_id
23
+
24
+ # The OCID of the database home.
25
+ # @return [String]
26
+ attr_accessor :db_home_id
27
+
28
+ # The database name.
29
+ # @return [String]
30
+ attr_accessor :db_name
31
+
32
+ # A system-generated name for the database to ensure uniqueness within an Oracle Data Guard group (a primary database and its standby databases). The unique name cannot be changed.
33
+ #
34
+ # @return [String]
35
+ attr_accessor :db_unique_name
36
+
37
+ # Database workload type.
38
+ # @return [String]
39
+ attr_accessor :db_workload
40
+
41
+ # The OCID of the database.
42
+ # @return [String]
43
+ attr_accessor :id
44
+
45
+ # Additional information about the current lifecycleState.
46
+ # @return [String]
47
+ attr_accessor :lifecycle_details
48
+
49
+ # The current state of the database.
50
+ # @return [String]
51
+ attr_accessor :lifecycle_state
52
+
53
+ # The national character set for the database.
54
+ # @return [String]
55
+ attr_accessor :ncharacter_set
56
+
57
+ # Pluggable database name. It must begin with an alphabetic character and can contain a maximum of eight alphanumeric characters. Special characters are not permitted. Pluggable database should not be same as database name.
58
+ # @return [String]
59
+ attr_accessor :pdb_name
60
+
61
+ # The date and time the database was created.
62
+ # @return [DateTime]
63
+ attr_accessor :time_created
64
+
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ return unless attributes.is_a?(Hash)
70
+
71
+ # convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
73
+
74
+ if attributes[:'characterSet']
75
+ self.character_set = attributes[:'characterSet']
76
+ end
77
+
78
+ if attributes[:'compartmentId']
79
+ self.compartment_id = attributes[:'compartmentId']
80
+ end
81
+
82
+ if attributes[:'dbHomeId']
83
+ self.db_home_id = attributes[:'dbHomeId']
84
+ end
85
+
86
+ if attributes[:'dbName']
87
+ self.db_name = attributes[:'dbName']
88
+ end
89
+
90
+ if attributes[:'dbUniqueName']
91
+ self.db_unique_name = attributes[:'dbUniqueName']
92
+ end
93
+
94
+ if attributes[:'dbWorkload']
95
+ self.db_workload = attributes[:'dbWorkload']
96
+ end
97
+
98
+ if attributes[:'id']
99
+ self.id = attributes[:'id']
100
+ end
101
+
102
+ if attributes[:'lifecycleDetails']
103
+ self.lifecycle_details = attributes[:'lifecycleDetails']
104
+ end
105
+
106
+ if attributes[:'lifecycleState']
107
+ self.lifecycle_state = attributes[:'lifecycleState']
108
+ end
109
+
110
+ if attributes[:'ncharacterSet']
111
+ self.ncharacter_set = attributes[:'ncharacterSet']
112
+ end
113
+
114
+ if attributes[:'pdbName']
115
+ self.pdb_name = attributes[:'pdbName']
116
+ end
117
+
118
+ if attributes[:'timeCreated']
119
+ self.time_created = attributes[:'timeCreated']
120
+ end
121
+
122
+ end
123
+
124
+ # Custom attribute writer method checking allowed values (enum).
125
+ # @param [Object] lifecycle_state Object to be assigned
126
+ def lifecycle_state=(lifecycle_state)
127
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
128
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
129
+ else
130
+ @lifecycle_state = lifecycle_state
131
+ end
132
+ end
133
+
134
+ # Checks equality by comparing each attribute.
135
+ # @param [Object] other_object to be compared
136
+ def ==(other_object)
137
+ return true if self.equal?(other_object)
138
+ self.class == other_object.class &&
139
+ character_set == other_object.character_set &&
140
+ compartment_id == other_object.compartment_id &&
141
+ db_home_id == other_object.db_home_id &&
142
+ db_name == other_object.db_name &&
143
+ db_unique_name == other_object.db_unique_name &&
144
+ db_workload == other_object.db_workload &&
145
+ id == other_object.id &&
146
+ lifecycle_details == other_object.lifecycle_details &&
147
+ lifecycle_state == other_object.lifecycle_state &&
148
+ ncharacter_set == other_object.ncharacter_set &&
149
+ pdb_name == other_object.pdb_name &&
150
+ time_created == other_object.time_created
151
+ end
152
+
153
+ # @see the `==` method
154
+ # @param [Object] other_object to be compared
155
+ def eql?(other_object)
156
+ self == other_object
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Fixnum] Hash code
161
+ def hash
162
+ [character_set, compartment_id, db_home_id, db_name, db_unique_name, db_workload, id, lifecycle_details, lifecycle_state, ncharacter_set, pdb_name, time_created].hash
163
+ end
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def build_from_hash(attributes)
169
+ return nil unless attributes.is_a?(Hash)
170
+ self.class.swagger_types.each_pair do |key, type|
171
+ if type =~ /^Array<(.*)>/i
172
+ # check to ensure the input is an array given that the the attribute
173
+ # is documented as an array but the input is not
174
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
175
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
176
+ end
177
+ elsif !attributes[self.class.attribute_map[key]].nil?
178
+ self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
179
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
180
+ end
181
+
182
+ self
183
+ end
184
+
185
+ # Returns the string representation of the object
186
+ # @return [String] String presentation of the object
187
+ def to_s
188
+ to_hash.to_s
189
+ end
190
+
191
+ # Returns the object in the form of hash
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_hash
194
+ hash = {}
195
+ self.class.attribute_map.each_pair do |attr, param|
196
+ value = self.send(attr)
197
+ next if value.nil?
198
+ hash[param] = _to_hash(value)
199
+ end
200
+ hash
201
+ end
202
+
203
+ private
204
+
205
+ # Outputs non-array value in the form of hash
206
+ # For object, use to_hash. Otherwise, just return the value
207
+ # @param [Object] value Any valid value
208
+ # @return [Hash] Returns the value in the form of hash
209
+ def _to_hash(value)
210
+ if value.is_a?(Array)
211
+ value.compact.map{ |v| _to_hash(v) }
212
+ elsif value.is_a?(Hash)
213
+ {}.tap do |hash|
214
+ value.each { |k, v| hash[k] = _to_hash(v) }
215
+ end
216
+ elsif value.respond_to? :to_hash
217
+ value.to_hash
218
+ else
219
+ value
220
+ end
221
+ end
222
+
223
+
224
+
225
+ # Attribute mapping from ruby-style variable name to JSON key.
226
+ def self.attribute_map
227
+ {
228
+ :'character_set' => :'characterSet',
229
+ :'compartment_id' => :'compartmentId',
230
+ :'db_home_id' => :'dbHomeId',
231
+ :'db_name' => :'dbName',
232
+ :'db_unique_name' => :'dbUniqueName',
233
+ :'db_workload' => :'dbWorkload',
234
+ :'id' => :'id',
235
+ :'lifecycle_details' => :'lifecycleDetails',
236
+ :'lifecycle_state' => :'lifecycleState',
237
+ :'ncharacter_set' => :'ncharacterSet',
238
+ :'pdb_name' => :'pdbName',
239
+ :'time_created' => :'timeCreated'
240
+ }
241
+ end
242
+
243
+ # Attribute type mapping.
244
+ def self.swagger_types
245
+ {
246
+ :'character_set' => :'String',
247
+ :'compartment_id' => :'String',
248
+ :'db_home_id' => :'String',
249
+ :'db_name' => :'String',
250
+ :'db_unique_name' => :'String',
251
+ :'db_workload' => :'String',
252
+ :'id' => :'String',
253
+ :'lifecycle_details' => :'String',
254
+ :'lifecycle_state' => :'String',
255
+ :'ncharacter_set' => :'String',
256
+ :'pdb_name' => :'String',
257
+ :'time_created' => :'DateTime'
258
+ }
259
+ end
260
+ end
261
+ end
@@ -0,0 +1,261 @@
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::DatabaseSummary
7
+
8
+ LIFECYCLE_STATE_ENUM = [LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING',
9
+ LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE',
10
+ LIFECYCLE_STATE_UPDATING = 'UPDATING',
11
+ LIFECYCLE_STATE_TERMINATING = 'TERMINATING',
12
+ LIFECYCLE_STATE_TERMINATED = 'TERMINATED',
13
+ LIFECYCLE_STATE_FAILED = 'FAILED',
14
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
15
+
16
+ # The character set for the database.
17
+ # @return [String]
18
+ attr_accessor :character_set
19
+
20
+ # The OCID of the compartment.
21
+ # @return [String]
22
+ attr_accessor :compartment_id
23
+
24
+ # The OCID of the database home.
25
+ # @return [String]
26
+ attr_accessor :db_home_id
27
+
28
+ # The database name.
29
+ # @return [String]
30
+ attr_accessor :db_name
31
+
32
+ # A system-generated name for the database to ensure uniqueness within an Oracle Data Guard group (a primary database and its standby databases). The unique name cannot be changed.
33
+ #
34
+ # @return [String]
35
+ attr_accessor :db_unique_name
36
+
37
+ # Database workload type.
38
+ # @return [String]
39
+ attr_accessor :db_workload
40
+
41
+ # The OCID of the database.
42
+ # @return [String]
43
+ attr_accessor :id
44
+
45
+ # Additional information about the current lifecycleState.
46
+ # @return [String]
47
+ attr_accessor :lifecycle_details
48
+
49
+ # The current state of the database.
50
+ # @return [String]
51
+ attr_accessor :lifecycle_state
52
+
53
+ # The national character set for the database.
54
+ # @return [String]
55
+ attr_accessor :ncharacter_set
56
+
57
+ # Pluggable database name. It must begin with an alphabetic character and can contain a maximum of eight alphanumeric characters. Special characters are not permitted. Pluggable database should not be same as database name.
58
+ # @return [String]
59
+ attr_accessor :pdb_name
60
+
61
+ # The date and time the database was created.
62
+ # @return [DateTime]
63
+ attr_accessor :time_created
64
+
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ return unless attributes.is_a?(Hash)
70
+
71
+ # convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
73
+
74
+ if attributes[:'characterSet']
75
+ self.character_set = attributes[:'characterSet']
76
+ end
77
+
78
+ if attributes[:'compartmentId']
79
+ self.compartment_id = attributes[:'compartmentId']
80
+ end
81
+
82
+ if attributes[:'dbHomeId']
83
+ self.db_home_id = attributes[:'dbHomeId']
84
+ end
85
+
86
+ if attributes[:'dbName']
87
+ self.db_name = attributes[:'dbName']
88
+ end
89
+
90
+ if attributes[:'dbUniqueName']
91
+ self.db_unique_name = attributes[:'dbUniqueName']
92
+ end
93
+
94
+ if attributes[:'dbWorkload']
95
+ self.db_workload = attributes[:'dbWorkload']
96
+ end
97
+
98
+ if attributes[:'id']
99
+ self.id = attributes[:'id']
100
+ end
101
+
102
+ if attributes[:'lifecycleDetails']
103
+ self.lifecycle_details = attributes[:'lifecycleDetails']
104
+ end
105
+
106
+ if attributes[:'lifecycleState']
107
+ self.lifecycle_state = attributes[:'lifecycleState']
108
+ end
109
+
110
+ if attributes[:'ncharacterSet']
111
+ self.ncharacter_set = attributes[:'ncharacterSet']
112
+ end
113
+
114
+ if attributes[:'pdbName']
115
+ self.pdb_name = attributes[:'pdbName']
116
+ end
117
+
118
+ if attributes[:'timeCreated']
119
+ self.time_created = attributes[:'timeCreated']
120
+ end
121
+
122
+ end
123
+
124
+ # Custom attribute writer method checking allowed values (enum).
125
+ # @param [Object] lifecycle_state Object to be assigned
126
+ def lifecycle_state=(lifecycle_state)
127
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
128
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
129
+ else
130
+ @lifecycle_state = lifecycle_state
131
+ end
132
+ end
133
+
134
+ # Checks equality by comparing each attribute.
135
+ # @param [Object] other_object to be compared
136
+ def ==(other_object)
137
+ return true if self.equal?(other_object)
138
+ self.class == other_object.class &&
139
+ character_set == other_object.character_set &&
140
+ compartment_id == other_object.compartment_id &&
141
+ db_home_id == other_object.db_home_id &&
142
+ db_name == other_object.db_name &&
143
+ db_unique_name == other_object.db_unique_name &&
144
+ db_workload == other_object.db_workload &&
145
+ id == other_object.id &&
146
+ lifecycle_details == other_object.lifecycle_details &&
147
+ lifecycle_state == other_object.lifecycle_state &&
148
+ ncharacter_set == other_object.ncharacter_set &&
149
+ pdb_name == other_object.pdb_name &&
150
+ time_created == other_object.time_created
151
+ end
152
+
153
+ # @see the `==` method
154
+ # @param [Object] other_object to be compared
155
+ def eql?(other_object)
156
+ self == other_object
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Fixnum] Hash code
161
+ def hash
162
+ [character_set, compartment_id, db_home_id, db_name, db_unique_name, db_workload, id, lifecycle_details, lifecycle_state, ncharacter_set, pdb_name, time_created].hash
163
+ end
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def build_from_hash(attributes)
169
+ return nil unless attributes.is_a?(Hash)
170
+ self.class.swagger_types.each_pair do |key, type|
171
+ if type =~ /^Array<(.*)>/i
172
+ # check to ensure the input is an array given that the the attribute
173
+ # is documented as an array but the input is not
174
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
175
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
176
+ end
177
+ elsif !attributes[self.class.attribute_map[key]].nil?
178
+ self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
179
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
180
+ end
181
+
182
+ self
183
+ end
184
+
185
+ # Returns the string representation of the object
186
+ # @return [String] String presentation of the object
187
+ def to_s
188
+ to_hash.to_s
189
+ end
190
+
191
+ # Returns the object in the form of hash
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_hash
194
+ hash = {}
195
+ self.class.attribute_map.each_pair do |attr, param|
196
+ value = self.send(attr)
197
+ next if value.nil?
198
+ hash[param] = _to_hash(value)
199
+ end
200
+ hash
201
+ end
202
+
203
+ private
204
+
205
+ # Outputs non-array value in the form of hash
206
+ # For object, use to_hash. Otherwise, just return the value
207
+ # @param [Object] value Any valid value
208
+ # @return [Hash] Returns the value in the form of hash
209
+ def _to_hash(value)
210
+ if value.is_a?(Array)
211
+ value.compact.map{ |v| _to_hash(v) }
212
+ elsif value.is_a?(Hash)
213
+ {}.tap do |hash|
214
+ value.each { |k, v| hash[k] = _to_hash(v) }
215
+ end
216
+ elsif value.respond_to? :to_hash
217
+ value.to_hash
218
+ else
219
+ value
220
+ end
221
+ end
222
+
223
+
224
+
225
+ # Attribute mapping from ruby-style variable name to JSON key.
226
+ def self.attribute_map
227
+ {
228
+ :'character_set' => :'characterSet',
229
+ :'compartment_id' => :'compartmentId',
230
+ :'db_home_id' => :'dbHomeId',
231
+ :'db_name' => :'dbName',
232
+ :'db_unique_name' => :'dbUniqueName',
233
+ :'db_workload' => :'dbWorkload',
234
+ :'id' => :'id',
235
+ :'lifecycle_details' => :'lifecycleDetails',
236
+ :'lifecycle_state' => :'lifecycleState',
237
+ :'ncharacter_set' => :'ncharacterSet',
238
+ :'pdb_name' => :'pdbName',
239
+ :'time_created' => :'timeCreated'
240
+ }
241
+ end
242
+
243
+ # Attribute type mapping.
244
+ def self.swagger_types
245
+ {
246
+ :'character_set' => :'String',
247
+ :'compartment_id' => :'String',
248
+ :'db_home_id' => :'String',
249
+ :'db_name' => :'String',
250
+ :'db_unique_name' => :'String',
251
+ :'db_workload' => :'String',
252
+ :'id' => :'String',
253
+ :'lifecycle_details' => :'String',
254
+ :'lifecycle_state' => :'String',
255
+ :'ncharacter_set' => :'String',
256
+ :'pdb_name' => :'String',
257
+ :'time_created' => :'DateTime'
258
+ }
259
+ end
260
+ end
261
+ end