Class: OCI::OsManagement::Models::ScheduledJobSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/os_management/models/scheduled_job_summary.rb

Overview

Basic information about a Scheduled Job

Constant Summary collapse

SCHEDULE_TYPE_ENUM =
[
  SCHEDULE_TYPE_ONETIME = 'ONETIME'.freeze,
  SCHEDULE_TYPE_RECURRING = 'RECURRING'.freeze,
  SCHEDULE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
OPERATION_TYPE_ENUM =
[
  OPERATION_TYPE_INSTALL = 'INSTALL'.freeze,
  OPERATION_TYPE_UPDATE = 'UPDATE'.freeze,
  OPERATION_TYPE_REMOVE = 'REMOVE'.freeze,
  OPERATION_TYPE_UPDATEALL = 'UPDATEALL'.freeze,
  OPERATION_TYPE_ENABLEMODULESTREAM = 'ENABLEMODULESTREAM'.freeze,
  OPERATION_TYPE_DISABLEMODULESTREAM = 'DISABLEMODULESTREAM'.freeze,
  OPERATION_TYPE_SWITCHMODULESTREAM = 'SWITCHMODULESTREAM'.freeze,
  OPERATION_TYPE_INSTALLMODULESTREAMPROFILE = 'INSTALLMODULESTREAMPROFILE'.freeze,
  OPERATION_TYPE_REMOVEMODULESTREAMPROFILE = 'REMOVEMODULESTREAMPROFILE'.freeze,
  OPERATION_TYPE_COMPOUND = 'COMPOUND'.freeze,
  OPERATION_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
  LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
OS_FAMILY_ENUM =
[
  OS_FAMILY_LINUX = 'LINUX'.freeze,
  OS_FAMILY_WINDOWS = 'WINDOWS'.freeze,
  OS_FAMILY_ALL = 'ALL'.freeze,
  OS_FAMILY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ScheduledJobSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id property

  • :display_name (String)

    The value to assign to the #display_name property

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :schedule_type (String)

    The value to assign to the #schedule_type property

  • :time_next_execution (DateTime)

    The value to assign to the #time_next_execution property

  • :time_last_execution (DateTime)

    The value to assign to the #time_last_execution property

  • :managed_instances (Array<OCI::OsManagement::Models::Id>)

    The value to assign to the #managed_instances property

  • :managed_instance_groups (Array<OCI::OsManagement::Models::Id>)

    The value to assign to the #managed_instance_groups property

  • :operation_type (String)

    The value to assign to the #operation_type property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :freeform_tags (Hash<String, String>)

    The value to assign to the #freeform_tags property

  • :defined_tags (Hash<String, Hash<String, Object>>)

    The value to assign to the #defined_tags property

  • :os_family (String)

    The value to assign to the #os_family property

  • :is_restricted (BOOLEAN)

    The value to assign to the #is_restricted property



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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# File 'lib/oci/os_management/models/scheduled_job_summary.rb', line 172

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

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

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

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

  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']

  self.schedule_type = attributes[:'scheduleType'] if attributes[:'scheduleType']

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

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

  self.time_next_execution = attributes[:'timeNextExecution'] if attributes[:'timeNextExecution']

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

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

  self.time_last_execution = attributes[:'timeLastExecution'] if attributes[:'timeLastExecution']

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

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

  self.managed_instances = attributes[:'managedInstances'] if attributes[:'managedInstances']

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

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

  self.managed_instance_groups = attributes[:'managedInstanceGroups'] if attributes[:'managedInstanceGroups']

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

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

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

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

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

  self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']

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

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

  self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']

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

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

  self.os_family = attributes[:'osFamily'] if attributes[:'osFamily']

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

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

  self.is_restricted = attributes[:'isRestricted'] unless attributes[:'isRestricted'].nil?

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

  self.is_restricted = attributes[:'is_restricted'] unless attributes[:'is_restricted'].nil?
end

Instance Attribute Details

#compartment_idString

OCID for the Compartment

Returns:

  • (String)


58
59
60
# File 'lib/oci/os_management/models/scheduled_job_summary.rb', line 58

def compartment_id
  @compartment_id
end

#defined_tagsHash<String, Hash<String, Object>>

Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"bar-key": "value"}`

Returns:

  • (Hash<String, Hash<String, Object>>)


98
99
100
# File 'lib/oci/os_management/models/scheduled_job_summary.rb', line 98

def defined_tags
  @defined_tags
end

#display_nameString

**[Required]** Scheduled Job name

Returns:

  • (String)


54
55
56
# File 'lib/oci/os_management/models/scheduled_job_summary.rb', line 54

def display_name
  @display_name
end

#freeform_tagsHash<String, String>

Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `"value"`

Returns:

  • (Hash<String, String>)


92
93
94
# File 'lib/oci/os_management/models/scheduled_job_summary.rb', line 92

def freeform_tags
  @freeform_tags
end

#idString

**[Required]** OCID for the Scheduled Job

Returns:

  • (String)


50
51
52
# File 'lib/oci/os_management/models/scheduled_job_summary.rb', line 50

def id
  @id
end

#is_restrictedBOOLEAN

true, if the schedule job has its update capabilities restricted. (Used to track Autonomous Scheduled Job)

Returns:

  • (BOOLEAN)


106
107
108
# File 'lib/oci/os_management/models/scheduled_job_summary.rb', line 106

def is_restricted
  @is_restricted
end

#lifecycle_stateString

The current state of the Scheduled Job.

Returns:

  • (String)


86
87
88
# File 'lib/oci/os_management/models/scheduled_job_summary.rb', line 86

def lifecycle_state
  @lifecycle_state
end

#managed_instance_groupsArray<OCI::OsManagement::Models::Id>

the list of managed instance groups this scheduled job operates on (mutually exclusive with managedInstances)

Returns:

  • (Array<OCI::OsManagement::Models::Id>)


78
79
80
# File 'lib/oci/os_management/models/scheduled_job_summary.rb', line 78

def managed_instance_groups
  @managed_instance_groups
end

#managed_instancesArray<OCI::OsManagement::Models::Id>

the list of managed instances this scheduled job operates on (mutually exclusive with managedInstanceGroups)

Returns:

  • (Array<OCI::OsManagement::Models::Id>)


74
75
76
# File 'lib/oci/os_management/models/scheduled_job_summary.rb', line 74

def managed_instances
  @managed_instances
end

#operation_typeString

the type of operation this Scheduled Job performs

Returns:

  • (String)


82
83
84
# File 'lib/oci/os_management/models/scheduled_job_summary.rb', line 82

def operation_type
  @operation_type
end

#os_familyString

The Operating System type of the managed instance.

Returns:

  • (String)


102
103
104
# File 'lib/oci/os_management/models/scheduled_job_summary.rb', line 102

def os_family
  @os_family
end

#schedule_typeString

the type of scheduling this Scheduled Job follows

Returns:

  • (String)


62
63
64
# File 'lib/oci/os_management/models/scheduled_job_summary.rb', line 62

def schedule_type
  @schedule_type
end

#time_last_executionDateTime

the time/date of the last execution of this Scheduled Job

Returns:

  • (DateTime)


70
71
72
# File 'lib/oci/os_management/models/scheduled_job_summary.rb', line 70

def time_last_execution
  @time_last_execution
end

#time_next_executionDateTime

the time/date of the next scheduled execution of this Scheduled Job

Returns:

  • (DateTime)


66
67
68
# File 'lib/oci/os_management/models/scheduled_job_summary.rb', line 66

def time_next_execution
  @time_next_execution
end

Class Method Details

.attribute_mapObject

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



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/oci/os_management/models/scheduled_job_summary.rb', line 109

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'display_name': :'displayName',
    'compartment_id': :'compartmentId',
    'schedule_type': :'scheduleType',
    'time_next_execution': :'timeNextExecution',
    'time_last_execution': :'timeLastExecution',
    'managed_instances': :'managedInstances',
    'managed_instance_groups': :'managedInstanceGroups',
    'operation_type': :'operationType',
    'lifecycle_state': :'lifecycleState',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags',
    'os_family': :'osFamily',
    'is_restricted': :'isRestricted'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/oci/os_management/models/scheduled_job_summary.rb', line 131

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'display_name': :'String',
    'compartment_id': :'String',
    'schedule_type': :'String',
    'time_next_execution': :'DateTime',
    'time_last_execution': :'DateTime',
    'managed_instances': :'Array<OCI::OsManagement::Models::Id>',
    'managed_instance_groups': :'Array<OCI::OsManagement::Models::Id>',
    'operation_type': :'String',
    'lifecycle_state': :'String',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>',
    'os_family': :'String',
    'is_restricted': :'BOOLEAN'
    # 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



318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
# File 'lib/oci/os_management/models/scheduled_job_summary.rb', line 318

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

  self.class == other.class &&
    id == other.id &&
    display_name == other.display_name &&
    compartment_id == other.compartment_id &&
    schedule_type == other.schedule_type &&
    time_next_execution == other.time_next_execution &&
    time_last_execution == other.time_last_execution &&
    managed_instances == other.managed_instances &&
    managed_instance_groups == other.managed_instance_groups &&
    operation_type == other.operation_type &&
    lifecycle_state == other.lifecycle_state &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags &&
    os_family == other.os_family &&
    is_restricted == other.is_restricted
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



361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
# File 'lib/oci/os_management/models/scheduled_job_summary.rb', line 361

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


341
342
343
# File 'lib/oci/os_management/models/scheduled_job_summary.rb', line 341

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



350
351
352
# File 'lib/oci/os_management/models/scheduled_job_summary.rb', line 350

def hash
  [id, display_name, compartment_id, schedule_type, time_next_execution, time_last_execution, managed_instances, managed_instance_groups, operation_type, lifecycle_state, freeform_tags, defined_tags, os_family, is_restricted].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



394
395
396
397
398
399
400
401
402
403
# File 'lib/oci/os_management/models/scheduled_job_summary.rb', line 394

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



388
389
390
# File 'lib/oci/os_management/models/scheduled_job_summary.rb', line 388

def to_s
  to_hash.to_s
end