Class: OCI::Batch::Models::ComputeTaskExecutionDetails

Inherits:
BatchTaskExecutionDetails show all
Defined in:
lib/oci/batch/models/compute_task_execution_details.rb

Overview

Execution details for a compute task.

Constant Summary

Constants inherited from BatchTaskExecutionDetails

BatchTaskExecutionDetails::TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from BatchTaskExecutionDetails

#type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BatchTaskExecutionDetails

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ ComputeTaskExecutionDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/oci/batch/models/compute_task_execution_details.rb', line 95

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

  attributes['type'] = 'COMPUTE_TASK_EXECUTION_DETAILS'

  super(attributes)

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

  self.execution_id = attributes[:'executionId'] if attributes[:'executionId']

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

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

  self.time_transitioned_to_waiting_dependencies = attributes[:'timeTransitionedToWaitingDependencies'] if attributes[:'timeTransitionedToWaitingDependencies']

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

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

  self.time_transitioned_to_waiting_queued = attributes[:'timeTransitionedToWaitingQueued'] if attributes[:'timeTransitionedToWaitingQueued']

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

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

  self.time_started = attributes[:'timeStarted'] if attributes[:'timeStarted']

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

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

  self.time_completed = attributes[:'timeCompleted'] if attributes[:'timeCompleted']

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

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

  self.fleet_shape = attributes[:'fleetShape'] if attributes[:'fleetShape']

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

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

  self.completion_lifecycle_state = attributes[:'completionLifecycleState'] if attributes[:'completionLifecycleState']

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

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

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

Instance Attribute Details

#completion_lifecycle_stateString

The terminal lifecycle state of the task for this execution. Valid values are: SUCCEEDED, NEEDS_ATTENTION, CANCELED, or FAILED.

Returns:

  • (String)


41
42
43
# File 'lib/oci/batch/models/compute_task_execution_details.rb', line 41

def completion_lifecycle_state
  @completion_lifecycle_state
end

#errorsArray<String>

List of error messages related to this task execution. Be aware that the maximum number of items returned may change in the future.

Returns:

  • (Array<String>)


45
46
47
# File 'lib/oci/batch/models/compute_task_execution_details.rb', line 45

def errors
  @errors
end

#execution_idString

A unique identifier for the task execution. Created as "taskId:taskVersion:runNumber".

Returns:

  • (String)


14
15
16
# File 'lib/oci/batch/models/compute_task_execution_details.rb', line 14

def execution_id
  @execution_id
end

#fleet_shapeOCI::Batch::Models::FleetShapeExecutionDetails



37
38
39
# File 'lib/oci/batch/models/compute_task_execution_details.rb', line 37

def fleet_shape
  @fleet_shape
end

#time_completedDateTime

The date and time when the lifecycleState changed to Succeeded, or Failed, in the format defined by RFC 3339. Example: 2016-08-25T21:10:29.600Z

Returns:

  • (DateTime)


34
35
36
# File 'lib/oci/batch/models/compute_task_execution_details.rb', line 34

def time_completed
  @time_completed
end

#time_startedDateTime

The date and time when the lifecycleState was changed to In_Progress, in the format defined by RFC 3339. Example: 2016-08-25T21:10:29.600Z

Returns:

  • (DateTime)


29
30
31
# File 'lib/oci/batch/models/compute_task_execution_details.rb', line 29

def time_started
  @time_started
end

#time_transitioned_to_waiting_dependenciesDateTime

The date and time when the lifecycleState was changed to Waiting, and it is waiting for its dependencies to run, in the format defined by RFC 3339. Example: 2016-08-25T21:10:29.600Z

Returns:

  • (DateTime)


19
20
21
# File 'lib/oci/batch/models/compute_task_execution_details.rb', line 19

def time_transitioned_to_waiting_dependencies
  @time_transitioned_to_waiting_dependencies
end

#time_transitioned_to_waiting_queuedDateTime

The date and time when the lifecycleState was changed to Waiting, and it is queued to be executed, in the format defined by RFC 3339. Example: 2016-08-25T21:10:29.600Z

Returns:

  • (DateTime)


24
25
26
# File 'lib/oci/batch/models/compute_task_execution_details.rb', line 24

def time_transitioned_to_waiting_queued
  @time_transitioned_to_waiting_queued
end

Class Method Details

.attribute_mapObject

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



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/oci/batch/models/compute_task_execution_details.rb', line 48

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'type',
    'execution_id': :'executionId',
    'time_transitioned_to_waiting_dependencies': :'timeTransitionedToWaitingDependencies',
    'time_transitioned_to_waiting_queued': :'timeTransitionedToWaitingQueued',
    'time_started': :'timeStarted',
    'time_completed': :'timeCompleted',
    'fleet_shape': :'fleetShape',
    'completion_lifecycle_state': :'completionLifecycleState',
    'errors': :'errors'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/oci/batch/models/compute_task_execution_details.rb', line 65

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'String',
    'execution_id': :'String',
    'time_transitioned_to_waiting_dependencies': :'DateTime',
    'time_transitioned_to_waiting_queued': :'DateTime',
    'time_started': :'DateTime',
    'time_completed': :'DateTime',
    'fleet_shape': :'OCI::Batch::Models::FleetShapeExecutionDetails',
    'completion_lifecycle_state': :'String',
    'errors': :'Array<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



157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/oci/batch/models/compute_task_execution_details.rb', line 157

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

  self.class == other.class &&
    type == other.type &&
    execution_id == other.execution_id &&
    time_transitioned_to_waiting_dependencies == other.time_transitioned_to_waiting_dependencies &&
    time_transitioned_to_waiting_queued == other.time_transitioned_to_waiting_queued &&
    time_started == other.time_started &&
    time_completed == other.time_completed &&
    fleet_shape == other.fleet_shape &&
    completion_lifecycle_state == other.completion_lifecycle_state &&
    errors == other.errors
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



195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/oci/batch/models/compute_task_execution_details.rb', line 195

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


175
176
177
# File 'lib/oci/batch/models/compute_task_execution_details.rb', line 175

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



184
185
186
# File 'lib/oci/batch/models/compute_task_execution_details.rb', line 184

def hash
  [type, execution_id, time_transitioned_to_waiting_dependencies, time_transitioned_to_waiting_queued, time_started, time_completed, fleet_shape, completion_lifecycle_state, errors].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



228
229
230
231
232
233
234
235
236
237
# File 'lib/oci/batch/models/compute_task_execution_details.rb', line 228

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



222
223
224
# File 'lib/oci/batch/models/compute_task_execution_details.rb', line 222

def to_s
  to_hash.to_s
end