Class: OCI::OsManagementHub::Models::ScheduledJobOperation

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/os_management_hub/models/scheduled_job_operation.rb

Overview

Defines an operation that is performed by a scheduled job.

Constant Summary collapse

OPERATION_TYPE_ENUM =
[
  OPERATION_TYPE_INSTALL_PACKAGES = 'INSTALL_PACKAGES'.freeze,
  OPERATION_TYPE_UPDATE_PACKAGES = 'UPDATE_PACKAGES'.freeze,
  OPERATION_TYPE_REMOVE_PACKAGES = 'REMOVE_PACKAGES'.freeze,
  OPERATION_TYPE_UPDATE_ALL = 'UPDATE_ALL'.freeze,
  OPERATION_TYPE_UPDATE_SECURITY = 'UPDATE_SECURITY'.freeze,
  OPERATION_TYPE_UPDATE_BUGFIX = 'UPDATE_BUGFIX'.freeze,
  OPERATION_TYPE_UPDATE_ENHANCEMENT = 'UPDATE_ENHANCEMENT'.freeze,
  OPERATION_TYPE_UPDATE_OTHER = 'UPDATE_OTHER'.freeze,
  OPERATION_TYPE_UPDATE_KSPLICE_USERSPACE = 'UPDATE_KSPLICE_USERSPACE'.freeze,
  OPERATION_TYPE_UPDATE_KSPLICE_KERNEL = 'UPDATE_KSPLICE_KERNEL'.freeze,
  OPERATION_TYPE_MANAGE_MODULE_STREAMS = 'MANAGE_MODULE_STREAMS'.freeze,
  OPERATION_TYPE_SWITCH_MODULE_STREAM = 'SWITCH_MODULE_STREAM'.freeze,
  OPERATION_TYPE_ATTACH_SOFTWARE_SOURCES = 'ATTACH_SOFTWARE_SOURCES'.freeze,
  OPERATION_TYPE_DETACH_SOFTWARE_SOURCES = 'DETACH_SOFTWARE_SOURCES'.freeze,
  OPERATION_TYPE_SYNC_MANAGEMENT_STATION_MIRROR = 'SYNC_MANAGEMENT_STATION_MIRROR'.freeze,
  OPERATION_TYPE_PROMOTE_LIFECYCLE = 'PROMOTE_LIFECYCLE'.freeze,
  OPERATION_TYPE_INSTALL_WINDOWS_UPDATES = 'INSTALL_WINDOWS_UPDATES'.freeze,
  OPERATION_TYPE_INSTALL_ALL_WINDOWS_UPDATES = 'INSTALL_ALL_WINDOWS_UPDATES'.freeze,
  OPERATION_TYPE_INSTALL_SECURITY_WINDOWS_UPDATES = 'INSTALL_SECURITY_WINDOWS_UPDATES'.freeze,
  OPERATION_TYPE_INSTALL_BUGFIX_WINDOWS_UPDATES = 'INSTALL_BUGFIX_WINDOWS_UPDATES'.freeze,
  OPERATION_TYPE_INSTALL_ENHANCEMENT_WINDOWS_UPDATES = 'INSTALL_ENHANCEMENT_WINDOWS_UPDATES'.freeze,
  OPERATION_TYPE_INSTALL_OTHER_WINDOWS_UPDATES = 'INSTALL_OTHER_WINDOWS_UPDATES'.freeze,
  OPERATION_TYPE_REBOOT = 'REBOOT'.freeze,
  OPERATION_TYPE_RERUN_WORK_REQUEST = 'RERUN_WORK_REQUEST'.freeze,
  OPERATION_TYPE_INSTALL_SNAPS = 'INSTALL_SNAPS'.freeze,
  OPERATION_TYPE_REMOVE_SNAPS = 'REMOVE_SNAPS'.freeze,
  OPERATION_TYPE_SWITCH_SNAP_CHANNEL = 'SWITCH_SNAP_CHANNEL'.freeze,
  OPERATION_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ScheduledJobOperation

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 137

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.operation_type = attributes[:'operationType'] if attributes[:'operationType']

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

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

  self.package_names = attributes[:'packageNames'] if attributes[:'packageNames']

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

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

  self.windows_update_names = attributes[:'windowsUpdateNames'] if attributes[:'windowsUpdateNames']

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

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

  self.manage_module_streams_details = attributes[:'manageModuleStreamsDetails'] if attributes[:'manageModuleStreamsDetails']

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

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

  self.switch_module_streams_details = attributes[:'switchModuleStreamsDetails'] if attributes[:'switchModuleStreamsDetails']

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

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

  self.software_source_ids = attributes[:'softwareSourceIds'] if attributes[:'softwareSourceIds']

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

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

  self.reboot_timeout_in_mins = attributes[:'rebootTimeoutInMins'] if attributes[:'rebootTimeoutInMins']

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

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

  self.install_snap_details = attributes[:'installSnapDetails'] if attributes[:'installSnapDetails']

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

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

  self.remove_snap_details = attributes[:'removeSnapDetails'] if attributes[:'removeSnapDetails']

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

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

  self.switch_snap_channel_details = attributes[:'switchSnapChannelDetails'] if attributes[:'switchSnapChannelDetails']

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

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

Instance Attribute Details

#install_snap_detailsOCI::OsManagementHub::Models::InstallSnapDetails



77
78
79
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 77

def install_snap_details
  @install_snap_details
end

#manage_module_streams_detailsOCI::OsManagementHub::Models::ManageModuleStreamsInScheduledJobDetails



59
60
61
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 59

def manage_module_streams_details
  @manage_module_streams_details
end

#operation_typeString

[Required] The type of operation this scheduled job performs.

Returns:

  • (String)


45
46
47
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 45

def operation_type
  @operation_type
end

#package_namesArray<String>

The names of the target packages. This parameter only applies when the scheduled job is for installing, updating, or removing packages.

Returns:

  • (Array<String>)


49
50
51
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 49

def package_names
  @package_names
end

#reboot_timeout_in_minsInteger

The number of minutes the service waits for the reboot to complete. If the instance doesn't reboot within the timeout, the service marks the reboot job as failed.

Returns:

  • (Integer)


74
75
76
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 74

def reboot_timeout_in_mins
  @reboot_timeout_in_mins
end

#remove_snap_detailsOCI::OsManagementHub::Models::RemoveSnapDetails



80
81
82
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 80

def remove_snap_details
  @remove_snap_details
end

#software_source_idsArray<String>

The software source OCIDs. This parameter only applies when the scheduled job is for attaching or detaching software sources.

Returns:

  • (Array<String>)


68
69
70
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 68

def software_source_ids
  @software_source_ids
end

#switch_module_streams_detailsOCI::OsManagementHub::Models::ModuleStreamDetails



62
63
64
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 62

def switch_module_streams_details
  @switch_module_streams_details
end

#switch_snap_channel_detailsOCI::OsManagementHub::Models::SwitchSnapChannelDetails



83
84
85
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 83

def switch_snap_channel_details
  @switch_snap_channel_details
end

#windows_update_namesArray<String>

Unique identifier for the Windows update. This parameter only applies if the scheduled job is for installing Windows updates. Note that this is not an OCID, but is a unique identifier assigned by Microsoft. For example: '6981d463-cd91-4a26-b7c4-ea4ded9183ed'.

Returns:

  • (Array<String>)


56
57
58
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 56

def windows_update_names
  @windows_update_names
end

Class Method Details

.attribute_mapObject

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



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 86

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'operation_type': :'operationType',
    'package_names': :'packageNames',
    'windows_update_names': :'windowsUpdateNames',
    'manage_module_streams_details': :'manageModuleStreamsDetails',
    'switch_module_streams_details': :'switchModuleStreamsDetails',
    'software_source_ids': :'softwareSourceIds',
    'reboot_timeout_in_mins': :'rebootTimeoutInMins',
    'install_snap_details': :'installSnapDetails',
    'remove_snap_details': :'removeSnapDetails',
    'switch_snap_channel_details': :'switchSnapChannelDetails'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 104

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'operation_type': :'String',
    'package_names': :'Array<String>',
    'windows_update_names': :'Array<String>',
    'manage_module_streams_details': :'OCI::OsManagementHub::Models::ManageModuleStreamsInScheduledJobDetails',
    'switch_module_streams_details': :'OCI::OsManagementHub::Models::ModuleStreamDetails',
    'software_source_ids': :'Array<String>',
    'reboot_timeout_in_mins': :'Integer',
    'install_snap_details': :'OCI::OsManagementHub::Models::InstallSnapDetails',
    'remove_snap_details': :'OCI::OsManagementHub::Models::RemoveSnapDetails',
    'switch_snap_channel_details': :'OCI::OsManagementHub::Models::SwitchSnapChannelDetails'
    # 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



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 224

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

  self.class == other.class &&
    operation_type == other.operation_type &&
    package_names == other.package_names &&
    windows_update_names == other.windows_update_names &&
    manage_module_streams_details == other.manage_module_streams_details &&
    switch_module_streams_details == other.switch_module_streams_details &&
    software_source_ids == other.software_source_ids &&
    reboot_timeout_in_mins == other.reboot_timeout_in_mins &&
    install_snap_details == other.install_snap_details &&
    remove_snap_details == other.remove_snap_details &&
    switch_snap_channel_details == other.switch_snap_channel_details
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



263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 263

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


243
244
245
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 243

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



252
253
254
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 252

def hash
  [operation_type, package_names, windows_update_names, manage_module_streams_details, switch_module_streams_details, software_source_ids, reboot_timeout_in_mins, install_snap_details, remove_snap_details, switch_snap_channel_details].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



296
297
298
299
300
301
302
303
304
305
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 296

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



290
291
292
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 290

def to_s
  to_hash.to_s
end