Class: OCI::DataCatalog::Models::Job

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/data_catalog/models/job.rb

Overview

Details of a job. Jobs are scheduled instances of a job definition.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Job

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :key (String)

    The value to assign to the #key property

  • :display_name (String)

    The value to assign to the #display_name property

  • :description (String)

    The value to assign to the #description property

  • :catalog_id (String)

    The value to assign to the #catalog_id property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :time_updated (DateTime)

    The value to assign to the #time_updated property

  • :job_type (String)

    The value to assign to the #job_type property

  • :schedule_cron_expression (String)

    The value to assign to the #schedule_cron_expression property

  • :time_schedule_begin (DateTime)

    The value to assign to the #time_schedule_begin property

  • :time_schedule_end (DateTime)

    The value to assign to the #time_schedule_end property

  • :schedule_type (String)

    The value to assign to the #schedule_type property

  • :connection_key (String)

    The value to assign to the #connection_key property

  • :job_definition_key (String)

    The value to assign to the #job_definition_key property

  • :internal_version (String)

    The value to assign to the #internal_version property

  • :execution_count (Integer)

    The value to assign to the #execution_count property

  • :time_of_latest_execution (DateTime)

    The value to assign to the #time_of_latest_execution property

  • :created_by_id (String)

    The value to assign to the #created_by_id property

  • :updated_by_id (String)

    The value to assign to the #updated_by_id property

  • :uri (String)

    The value to assign to the #uri property



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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
# File 'lib/oci/data_catalog/models/job.rb', line 185

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

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

  self.catalog_id = attributes[:'catalogId'] if attributes[:'catalogId']

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

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

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

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

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

  self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated']

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

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

  self.job_type = attributes[:'jobType'] if attributes[:'jobType']

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

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

  self.schedule_cron_expression = attributes[:'scheduleCronExpression'] if attributes[:'scheduleCronExpression']

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

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

  self.time_schedule_begin = attributes[:'timeScheduleBegin'] if attributes[:'timeScheduleBegin']

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

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

  self.time_schedule_end = attributes[:'timeScheduleEnd'] if attributes[:'timeScheduleEnd']

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

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

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

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

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

  self.job_definition_key = attributes[:'jobDefinitionKey'] if attributes[:'jobDefinitionKey']

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

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

  self.internal_version = attributes[:'internalVersion'] if attributes[:'internalVersion']

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

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

  self.execution_count = attributes[:'executionCount'] if attributes[:'executionCount']

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

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

  self.time_of_latest_execution = attributes[:'timeOfLatestExecution'] if attributes[:'timeOfLatestExecution']

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

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

  self.created_by_id = attributes[:'createdById'] if attributes[:'createdById']

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

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

  self.updated_by_id = attributes[:'updatedById'] if attributes[:'updatedById']

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

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

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

Instance Attribute Details

#catalog_idString

The data catalog's OCID.

Returns:

  • (String)


27
28
29
# File 'lib/oci/data_catalog/models/job.rb', line 27

def catalog_id
  @catalog_id
end

#connection_keyString

The key of the connection used by the job. This connection will override the default connection specified in the associated job definition. All executions will use this connection.

Returns:

  • (String)


70
71
72
# File 'lib/oci/data_catalog/models/job.rb', line 70

def connection_key
  @connection_key
end

#created_by_idString

OCID of the user who created this job.

Returns:

  • (String)


93
94
95
# File 'lib/oci/data_catalog/models/job.rb', line 93

def created_by_id
  @created_by_id
end

#descriptionString

Detailed description of the job.

Returns:

  • (String)


23
24
25
# File 'lib/oci/data_catalog/models/job.rb', line 23

def description
  @description
end

#display_nameString

A user-friendly display name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

Returns:

  • (String)


19
20
21
# File 'lib/oci/data_catalog/models/job.rb', line 19

def display_name
  @display_name
end

#execution_countInteger

The total number of executions for this job schedule.

Returns:

  • (Integer)


83
84
85
# File 'lib/oci/data_catalog/models/job.rb', line 83

def execution_count
  @execution_count
end

#internal_versionString

Internal version of the job resource.

Returns:

  • (String)


78
79
80
# File 'lib/oci/data_catalog/models/job.rb', line 78

def internal_version
  @internal_version
end

#job_definition_keyString

The unique key of the job definition resource that defined the scope of this job.

Returns:

  • (String)


74
75
76
# File 'lib/oci/data_catalog/models/job.rb', line 74

def job_definition_key
  @job_definition_key
end

#job_typeString

Type of the job.

Returns:

  • (String)


45
46
47
# File 'lib/oci/data_catalog/models/job.rb', line 45

def job_type
  @job_type
end

#keyString

[Required] Unique key of the job resource.

Returns:

  • (String)


13
14
15
# File 'lib/oci/data_catalog/models/job.rb', line 13

def key
  @key
end

#lifecycle_stateString

Lifecycle state for job.

Returns:

  • (String)


31
32
33
# File 'lib/oci/data_catalog/models/job.rb', line 31

def lifecycle_state
  @lifecycle_state
end

#schedule_cron_expressionString

Schedule specified in the cron expression format that has seven fields for second, minute, hour, day-of-month, month, day-of-week, year. It can also include special characters like * for all and ? for any. There are also pre-defined schedules that can be specified using special strings. For example, @hourly will run the job every hour.

