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, #is_hidden, #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):



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

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)


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

def baseline_query
  @baseline_query
end

Option to calculate trends of each cluster if specified.

Returns:

  • (BOOLEAN)


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

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)


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

def span
  @span
end

#time_endInteger

End time to apply to base line query if specified.

Returns:

  • (Integer)


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

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)


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

def time_shift
  @time_shift
end

#time_startInteger

Start time to apply to base line query if specified.

Returns:

  • (Integer)


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

def time_start
  @time_start
end

Class Method Details

.attribute_mapObject

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



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

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',
    'is_hidden': :'isHidden',
    '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.



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

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>',
    'is_hidden': :'BOOLEAN',
    '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



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/oci/log_analytics/models/cluster_compare_command_descriptor.rb', line 155

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 &&
    is_hidden == other.is_hidden &&
    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



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

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


177
178
179
# File 'lib/oci/log_analytics/models/cluster_compare_command_descriptor.rb', line 177

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



186
187
188
# File 'lib/oci/log_analytics/models/cluster_compare_command_descriptor.rb', line 186

def hash
  [name, display_query_string, internal_query_string, category, referenced_fields, declared_fields, is_hidden, 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



230
231
232
233
234
235
236
237
238
239
# File 'lib/oci/log_analytics/models/cluster_compare_command_descriptor.rb', line 230

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



224
225
226
# File 'lib/oci/log_analytics/models/cluster_compare_command_descriptor.rb', line 224

def to_s
  to_hash.to_s
end