Class: OCI::LogAnalytics::Models::AbstractCommandDescriptor

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/log_analytics/models/abstract_command_descriptor.rb

Overview

Generic command descriptor defining all attributes common to all querylanguage commands for parse output.

This class has direct subclasses. If you are using this class as input to a service operations then you should favor using a subclass over the base class

Constant Summary collapse

NAME_ENUM =
[
  NAME_COMMAND = 'COMMAND'.freeze,
  NAME_SEARCH = 'SEARCH'.freeze,
  NAME_STATS = 'STATS'.freeze,
  NAME_GEO_STATS = 'GEO_STATS'.freeze,
  NAME_TIME_STATS = 'TIME_STATS'.freeze,
  NAME_SORT = 'SORT'.freeze,
  NAME_FIELDS = 'FIELDS'.freeze,
  NAME_ADD_FIELDS = 'ADD_FIELDS'.freeze,
  NAME_LINK = 'LINK'.freeze,
  NAME_LINK_DETAILS = 'LINK_DETAILS'.freeze,
  NAME_CLUSTER = 'CLUSTER'.freeze,
  NAME_CLUSTER_DETAILS = 'CLUSTER_DETAILS'.freeze,
  NAME_CLUSTER_SPLIT = 'CLUSTER_SPLIT'.freeze,
  NAME_EVAL = 'EVAL'.freeze,
  NAME_EXTRACT = 'EXTRACT'.freeze,
  NAME_JSON_EXTRACT = 'JSON_EXTRACT'.freeze,
  NAME_XML_EXTRACT = 'XML_EXTRACT'.freeze,
  NAME_EVENT_STATS = 'EVENT_STATS'.freeze,
  NAME_BUCKET = 'BUCKET'.freeze,
  NAME_CLASSIFY = 'CLASSIFY'.freeze,
  NAME_TOP = 'TOP'.freeze,
  NAME_BOTTOM = 'BOTTOM'.freeze,
  NAME_HEAD = 'HEAD'.freeze,
  NAME_TAIL = 'TAIL'.freeze,
  NAME_FIELD_SUMMARY = 'FIELD_SUMMARY'.freeze,
  NAME_REGEX = 'REGEX'.freeze,
  NAME_RENAME = 'RENAME'.freeze,
  NAME_TIME_COMPARE = 'TIME_COMPARE'.freeze,
  NAME_WHERE = 'WHERE'.freeze,
  NAME_CLUSTER_COMPARE = 'CLUSTER_COMPARE'.freeze,
  NAME_DELETE = 'DELETE'.freeze,
  NAME_CREATETABLE = 'CREATETABLE'.freeze,
  NAME_SEQUENCE = 'SEQUENCE'.freeze,
  NAME_DELTA = 'DELTA'.freeze,
  NAME_DISTINCT = 'DISTINCT'.freeze,
  NAME_SEARCH_LOOKUP = 'SEARCH_LOOKUP'.freeze,
  NAME_LOOKUP = 'LOOKUP'.freeze,
  NAME_DEMO_MODE = 'DEMO_MODE'.freeze,
  NAME_MACRO = 'MACRO'.freeze,
  NAME_MODULE = 'MODULE'.freeze,
  NAME_MULTI_SEARCH = 'MULTI_SEARCH'.freeze,
  NAME_HIGHLIGHT = 'HIGHLIGHT'.freeze,
  NAME_HIGHLIGHT_ROWS = 'HIGHLIGHT_ROWS'.freeze,
  NAME_HIGHLIGHT_GROUPS = 'HIGHLIGHT_GROUPS'.freeze,
  NAME_CREATE_VIEW = 'CREATE_VIEW'.freeze,
  NAME_MAP = 'MAP'.freeze,
  NAME_NLP = 'NLP'.freeze,
  NAME_COMPARE = 'COMPARE'.freeze,
  NAME_ADD_INSIGHTS = 'ADD_INSIGHTS'.freeze,
  NAME_ANOMALY = 'ANOMALY'.freeze,
  NAME_DEDUP = 'DEDUP'.freeze,
  NAME_TIME_CLUSTER = 'TIME_CLUSTER'.freeze,
  NAME_FREQUENT = 'FREQUENT'.freeze,
  NAME_RARE = 'RARE'.freeze,
  NAME_OUTLIER = 'OUTLIER'.freeze,
  NAME_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AbstractCommandDescriptor

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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

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

  self.display_query_string = attributes[:'displayQueryString'] if attributes[:'displayQueryString']

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

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

  self.internal_query_string = attributes[:'internalQueryString'] if attributes[:'internalQueryString']

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

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

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

  self.referenced_fields = attributes[:'referencedFields'] if attributes[:'referencedFields']

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

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

  self.declared_fields = attributes[:'declaredFields'] if attributes[:'declaredFields']

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

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

  self.is_hidden = attributes[:'isHidden'] unless attributes[:'isHidden'].nil?

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

  self.is_hidden = attributes[:'is_hidden'] unless attributes[:'is_hidden'].nil?
end

Instance Attribute Details

#categoryString

querylanguage command designation for example; reporting vs filtering

Returns:

  • (String)


91
92
93
# File 'lib/oci/log_analytics/models/abstract_command_descriptor.rb', line 91

def category
  @category
end

#declared_fieldsArray<OCI::LogAnalytics::Models::AbstractField>

Fields declared in command fragment from user specified query string.



101
102
103
# File 'lib/oci/log_analytics/models/abstract_command_descriptor.rb', line 101

def declared_fields
  @declared_fields
end

#display_query_stringString

[Required] Command fragment display string from user specified query string formatted by query builder.

Returns:

  • (String)


81
82
83
# File 'lib/oci/log_analytics/models/abstract_command_descriptor.rb', line 81

def display_query_string
  @display_query_string
end

#internal_query_stringString

[Required] Command fragment internal string from user specified query string formatted by query builder.

Returns:

  • (String)


86
87
88
# File 'lib/oci/log_analytics/models/abstract_command_descriptor.rb', line 86

def internal_query_string
  @internal_query_string
end

#is_hiddenBOOLEAN

Field denoting if this is a hidden command that is not shown in the query string.

Returns:

  • (BOOLEAN)


106
107
108
# File 'lib/oci/log_analytics/models/abstract_command_descriptor.rb', line 106

def is_hidden
  @is_hidden
end

#nameString

[Required] Name of querylanguage command

Returns:

  • (String)


76
77
78
# File 'lib/oci/log_analytics/models/abstract_command_descriptor.rb', line 76

def name
  @name
end

#referenced_fieldsArray<OCI::LogAnalytics::Models::AbstractField>

Fields referenced in command fragment from user specified query string.



96
97
98
# File 'lib/oci/log_analytics/models/abstract_command_descriptor.rb', line 96

def referenced_fields
  @referenced_fields
end

Class Method Details

.attribute_mapObject

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



109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/oci/log_analytics/models/abstract_command_descriptor.rb', line 109

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'
    # rubocop:enable Style/SymbolLiteral
  }