Returns:

  • (String)


52
53
54
# File 'lib/oci/data_catalog/models/job.rb', line 52

def schedule_cron_expression
  @schedule_cron_expression
end

#schedule_typeString

Type of job schedule that is inferred from the scheduling properties.

Returns:

  • (String)


64
65
66
# File 'lib/oci/data_catalog/models/job.rb', line 64

def schedule_type
  @schedule_type
end

#time_createdDateTime

The date and time the job was created, in the format defined by RFC3339. Example: 2019-03-25T21:10:29.600Z

Returns:

  • (DateTime)


37
38
39
# File 'lib/oci/data_catalog/models/job.rb', line 37

def time_created
  @time_created
end

#time_of_latest_executionDateTime

The date and time of the most recent execution for this Job, in the format defined by RFC3339. Example: 2019-03-25T21:10:29.600Z

Returns:

  • (DateTime)


89
90
91
# File 'lib/oci/data_catalog/models/job.rb', line 89

def time_of_latest_execution
  @time_of_latest_execution
end

#time_schedule_beginDateTime

Date that the schedule should be operational. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


56
57
58
# File 'lib/oci/data_catalog/models/job.rb', line 56

def time_schedule_begin
  @time_schedule_begin
end

#time_schedule_endDateTime

Date that the schedule should end from being operational. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


60
61
62
# File 'lib/oci/data_catalog/models/job.rb', line 60

def time_schedule_end
  @time_schedule_end
end

#time_updatedDateTime

Time that this job was last updated. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


41
42
43
# File 'lib/oci/data_catalog/models/job.rb', line 41

def time_updated
  @time_updated
end

#updated_by_idString

OCID of the user who updated this job.

Returns:

  • (String)


97
98
99
# File 'lib/oci/data_catalog/models/job.rb', line 97

def updated_by_id
  @updated_by_id
end

#uriString

URI to the job instance in the API.

Returns:

  • (String)


101
102
103
# File 'lib/oci/data_catalog/models/job.rb', line 101

def uri
  @uri
end

Class Method Details

.attribute_mapObject

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



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
# File 'lib/oci/data_catalog/models/job.rb', line 104

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'key',
    'display_name': :'displayName',
    'description': :'description',
    'catalog_id': :'catalogId',
    'lifecycle_state': :'lifecycleState',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'job_type': :'jobType',
    'schedule_cron_expression': :'scheduleCronExpression',
    'time_schedule_begin': :'timeScheduleBegin',
    'time_schedule_end': :'timeScheduleEnd',
    'schedule_type': :'scheduleType',
    'connection_key': :'connectionKey',
    'job_definition_key': :'jobDefinitionKey',
    'internal_version': :'internalVersion',
    'execution_count': :'executionCount',
    'time_of_latest_execution': :'timeOfLatestExecution',
    'created_by_id': :'createdById',
    'updated_by_id': :'updatedById',
    'uri': :'uri'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/oci/data_catalog/models/job.rb', line 132

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'String',
    'display_name': :'String',
    'description': :'String',
    'catalog_id': :'String',
    'lifecycle_state': :'String',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'job_type': :'String',
    'schedule_cron_expression': :'String',
    'time_schedule_begin': :'DateTime',
    'time_schedule_end': :'DateTime',
    'schedule_type': :'String',
    'connection_key': :'String',
    'job_definition_key': :'String',
    'internal_version': :'String',
    'execution_count': :'Integer',
    'time_of_latest_execution': :'DateTime',
    'created_by_id': :'String',
    'updated_by_id': :'String',
    'uri': :'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



307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
# File 'lib/oci/data_catalog/models/job.rb', line 307

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

  self.class == other.class &&
    key == other.key &&
    display_name == other.display_name &&
    description == other.description &&
    catalog_id == other.catalog_id &&
    lifecycle_state == other.lifecycle_state &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    job_type == other.job_type &&
    schedule_cron_expression == other.schedule_cron_expression &&
    time_schedule_begin == other.time_schedule_begin &&
    time_schedule_end == other.time_schedule_end &&
    schedule_type == other.schedule_type &&
    connection_key == other.connection_key &&
    job_definition_key == other.job_definition_key &&
    internal_version == other.internal_version &&
    execution_count == other.execution_count &&
    time_of_latest_execution == other.time_of_latest_execution &&
    created_by_id == other.created_by_id &&
    updated_by_id == other.updated_by_id &&
    uri == other.uri
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



356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
# File 'lib/oci/data_catalog/models/job.rb', line 356

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


336
337
338
# File 'lib/oci/data_catalog/models/job.rb', line 336

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



345
346
347
# File 'lib/oci/data_catalog/models/job.rb', line 345

def hash
  [key, display_name, description, catalog_id, lifecycle_state, time_created, time_updated, job_type, schedule_cron_expression, time_schedule_begin, time_schedule_end, schedule_type, connection_key, job_definition_key, internal_version, execution_count, time_of_latest_execution, created_by_id, updated_by_id, uri].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



389
390
391
392
393
394
395
396
397
398
# File 'lib/oci/data_catalog/models/job.rb', line 389

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



383
384
385
# File 'lib/oci/data_catalog/models/job.rb', line 383

def to_s
  to_hash.to_s
end