Class: DatadogAPIClient::V2::SecurityMonitoringRuleQueryCreate

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog_api_client/v2/models/security_monitoring_rule_query_create.rb

Overview

Query for matching rule.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SecurityMonitoringRuleQueryCreate

Initializes the object

Parameters:

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

    attributes Model attributes in the form of hash



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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/datadog_api_client/v2/models/security_monitoring_rule_query_create.rb', line 84

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringRuleQueryCreate` 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.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::SecurityMonitoringRuleQueryCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

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

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

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

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

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

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

Instance Attribute Details

#aggregationObject

Returns the value of attribute aggregation.



26
27
28
# File 'lib/datadog_api_client/v2/models/security_monitoring_rule_query_create.rb', line 26

def aggregation
  @aggregation
end

#distinct_fieldsObject

Field for which the cardinality is measured. Sent as an array.



29
30
31
# File 'lib/datadog_api_client/v2/models/security_monitoring_rule_query_create.rb', line 29

def distinct_fields
  @distinct_fields
end

#group_by_fieldsObject

Fields to group by.



32
33
34
# File 'lib/datadog_api_client/v2/models/security_monitoring_rule_query_create.rb', line 32

def group_by_fields
  @group_by_fields
end

#metricObject

The target field to aggregate over when using the sum or max aggregations.



35
36
37
# File 'lib/datadog_api_client/v2/models/security_monitoring_rule_query_create.rb', line 35

def metric
  @metric
end

#nameObject

Name of the query.



38
39
40
# File 'lib/datadog_api_client/v2/models/security_monitoring_rule_query_create.rb', line 38

def name
  @name
end

#queryObject

Query to run on logs.



41
42
43
# File 'lib/datadog_api_client/v2/models/security_monitoring_rule_query_create.rb', line 41

def query
  @query
end