Class: OCI::Jms::Models::JfrAttachmentTarget

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/jms/models/jfr_attachment_target.rb

Overview

The target to collect JFR data. A target is a managed instance, with options to further limit to specific container and/or application and/or Java Runtime. When the applicationKey isn't specified, then all applications are selected. When the jreKey isn't specified, then all supported Java Runtime versions are selected. When the applicationInstallationKey isn't specified, then all application installations are selected. When the containerKey isn't specified, then all containers are selected. Keys applicationKey and applicationInstallationKey are mutually exclusive.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ JfrAttachmentTarget

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/oci/jms/models/jfr_attachment_target.rb', line 74

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

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

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

  self.application_key = attributes[:'applicationKey'] if attributes[:'applicationKey']

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

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

  self.application_installation_key = attributes[:'applicationInstallationKey'] if attributes[:'applicationInstallationKey']

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

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

  self.jre_key = attributes[:'jreKey'] if attributes[:'jreKey']

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

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

  self.container_key = attributes[:'containerKey'] if attributes[:'containerKey']

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

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

Instance Attribute Details

#application_installation_keyString

Unique key that identifies the application installation for JFR data collection.

Returns:

  • (String)


27
28
29
# File 'lib/oci/jms/models/jfr_attachment_target.rb', line 27

def application_installation_key
  @application_installation_key
end

#application_keyString

Unique key that identifies the application for JFR data collection.

Returns:

  • (String)


23
24
25
# File 'lib/oci/jms/models/jfr_attachment_target.rb', line 23

def application_key
  @application_key
end

#container_keyString

Unique key that identifies the container for JFR data collection.

Returns:

  • (String)


35
36
37
# File 'lib/oci/jms/models/jfr_attachment_target.rb', line 35

def container_key
  @container_key
end

#jre_keyString

Unique key that identify the JVM for JFR data collection.

Returns:

  • (String)


31
32
33
# File 'lib/oci/jms/models/jfr_attachment_target.rb', line 31

def jre_key
  @jre_key
end

#managed_instance_idString

[Required] OCID of the Managed Instance to collect JFR data.

Returns:

  • (String)


19
20
21
# File 'lib/oci/jms/models/jfr_attachment_target.rb', line 19

def managed_instance_id
  @managed_instance_id
end

Class Method Details

.attribute_mapObject

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



38
39
40
41
42
43
44
45
46
47
48
# File 'lib/oci/jms/models/jfr_attachment_target.rb', line 38

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'managed_instance_id': :'managedInstanceId',
    'application_key': :'applicationKey',
    'application_installation_key': :'applicationInstallationKey',
    'jre_key': :'jreKey',
    'container_key': :'containerKey'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



51
52
53
54
55
56
57
58
59
60
61
# File 'lib/oci/jms/models/jfr_attachment_target.rb', line 51

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'managed_instance_id': :'String',
    'application_key': :'String',
    'application_installation_key': :'String',
    'jre_key': :'String',
    'container_key': :'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



118
119
120
121
122
123
124
125
126
127
# File 'lib/oci/jms/models/jfr_attachment_target.rb', line 118

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

  self.class == other.class &&
    managed_instance_id == other.managed_instance_id &&
    application_key == other.application_key &&
    application_installation_key == other.application_installation_key &&
    jre_key == other.jre_key &&
    container_key == other.container_key
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



152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/oci/jms/models/jfr_attachment_target.rb', line 152

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


132
133
134
# File 'lib/oci/jms/models/jfr_attachment_target.rb', line 132

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



141
142
143
# File 'lib/oci/jms/models/jfr_attachment_target.rb', line 141

def hash
  [managed_instance_id, application_key, application_installation_key, jre_key, container_key].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



185
186
187
188
189
190
191
192
193
194
# File 'lib/oci/jms/models/jfr_attachment_target.rb', line 185

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



179
180
181
# File 'lib/oci/jms/models/jfr_attachment_target.rb', line 179

def to_s
  to_hash.to_s
end