Class: OCI::ApmSynthetics::Models::Worker

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/apm_synthetics/models/worker.rb

Overview

The information about an On-premise VP worker.

Constant Summary collapse

WORKER_TYPE_ENUM =
[
  WORKER_TYPE_DOCKER = 'DOCKER'.freeze,
  WORKER_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
STATUS_ENUM =
[
  STATUS_ENABLED = 'ENABLED'.freeze,
  STATUS_DISABLED = 'DISABLED'.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 = {}) ⇒ Worker

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
# File 'lib/oci/apm_synthetics/models/worker.rb', line 190

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

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

  self.runtime_id = attributes[:'runtime_id'] if attributes[:'runtime_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.name = attributes[:'name'] if attributes[:'name']

  self.opvp_id = attributes[:'opvpId'] if attributes[:'opvpId']

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

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

  self.opvp_name = attributes[:'opvpName'] if attributes[:'opvpName']

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

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

  self.version_details = attributes[:'versionDetails'] if attributes[:'versionDetails']

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

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

  self.configuration_details = attributes[:'configurationDetails'] if attributes[:'configurationDetails']

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

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

  self.worker_type = attributes[:'workerType'] if attributes[:'workerType']

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

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

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

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

  self.geo_info = attributes[:'geoInfo'] if attributes[:'geoInfo']

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

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

  self.monitor_list = attributes[:'monitorList'] if attributes[:'monitorList']

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

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

  self.identity_info = attributes[:'identityInfo'] if attributes[:'identityInfo']

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

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

  self.time_last_sync_up = attributes[:'timeLastSyncUp'] if attributes[:'timeLastSyncUp']

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

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

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

Instance Attribute Details

#configuration_detailsObject

Configuration details of the On-premise VP worker.

Returns:

  • (Object)


53
54
55
# File 'lib/oci/apm_synthetics/models/worker.rb', line 53

def configuration_details
  @configuration_details
end

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

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

Returns:

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


109
110
111
# File 'lib/oci/apm_synthetics/models/worker.rb', line 109

def defined_tags
  @defined_tags
end

#display_nameString

[Required] Unique On-premise VP worker name that cannot be edited. The name should not contain any confidential information.

Returns:

  • (String)


33
34
35
# File 'lib/oci/apm_synthetics/models/worker.rb', line 33

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: {\"bar-key\": \"value\"}

Returns:

  • (Hash<String, String>)


103
104
105
# File 'lib/oci/apm_synthetics/models/worker.rb', line 103

def freeform_tags
  @freeform_tags
end

#geo_infoString

Geographical information of the On-premise VP worker.

Returns:

  • (String)


69
70
71
# File 'lib/oci/apm_synthetics/models/worker.rb', line 69

def geo_info
  @geo_info
end

#idString

[Required] The OCID of the On-premise VP worker.

Returns:

  • (String)


25
26
27
# File 'lib/oci/apm_synthetics/models/worker.rb', line 25

def id
  @id
end

#identity_infoOCI::ApmSynthetics::Models::IdentityInfoDetails



76
77
78
# File 'lib/oci/apm_synthetics/models/worker.rb', line 76

def identity_info
  @identity_info
end

#monitor_listArray<OCI::ApmSynthetics::Models::WorkerMonitorList>

Monitors list assigned to the On-premise VP worker.



73
74
75
# File 'lib/oci/apm_synthetics/models/worker.rb', line 73

def monitor_list
  @monitor_list
end

#nameString

[Required] Unique permanent name of the On-premise VP worker. This is the same as the displayName.

Returns:

  • (String)


37
38
39
# File 'lib/oci/apm_synthetics/models/worker.rb', line 37

def name
  @name
end

#opvp_idString

[Required] The OCID of the On-premise vantage point.

Returns:

  • (String)


41
42
43
# File 'lib/oci/apm_synthetics/models/worker.rb', line 41

def opvp_id
  @opvp_id
end

#opvp_nameString

[Required] On-premise vantage point name.

Returns:

  • (String)


45
46
47
# File 'lib/oci/apm_synthetics/models/worker.rb', line 45

def opvp_name
  @opvp_name
end

#priorityInteger

[Required] Priority of the On-premise VP worker to schedule monitors.

Returns:

  • (Integer)


65
66
67
# File 'lib/oci/apm_synthetics/models/worker.rb', line 65

def priority
  @priority
end

#runtime_idString

[Required] The runtime assigned id of the On-premise VP worker.

Returns:

  • (String)


29
30
31
# File 'lib/oci/apm_synthetics/models/worker.rb', line 29

def runtime_id
  @runtime_id
end

#statusString

[Required] Enables or disables the On-premise VP worker.

Returns:

  • (String)


61
62
63
# File 'lib/oci/apm_synthetics/models/worker.rb', line 61

def status
  @status
end

#time_createdDateTime

The time the resource was created, expressed in RFC 3339 timestamp format. Example: 2020-02-12T22:47:12.613Z

Returns:

  • (DateTime)


90
91
92
# File 'lib/oci/apm_synthetics/models/worker.rb', line 90

def time_created
  @time_created
end

#time_last_sync_upDateTime

The time the resource was last synced, expressed in RFC 3339 timestamp format. Example: 2020-02-12T22:47:12.613Z

Returns:

  • (DateTime)


83
84
85
# File 'lib/oci/apm_synthetics/models/worker.rb', line 83

def time_last_sync_up
  @time_last_sync_up
end

#time_updatedDateTime

The time the resource was updated, expressed in RFC 3339 timestamp format. Example: 2020-02-13T22:47:12.613Z

Returns:

  • (DateTime)


97
98
99
# File 'lib/oci/apm_synthetics/models/worker.rb', line 97

def time_updated
  @time_updated
end

#version_detailsOCI::ApmSynthetics::Models::OnPremiseVpWorkerVersionDetails

This attribute is required.



49
50
51
# File 'lib/oci/apm_synthetics/models/worker.rb', line 49

def version_details
  @version_details
end

#worker_typeString

[Required] Type of the On-premise VP worker.

Returns:

  • (String)


57
58
59
# File 'lib/oci/apm_synthetics/models/worker.rb', line 57

def worker_type
  @worker_type
end

Class Method Details

.attribute_mapObject

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



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
# File 'lib/oci/apm_synthetics/models/worker.rb', line 112

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'runtime_id': :'runtimeId',
    'display_name': :'displayName',
    'name': :'name',
    'opvp_id': :'opvpId',
    'opvp_name': :'opvpName',
    'version_details': :'versionDetails',
    'configuration_details': :'configurationDetails',
    'worker_type': :'workerType',
    'status': :'status',
    'priority': :'priority',
    'geo_info': :'geoInfo',
    'monitor_list': :'monitorList',
    'identity_info': :'identityInfo',
    'time_last_sync_up': :'timeLastSyncUp',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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
# File 'lib/oci/apm_synthetics/models/worker.rb', line 139

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'runtime_id': :'String',
    'display_name': :'String',
    'name': :'String',
    'opvp_id': :'String',
    'opvp_name': :'String',
    'version_details': :'OCI::ApmSynthetics::Models::OnPremiseVpWorkerVersionDetails',
    'configuration_details': :'Object',
    'worker_type': :'String',
    'status': :'String',
    'priority': :'Integer',
    'geo_info': :'String',
    'monitor_list': :'Array<OCI::ApmSynthetics::Models::WorkerMonitorList>',
    'identity_info': :'OCI::ApmSynthetics::Models::IdentityInfoDetails',
    'time_last_sync_up': :'DateTime',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>'
    # 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



328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
# File 'lib/oci/apm_synthetics/models/worker.rb', line 328

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

  self.class == other.class &&
    id == other.id &&
    runtime_id == other.runtime_id &&
    display_name == other.display_name &&
    name == other.name &&
    opvp_id == other.opvp_id &&
    opvp_name == other.opvp_name &&
    version_details == other.version_details &&
    configuration_details == other.configuration_details &&
    worker_type == other.worker_type &&
    status == other.status &&
    priority == other.priority &&
    geo_info == other.geo_info &&
    monitor_list == other.monitor_list &&
    identity_info == other.identity_info &&
    time_last_sync_up == other.time_last_sync_up &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags
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



376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/oci/apm_synthetics/models/worker.rb', line 376

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


356
357
358
# File 'lib/oci/apm_synthetics/models/worker.rb', line 356

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



365
366
367
# File 'lib/oci/apm_synthetics/models/worker.rb', line 365

def hash
  [id, runtime_id, display_name, name, opvp_id, opvp_name, version_details, configuration_details, worker_type, status, priority, geo_info, monitor_list, identity_info, time_last_sync_up, time_created, time_updated, freeform_tags, defined_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



409
410
411
412
413
414
415
416
417
418
# File 'lib/oci/apm_synthetics/models/worker.rb', line 409

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



403
404
405
# File 'lib/oci/apm_synthetics/models/worker.rb', line 403

def to_s
  to_hash.to_s
end