Class: IntersightClient::TelemetryDruidScanRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/intersight_client/models/telemetry_druid_scan_request.rb

Overview

The Scan query returns raw Apache Druid rows in streaming mode. In addition to straightforward usage where a Scan query is issued to the Broker, the Scan query can also be issued directly to Historical processes or streaming ingestion tasks. This can be useful if you want to retrieve large amounts of data in parallel.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TelemetryDruidScanRequest

Initializes the object



131
132
133
134
135
136
137
138
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
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
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 131

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `IntersightClient::TelemetryDruidScanRequest` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `#{self.class.name}`. Please check the name to make sure it's valid. List of attributes: " + self.class.acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'query_type')
    self.query_type = attributes[:'query_type']
  end

  if attributes.key?(:'data_source')
    self.data_source = attributes[:'data_source']
  end

  if attributes.key?(:'intervals')
    if (value = attributes[:'intervals']).is_a?(Array)
      self.intervals = value
    end
  end

  if attributes.key?(:'result_format')
    self.result_format = attributes[:'result_format']
  else
    self.result_format = 'list'
  end

  if attributes.key?(:'filter')
    self.filter = attributes[:'filter']
  end

  if attributes.key?(:'columns')
    if (value = attributes[:'columns']).is_a?(Array)
      self.columns = value
    end
  end

  if attributes.key?(:'batch_size')
    self.batch_size = attributes[:'batch_size']
  else
    self.batch_size = 20480
  end

  if attributes.key?(:'limit')
    self.limit = attributes[:'limit']
  end

  if attributes.key?(:'order')
    self.order = attributes[:'order']
  else
    self.order = 'none'
  end

  if attributes.key?(:'legacy')
    self.legacy = attributes[:'legacy']
  else
    self.legacy = false
  end

  if attributes.key?(:'context')
    self.context = attributes[:'context']
  end
end

Instance Attribute Details

#batch_sizeObject

The maximum number of rows buffered before being returned to the client.



36
37
38
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 36

def batch_size
  @batch_size
end

#columnsObject

A String array of dimensions and metrics to scan. If left empty, all dimensions and metrics are returned.



33
34
35
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 33

def columns
  @columns
end

#contextObject

Returns the value of attribute context.



47
48
49
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 47

def context
  @context
end

#data_sourceObject

Returns the value of attribute data_source.



22
23
24
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 22

def data_source
  @data_source
end

#filterObject

Returns the value of attribute filter.



30
31
32
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 30

def filter
  @filter
end

#intervalsObject

A JSON Object representing ISO-8601 Intervals. This defines the time ranges to run the query over.



25
26
27
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 25

def intervals
  @intervals
end

#legacyObject

Return results consistent with the legacy "scan-query" contrib extension. Defaults to the value set by druid.query.scan.legacy, which in turn defaults to false.



45
46
47
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 45

def legacy
  @legacy
end

#limitObject

How many rows to return. If not specified, all rows will be returned.



39
40
41
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 39

def limit
  @limit
end

#orderObject

The ordering of returned rows based on timestamp. "ascending", "descending", and "none" (default) are supported. Currently, "ascending" and "descending" are only supported for queries where the __time column is included in the columns field and the requirements outlined in the time ordering section are met.



42
43
44
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 42

def order
  @order
end

#query_typeObject

null



20
21
22
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 20

def query_type
  @query_type
end

#result_formatObject

How the results are represented, list, compactedList or valueVector. Currently only list is supported.



28
29
30
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 28

def result_format
  @result_format
end

Class Method Details

.acceptable_attribute_mapObject

Returns the key-value map of all the JSON attributes this model knows about



94
95
96
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 94

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



89
90
91
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 89

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 72

def self.attribute_map
  {
    :'query_type' => :'queryType',
    :'data_source' => :'dataSource',
    :'intervals' => :'intervals',
    :'result_format' => :'resultFormat',
    :'filter' => :'filter',
    :'columns' => :'columns',
    :'batch_size' => :'batchSize',
    :'limit' => :'limit',
    :'order' => :'order',
    :'legacy' => :'legacy',
    :'context' => :'context'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash



298
299
300
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 298

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_all_ofObject

List of class defined in allOf (OpenAPI v3)



122
123
124
125
126
127
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 122

def self.openapi_all_of
  [
  :'TelemetryDruidBaseRequest',
  :'TelemetryDruidScanRequestAllOf'
  ]
end

.openapi_nullableObject

List of attributes with nullable: true



116
117
118
119
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 116

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 99

def self.openapi_types
  {
    :'query_type' => :'String',
    :'data_source' => :'TelemetryDruidDataSource',
    :'intervals' => :'Array<String>',
    :'result_format' => :'String',
    :'filter' => :'TelemetryDruidFilter',
    :'columns' => :'Array<String>',
    :'batch_size' => :'Integer',
    :'limit' => :'Integer',
    :'order' => :'String',
    :'legacy' => :'Boolean',
    :'context' => :'TelemetryDruidQueryContext'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.



267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 267

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      query_type == o.query_type &&
      data_source == o.data_source &&
      intervals == o.intervals &&
      result_format == o.result_format &&
      filter == o.filter &&
      columns == o.columns &&
      batch_size == o.batch_size &&
      limit == o.limit &&
      order == o.order &&
      legacy == o.legacy &&
      context == o.context
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type



328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 328

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = IntersightClient.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value



399
400
401
402
403
404
405
406
407
408
409
410
411
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 399

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash



305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 305

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  TelemetryDruidScanRequest.openapi_types.each_pair do |key, type|
    if attributes[TelemetryDruidScanRequest.attribute_map[key]].nil? && TelemetryDruidScanRequest.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[TelemetryDruidScanRequest.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[TelemetryDruidScanRequest.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[TelemetryDruidScanRequest.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[TelemetryDruidScanRequest.attribute_map[key]]))
    end
  end

  self
end

#eql?(o) ⇒ Boolean

See Also:

  • `==` method


285
286
287
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 285

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.



291
292
293
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 291

def hash
  [query_type, data_source, intervals, result_format, filter, columns, batch_size, limit, order, legacy, context].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?



203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 203

def list_invalid_properties
  invalid_properties = Array.new
  if @query_type.nil?
    invalid_properties.push('invalid value for "query_type", query_type cannot be nil.')
  end

  if @data_source.nil?
    invalid_properties.push('invalid value for "data_source", data_source cannot be nil.')
  end

  if @intervals.nil?
    invalid_properties.push('invalid value for "intervals", intervals cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)



375
376
377
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 375

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash



381
382
383
384
385
386
387
388
389
390
391
392
393
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 381

def to_hash
  hash = {}
  TelemetryDruidScanRequest.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = TelemetryDruidScanRequest.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object



369
370
371
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 369

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid



222
223
224
225
226
227
228
229
230
231
232
233
# File 'lib/intersight_client/models/telemetry_druid_scan_request.rb', line 222

def valid?
  return false if @query_type.nil?
  query_type_validator = EnumAttributeValidator.new('String', ["timeseries", "topN", "groupBy", "scan", "timeBoundary", "segmentMetadata", "dataSourceMetadata", "search"])
  return false unless query_type_validator.valid?(@query_type)
  return false if @data_source.nil?
  return false if @intervals.nil?
  result_format_validator = EnumAttributeValidator.new('String', ["list"])
  return false unless result_format_validator.valid?(@result_format)
  order_validator = EnumAttributeValidator.new('String', ["none", "ascending", "descending"])
  return false unless order_validator.valid?(@order)
  true
end