Class: OCI::DisasterRecovery::Models::DrPlanGroupExecution

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/disaster_recovery/models/dr_plan_group_execution.rb

Overview

The details of a group execution in a DR plan execution.

Constant Summary collapse

TYPE_ENUM =
[
  TYPE_USER_DEFINED = 'USER_DEFINED'.freeze,
  TYPE_BUILT_IN = 'BUILT_IN'.freeze,
  TYPE_BUILT_IN_PRECHECK = 'BUILT_IN_PRECHECK'.freeze,
  TYPE_USER_DEFINED_PAUSE = 'USER_DEFINED_PAUSE'.freeze,
  TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
STATUS_ENUM =
[
  STATUS_QUEUED = 'QUEUED'.freeze,
  STATUS_DISABLED = 'DISABLED'.freeze,
  STATUS_IN_PROGRESS = 'IN_PROGRESS'.freeze,
  STATUS_SUCCEEDED = 'SUCCEEDED'.freeze,
  STATUS_SUCCEEDED_WITH_WARNING = 'SUCCEEDED_WITH_WARNING'.freeze,
  STATUS_FAILED = 'FAILED'.freeze,
  STATUS_FAILED_IGNORED = 'FAILED_IGNORED'.freeze,
  STATUS_TIMED_OUT = 'TIMED_OUT'.freeze,
  STATUS_TIMED_OUT_IGNORED = 'TIMED_OUT_IGNORED'.freeze,
  STATUS_PAUSED = 'PAUSED'.freeze,
  STATUS_CANCELED = 'CANCELED'.freeze,
  STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DrPlanGroupExecution

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
# File 'lib/oci/disaster_recovery/models/dr_plan_group_execution.rb', line 143

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

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

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

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

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

  self.status_details = attributes[:'statusDetails'] if attributes[:'statusDetails']

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

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

  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_ended = attributes[:'timeEnded'] if attributes[:'timeEnded']

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

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

  self.execution_duration_in_sec = attributes[:'executionDurationInSec'] if attributes[:'executionDurationInSec']

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

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

  self.step_executions = attributes[:'stepExecutions'] if attributes[:'stepExecutions']

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

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

Instance Attribute Details

#display_nameString

[Required] The display name of the group execution.

Example: DATABASE_SWITCHOVER

Returns:

  • (String)


54
55
56
# File 'lib/oci/disaster_recovery/models/dr_plan_group_execution.rb', line 54

def display_name
  @display_name
end

#execution_duration_in_secInteger

The total duration in seconds taken to complete group execution.

Example: 120

Returns:

  • (Integer)


87
88
89
# File 'lib/oci/disaster_recovery/models/dr_plan_group_execution.rb', line 87

def execution_duration_in_sec
  @execution_duration_in_sec
end

#group_idString

[Required] The unique id of the group. Must not be modified by user.

Example: sgid1.group..uniqueID

Returns:

  • (String)


40
41
42
# File 'lib/oci/disaster_recovery/models/dr_plan_group_execution.rb', line 40

def group_id
  @group_id
end

#statusString

[Required] The status of the group execution.

Returns:

  • (String)


59
60
61
# File 'lib/oci/disaster_recovery/models/dr_plan_group_execution.rb', line 59

def status
  @status
end

#status_detailsString

Additional details on the group execution status.

Example: A total of [3] steps failed in the group

Returns:

  • (String)


66
67
68
# File 'lib/oci/disaster_recovery/models/dr_plan_group_execution.rb', line 66

def status_details
  @status_details
end

#step_executionsArray<OCI::DisasterRecovery::Models::DrPlanStepExecution>

[Required] A list of step executions in the group.



92
93
94
# File 'lib/oci/disaster_recovery/models/dr_plan_group_execution.rb', line 92

def step_executions
  @step_executions
end

#time_endedDateTime

The time when group execution ended. An RFC3339 formatted datetime string.

Example: 2019-03-29T09:36:42Z

Returns:

  • (DateTime)


80
81
82
# File 'lib/oci/disaster_recovery/models/dr_plan_group_execution.rb', line 80

def time_ended
  @time_ended
end

#time_startedDateTime

The time when group execution began. An RFC3339 formatted datetime string.

Example: 2019-03-29T09:36:42Z

Returns:

  • (DateTime)


73
74
75
# File 'lib/oci/disaster_recovery/models/dr_plan_group_execution.rb', line 73

def time_started
  @time_started
end

#typeString

[Required] The group type.

Example: BUILT_IN

Returns:

  • (String)


47
48
49
# File 'lib/oci/disaster_recovery/models/dr_plan_group_execution.rb', line 47

def type
  @type
end

Class Method Details

.attribute_mapObject

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



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/oci/disaster_recovery/models/dr_plan_group_execution.rb', line 95

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'group_id': :'groupId',
    'type': :'type',
    'display_name': :'displayName',
    'status': :'status',
    'status_details': :'statusDetails',
    'time_started': :'timeStarted',
    'time_ended': :'timeEnded',
    'execution_duration_in_sec': :'executionDurationInSec',
    'step_executions': :'stepExecutions'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/oci/disaster_recovery/models/dr_plan_group_execution.rb', line 112

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'group_id': :'String',
    'type': :'String',
    'display_name': :'String',
    'status': :'String',
    'status_details': :'String',
    'time_started': :'DateTime',
    'time_ended': :'DateTime',
    'execution_duration_in_sec': :'Integer',
    'step_executions': :'Array<OCI::DisasterRecovery::Models::DrPlanStepExecution>'
    # 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



229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/oci/disaster_recovery/models/dr_plan_group_execution.rb', line 229

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

  self.class == other.class &&
    group_id == other.group_id &&
    type == other.type &&
    display_name == other.display_name &&
    status == other.status &&
    status_details == other.status_details &&
    time_started == other.time_started &&
    time_ended == other.time_ended &&
    execution_duration_in_sec == other.execution_duration_in_sec &&
    step_executions == other.step_executions
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



267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# File 'lib/oci/disaster_recovery/models/dr_plan_group_execution.rb', line 267

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


247
248
249
# File 'lib/oci/disaster_recovery/models/dr_plan_group_execution.rb', line 247

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



256
257
258
# File 'lib/oci/disaster_recovery/models/dr_plan_group_execution.rb', line 256

def hash
  [group_id, type, display_name, status, status_details, time_started, time_ended, execution_duration_in_sec, step_executions].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



300
301
302
303
304
305
306
307
308
309
# File 'lib/oci/disaster_recovery/models/dr_plan_group_execution.rb', line 300

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



294
295
296
# File 'lib/oci/disaster_recovery/models/dr_plan_group_execution.rb', line 294

def to_s
  to_hash.to_s
end