Class: OCI::LogAnalytics::Models::ClusterCompareCommandDescriptor

Inherits:
AbstractCommandDescriptor show all
Defined in:
lib/oci/log_analytics/models/cluster_compare_command_descriptor.rb

Overview

Command descriptor for querylanguage CLUSTERCOMPARE command.

Constant Summary

Constants inherited from AbstractCommandDescriptor

AbstractCommandDescriptor::NAME_ENUM

Instance Attribute Summary collapse

Attributes inherited from AbstractCommandDescriptor

#category, #declared_fields, #display_query_string, #internal_query_string, #name, #referenced_fields

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractCommandDescriptor

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ ClusterCompareCommandDescriptor

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
# File 'lib/oci/log_analytics/models/cluster_compare_command_descriptor.rb', line 99

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

  attributes['name'] = 'CLUSTER_COMPARE'

  super(attributes)

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

  self.time_shift = attributes[:'timeShift'] if attributes[:'timeShift']

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

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

  self.time_start = attributes[:'timeStart'] if attributes[:'timeStart']

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

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

  self.time_end = attributes[:'timeEnd'] if attributes[:'timeEnd']

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

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

  self.should_include_trends = attributes[:'shouldIncludeTrends'] unless attributes[:'shouldIncludeTrends'].nil?
  self.should_include_trends = false if should_include_trends.nil? && !attributes.key?(:'shouldIncludeTrends') # rubocop:disable Style/StringLiterals

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

  self.should_include_trends = attributes[:'should_include_trends'] unless attributes[:'should_include_trends'].nil?
  self.should_include_trends = false if should_include_trends.nil? && !attributes.key?(:'shouldIncludeTrends') && !attributes.key?(:'should_include_trends') # rubocop:disable Style/StringLiterals

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

  self.baseline_query = attributes[:'baselineQuery'] if attributes[:'baselineQuery']

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

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

Instance Attribute Details

#baseline_queryString

Query to use to compute base line to compare top level query results against to identify differences if specified.

Returns:

  • (String)


40
41
42
# File 'lib/oci/log_analytics/models/cluster_compare_command_descriptor.rb', line 40

def baseline_query
  @baseline_query
end

Option to calculate trends of each cluster if specified.

Returns:

  • (BOOLEAN)


30
31
32
# File 'lib/oci/log_analytics/models/cluster_compare_command_descriptor.rb', line 30

def should_include_trends
  @should_include_trends
end

#spanString

Option to control the size of buckets in the histogram e.g 8hrs - each bar other than first and last should represent 8hr time span. Will be adjusted to a larger span if time range is very large.

Returns:

  • (String)


35
36
37
# File 'lib/oci/log_analytics/models/cluster_compare_command_descriptor.rb', line 35

def span
  @span
end

#time_endInteger

End time to apply to base line query if specified.

Returns:

  • (Integer)


25
26
27
# File 'lib/oci/log_analytics/models/cluster_compare_command_descriptor.rb', line 25

def time_end
  @time_end
end

#time_shiftString

To shift time range of main query backwards using a relative time expression e.g -24hrs. E.g compare against the previous 24 hrs.

Returns:

  • (String)


15
16
17
# File 'lib/oci/log_analytics/models/cluster_compare_command_descriptor.rb', line 15

def time_shift
  @time_shift
end

#time_startInteger

Start time to apply to base line query if specified.

Returns:

  • (Integer)


20
21
22
# File 'lib/oci/log_analytics/models/cluster_compare_command_descriptor.rb', line 20

def time_start
  @time_start
end

Class Method Details

.attribute_mapObject

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



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/oci/log_analytics/models/cluster_compare_command_descriptor.rb', line 43

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'name',
    'display_query_string': :'displayQueryString',
    'internal_query_string': :'internalQueryString',
    'category': :'category',
    'referenced_fields': :'referencedFields',
    'declared_fields': :'declaredFields',
    'time_shift': :'timeShift',
    'time_start': :'timeStart',
    'time_end': :'timeEnd',
    'should_include_trends': :'shouldIncludeTrends',
    'span': :'span',
    'baseline_query': :'baselineQuery'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/oci/log_analytics/models/cluster_compare_command_descriptor.rb', line 63

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'String',
    'display_query_string': :'String',
    'internal_query_string': :'String',
    'category': :'String',
    'referenced_fields': :'Array<OCI::LogAnalytics::Models::AbstractField>',
    'declared_fields': :'Array<OCI::LogAnalytics::Models::AbstractField>',
    'time_shift': :'String',
    'time_start': :'Integer',
    'time_end': :'Integer',
    'should_include_trends': :'BOOLEAN',
    'span': :'String',
    'baseline_query': :'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



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/oci/log_analytics/models/cluster_compare_command_descriptor.rb', line 151

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

  self.class == other.class &&
    name == other.name &&
    display_query_string == other.display_query_string &&
    internal_query_string == other.internal_query_string &&
    category == other.category &&
    referenced_fields == other.referenced_fields &&
    declared_fields == other.declared_fields &&
    time_shift == other.time_shift &&
    time_start == other.time_start &&
    time_end == other.time_end &&
    should_include_trends == other.should_include_trends &&
    span == other.span &&
    baseline_query == other.baseline_query
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



192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/oci/log_analytics/models/cluster_compare_command_descriptor.rb', line 192

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


172
173
174
# File 'lib/oci/log_analytics/models/cluster_compare_command_descriptor.rb', line 172

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



181
182
183
# File 'lib/oci/log_analytics/models/cluster_compare_command_descriptor.rb', line 181

def hash
  [name, display_query_string, internal_query_string, category, referenced_fields, declared_fields, time_shift, time_start, time_end, should_include_trends, span, baseline_query].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



225
226
227
228
229
230
231
232
233
234
# File 'lib/oci/log_analytics/models/cluster_compare_command_descriptor.rb', line 225

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



219
220
221
# File 'lib/oci/log_analytics/models/cluster_compare_command_descriptor.rb', line 219

def to_s
  to_hash.to_s
end