Class: OCI::Database::Models::CreateMaintenanceRunDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database/models/create_maintenance_run_details.rb

Overview

Details to schedule Maintenance Run with Latest Release Update along TimeZone File Update for the specified resource.

Constant Summary collapse

PATCHING_MODE_ENUM =
[
  PATCHING_MODE_ROLLING = 'ROLLING'.freeze,
  PATCHING_MODE_NONROLLING = 'NONROLLING'.freeze
].freeze
PATCH_TYPE_ENUM =
[
  PATCH_TYPE_QUARTERLY = 'QUARTERLY'.freeze,
  PATCH_TYPE_TIMEZONE = 'TIMEZONE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CreateMaintenanceRunDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :target_resource_id (String)

    The value to assign to the #target_resource_id property

  • :is_dst_file_update_enabled (BOOLEAN)

    The value to assign to the #is_dst_file_update_enabled property

  • :time_scheduled (DateTime)

    The value to assign to the #time_scheduled property

  • :patching_mode (String)

    The value to assign to the #patching_mode property

  • :patch_type (String)

    The value to assign to the #patch_type property

  • :compartment_id (String)

    The value to assign to the #compartment_id property



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/oci/database/models/create_maintenance_run_details.rb', line 90

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.target_resource_id = attributes[:'targetResourceId'] if attributes[:'targetResourceId']

  raise 'You cannot provide both :targetResourceId and :target_resource_id' if attributes.key?(:'targetResourceId') && attributes.key?(:'target_resource_id')

  self.target_resource_id = attributes[:'target_resource_id'] if attributes[:'target_resource_id']

  self.is_dst_file_update_enabled = attributes[:'isDstFileUpdateEnabled'] unless attributes[:'isDstFileUpdateEnabled'].nil?

  raise 'You cannot provide both :isDstFileUpdateEnabled and :is_dst_file_update_enabled' if attributes.key?(:'isDstFileUpdateEnabled') && attributes.key?(:'is_dst_file_update_enabled')

  self.is_dst_file_update_enabled = attributes[:'is_dst_file_update_enabled'] unless attributes[:'is_dst_file_update_enabled'].nil?

  self.time_scheduled = attributes[:'timeScheduled'] if attributes[:'timeScheduled']

  raise 'You cannot provide both :timeScheduled and :time_scheduled' if attributes.key?(:'timeScheduled') && attributes.key?(:'time_scheduled')

  self.time_scheduled = attributes[:'time_scheduled'] if attributes[:'time_scheduled']

  self.patching_mode = attributes[:'patchingMode'] if attributes[:'patchingMode']

  raise 'You cannot provide both :patchingMode and :patching_mode' if attributes.key?(:'patchingMode') && attributes.key?(:'patching_mode')

  self.patching_mode = attributes[:'patching_mode'] if attributes[:'patching_mode']

  self.patch_type = attributes[:'patchType'] if attributes[:'patchType']

  raise 'You cannot provide both :patchType and :patch_type' if attributes.key?(:'patchType') && attributes.key?(:'patch_type')

  self.patch_type = attributes[:'patch_type'] if attributes[:'patch_type']

  self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']

  raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')

  self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
end

Instance Attribute Details

#compartment_idString

The OCID of the compartment containing the Maintenance Run.

Returns:

  • (String)


48
49
50
# File 'lib/oci/database/models/create_maintenance_run_details.rb', line 48

def compartment_id
  @compartment_id
end

#is_dst_file_update_enabledBOOLEAN

Indicates if an automatic DST Time Zone file update is enabled for the Autonomous Container Database. If enabled along with Release Update, patching will be done in a Non-Rolling manner.

Returns:

  • (BOOLEAN)


28
29
30
# File 'lib/oci/database/models/create_maintenance_run_details.rb', line 28

def is_dst_file_update_enabled
  @is_dst_file_update_enabled
end

#patch_typeString

[Required] Patch type, either "QUARTERLY" or "TIMEZONE".

Returns:

  • (String)


44
45
46
# File 'lib/oci/database/models/create_maintenance_run_details.rb', line 44

def patch_type
  @patch_type
end

#patching_modeString

Cloud Exadata infrastructure node patching method, either "ROLLING" or "NONROLLING". Default value is ROLLING.

IMPORTANT: Non-rolling infrastructure patching involves system down time. See Oracle-Managed Infrastructure Maintenance Updates for more information.

Returns:

  • (String)


39
40
41
# File 'lib/oci/database/models/create_maintenance_run_details.rb', line 39

def patching_mode
  @patching_mode
end

#target_resource_idString

[Required] The ID of the target resource for which the maintenance run should be created.

Returns:

  • (String)


24
25
26
# File 'lib/oci/database/models/create_maintenance_run_details.rb', line 24

def target_resource_id
  @target_resource_id
end

#time_scheduledDateTime

[Required] The date and time that update should be scheduled.

Returns:

  • (DateTime)


32
33
34
# File 'lib/oci/database/models/create_maintenance_run_details.rb', line 32

def time_scheduled
  @time_scheduled
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/oci/database/models/create_maintenance_run_details.rb', line 51

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'target_resource_id': :'targetResourceId',
    'is_dst_file_update_enabled': :'isDstFileUpdateEnabled',
    'time_scheduled': :'timeScheduled',
    'patching_mode': :'patchingMode',
    'patch_type': :'patchType',
    'compartment_id': :'compartmentId'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/oci/database/models/create_maintenance_run_details.rb', line 65

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'target_resource_id': :'String',
    'is_dst_file_update_enabled': :'BOOLEAN',
    'time_scheduled': :'DateTime',
    'patching_mode': :'String',
    'patch_type': :'String',
    'compartment_id': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



156
157
158
159
160
161
162
163
164
165
166
# File 'lib/oci/database/models/create_maintenance_run_details.rb', line 156

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    target_resource_id == other.target_resource_id &&
    is_dst_file_update_enabled == other.is_dst_file_update_enabled &&
    time_scheduled == other.time_scheduled &&
    patching_mode == other.patching_mode &&
    patch_type == other.patch_type &&
    compartment_id == other.compartment_id
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# File 'lib/oci/database/models/create_maintenance_run_details.rb', line 191

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


171
172
173
# File 'lib/oci/database/models/create_maintenance_run_details.rb', line 171

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



180
181
182
# File 'lib/oci/database/models/create_maintenance_run_details.rb', line 180

def hash
  [target_resource_id, is_dst_file_update_enabled, time_scheduled, patching_mode, patch_type, compartment_id].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



224
225
226
227
228
229
230
231
232
233
# File 'lib/oci/database/models/create_maintenance_run_details.rb', line 224

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



218
219
220
# File 'lib/oci/database/models/create_maintenance_run_details.rb', line 218

def to_s
  to_hash.to_s
end