end

.get_subtype(object_hash) ⇒ Object

Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.



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
195
196
197
198
199
200
201
202
203
204
# File 'lib/oci/log_analytics/models/abstract_command_descriptor.rb', line 143

def self.get_subtype(object_hash)
  type = object_hash[:'name'] # rubocop:disable Style/SymbolLiteral

  return 'OCI::LogAnalytics::Models::TopCommandDescriptor' if type == 'TOP'
  return 'OCI::LogAnalytics::Models::HighlightCommandDescriptor' if type == 'HIGHLIGHT'
  return 'OCI::LogAnalytics::Models::StatsCommandDescriptor' if type == 'STATS'
  return 'OCI::LogAnalytics::Models::TailCommandDescriptor' if type == 'TAIL'
  return 'OCI::LogAnalytics::Models::SequenceCommandDescriptor' if type == 'SEQUENCE'
  return 'OCI::LogAnalytics::Models::OutlierCommandDescriptor' if type == 'OUTLIER'
  return 'OCI::LogAnalytics::Models::DemoModeCommandDescriptor' if type == 'DEMO_MODE'
  return 'OCI::LogAnalytics::Models::FieldSummaryCommandDescriptor' if type == 'FIELD_SUMMARY'
  return 'OCI::LogAnalytics::Models::GeoStatsCommandDescriptor' if type == 'GEO_STATS'
  return 'OCI::LogAnalytics::Models::MapCommandDescriptor' if type == 'MAP'
  return 'OCI::LogAnalytics::Models::HighlightGroupsCommandDescriptor' if type == 'HIGHLIGHT_GROUPS'
  return 'OCI::LogAnalytics::Models::DedupCommandDescriptor' if type == 'DEDUP'
  return 'OCI::LogAnalytics::Models::TimeStatsCommandDescriptor' if type == 'TIME_STATS'
  return 'OCI::LogAnalytics::Models::ClusterCommandDescriptor' if type == 'CLUSTER'
  return 'OCI::LogAnalytics::Models::DeleteCommandDescriptor' if type == 'DELETE'
  return 'OCI::LogAnalytics::Models::SearchCommandDescriptor' if type == 'SEARCH'
  return 'OCI::LogAnalytics::Models::BucketCommandDescriptor' if type == 'BUCKET'
  return 'OCI::LogAnalytics::Models::RareCommandDescriptor' if type == 'RARE'
  return 'OCI::LogAnalytics::Models::AddInsightsCommandDescriptor' if type == 'ADD_INSIGHTS'
  return 'OCI::LogAnalytics::Models::LinkCommandDescriptor' if type == 'LINK'
  return 'OCI::LogAnalytics::Models::SortCommandDescriptor' if type == 'SORT'
  return 'OCI::LogAnalytics::Models::HighlightRowsCommandDescriptor' if type == 'HIGHLIGHT_ROWS'
  return 'OCI::LogAnalytics::Models::MacroCommandDescriptor' if type == 'MACRO'
  return 'OCI::LogAnalytics::Models::EvalCommandDescriptor' if type == 'EVAL'
  return 'OCI::LogAnalytics::Models::RenameCommandDescriptor' if type == 'RENAME'
  return 'OCI::LogAnalytics::Models::XmlExtractCommandDescriptor' if type == 'XML_EXTRACT'
  return 'OCI::LogAnalytics::Models::MultiSearchCommandDescriptor' if type == 'MULTI_SEARCH'
  return 'OCI::LogAnalytics::Models::CreateTableCommandDescriptor' if type == 'CREATETABLE'
  return 'OCI::LogAnalytics::Models::CompareCommandDescriptor' if type == 'COMPARE'
  return 'OCI::LogAnalytics::Models::TimeCompareCommandDescriptor' if type == 'TIME_COMPARE'
  return 'OCI::LogAnalytics::Models::ModuleCommandDescriptor' if type == 'MODULE'
  return 'OCI::LogAnalytics::Models::RegexCommandDescriptor' if type == 'REGEX'
  return 'OCI::LogAnalytics::Models::DeltaCommandDescriptor' if type == 'DELTA'
  return 'OCI::LogAnalytics::Models::LookupCommandDescriptor' if type == 'LOOKUP'
  return 'OCI::LogAnalytics::Models::JsonExtractCommandDescriptor' if type == 'JSON_EXTRACT'
  return 'OCI::LogAnalytics::Models::EventStatsCommandDescriptor' if type == 'EVENT_STATS'
  return 'OCI::LogAnalytics::Models::WhereCommandDescriptor' if type == 'WHERE'
  return 'OCI::LogAnalytics::Models::ClusterSplitCommandDescriptor' if type == 'CLUSTER_SPLIT'
  return 'OCI::LogAnalytics::Models::FrequentCommandDescriptor' if type == 'FREQUENT'
  return 'OCI::LogAnalytics::Models::ClusterDetailsCommandDescriptor' if type == 'CLUSTER_DETAILS'
  return 'OCI::LogAnalytics::Models::ClusterCompareCommandDescriptor' if type == 'CLUSTER_COMPARE'
  return 'OCI::LogAnalytics::Models::CommandDescriptor' if type == 'COMMAND'
  return 'OCI::LogAnalytics::Models::DistinctCommandDescriptor' if type == 'DISTINCT'
  return 'OCI::LogAnalytics::Models::ExtractCommandDescriptor' if type == 'EXTRACT'
  return 'OCI::LogAnalytics::Models::NlpCommandDescriptor' if type == 'NLP'
  return 'OCI::LogAnalytics::Models::BottomCommandDescriptor' if type == 'BOTTOM'
  return 'OCI::LogAnalytics::Models::FieldsCommandDescriptor' if type == 'FIELDS'
  return 'OCI::LogAnalytics::Models::AnomalyCommandDescriptor' if type == 'ANOMALY'
  return 'OCI::LogAnalytics::Models::ClassifyCommandDescriptor' if type == 'CLASSIFY'
  return 'OCI::LogAnalytics::Models::LinkDetailsCommandDescriptor' if type == 'LINK_DETAILS'
  return 'OCI::LogAnalytics::Models::SearchLookupCommandDescriptor' if type == 'SEARCH_LOOKUP'
  return 'OCI::LogAnalytics::Models::HeadCommandDescriptor' if type == 'HEAD'
  return 'OCI::LogAnalytics::Models::CreateViewCommandDescriptor' if type == 'CREATE_VIEW'
  return 'OCI::LogAnalytics::Models::TimeClusterCommandDescriptor' if type == 'TIME_CLUSTER'
  return 'OCI::LogAnalytics::Models::AddFieldsCommandDescriptor' if type == 'ADD_FIELDS'

  # TODO: Log a warning when the subtype is not found.
  'OCI::LogAnalytics::Models::AbstractCommandDescriptor'
end

.swagger_typesObject

Attribute type mapping.



124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/oci/log_analytics/models/abstract_command_descriptor.rb', line 124

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'
    # 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



281
282
283
284
285
286
287
288
289
290
291
292
# File 'lib/oci/log_analytics/models/abstract_command_descriptor.rb', line 281

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
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



317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
# File 'lib/oci/log_analytics/models/abstract_command_descriptor.rb', line 317

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


297
298
299
# File 'lib/oci/log_analytics/models/abstract_command_descriptor.rb', line 297

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



306
307
308
# File 'lib/oci/log_analytics/models/abstract_command_descriptor.rb', line 306

def hash
  [name, display_query_string, internal_query_string, category, referenced_fields, declared_fields, is_hidden].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



350
351
352
353
354
355
356
357
358
359
# File 'lib/oci/log_analytics/models/abstract_command_descriptor.rb', line 350

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



344
345
346
# File 'lib/oci/log_analytics/models/abstract_command_descriptor.rb', line 344

def to_s
  to_hash.to_s
end