Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.2",
"regenerated": "2022-07-19 16:28:25.621288",
"spec_repo_commit": "448d6aae"
"regenerated": "2022-07-20 11:53:28.416228",
"spec_repo_commit": "a82be8f8"
},
"v2": {
"apigentools_version": "1.6.2",
"regenerated": "2022-07-19 16:28:25.640110",
"spec_repo_commit": "448d6aae"
"regenerated": "2022-07-20 11:53:28.429749",
"spec_repo_commit": "a82be8f8"
}
}
}
14 changes: 14 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6669,6 +6669,13 @@ components:

aggregations.'
type: string
metrics:
description: Group of target fields to aggregate over when using the new
value aggregations.
items:
description: Field.
type: string
type: array
name:
description: Name of the query.
type: string
Expand Down Expand Up @@ -6715,6 +6722,13 @@ components:

aggregations.'
type: string
metrics:
description: Group of target fields to aggregate over when using the new
value aggregations.
items:
description: Field.
type: string
type: array
name:
description: Name of the query.
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
aggregation: DatadogAPIClient::V2::SecurityMonitoringRuleQueryAggregation::COUNT,
distinct_fields: [],
group_by_fields: [],
metrics: [],
}),
],
tags: [],
Expand Down
6 changes: 3 additions & 3 deletions features/v2/security_monitoring.feature
Original file line number Diff line number Diff line change
Expand Up @@ -298,22 +298,22 @@ Feature: Security Monitoring
Scenario: Update an existing rule returns "Bad Request" response
Given new "UpdateSecurityMonitoringRule" request
And request contains "rule_id" parameter from "REPLACE.ME"
And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"decreaseCriticalityBasedOnEnv": false, "detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0, "learningMethod": "duration", "learningThreshold": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": []}], "tags": [], "version": 1}
And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"decreaseCriticalityBasedOnEnv": false, "detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0, "learningMethod": "duration", "learningThreshold": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": [], "metrics": []}], "tags": [], "version": 1}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/k9-cloud-security-platform
Scenario: Update an existing rule returns "Not Found" response
Given new "UpdateSecurityMonitoringRule" request
And request contains "rule_id" parameter from "REPLACE.ME"
And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"decreaseCriticalityBasedOnEnv": false, "detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0, "learningMethod": "duration", "learningThreshold": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": []}], "tags": [], "version": 1}
And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"decreaseCriticalityBasedOnEnv": false, "detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0, "learningMethod": "duration", "learningThreshold": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": [], "metrics": []}], "tags": [], "version": 1}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/k9-cloud-security-platform
Scenario: Update an existing rule returns "OK" response
Given new "UpdateSecurityMonitoringRule" request
And request contains "rule_id" parameter from "REPLACE.ME"
And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"decreaseCriticalityBasedOnEnv": false, "detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0, "learningMethod": "duration", "learningThreshold": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": []}], "tags": [], "version": 1}
And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"decreaseCriticalityBasedOnEnv": false, "detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0, "learningMethod": "duration", "learningThreshold": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": [], "metrics": []}], "tags": [], "version": 1}
When the request is sent
Then the response status is 200 OK
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ class SecurityMonitoringRuleQuery
# aggregations.
attr_accessor :metric

# Group of target fields to aggregate over when using the new value aggregations.
attr_accessor :metrics

# Name of the query.
attr_accessor :name

Expand All @@ -52,6 +55,7 @@ def self.attribute_map
:'distinct_fields' => :'distinctFields',
:'group_by_fields' => :'groupByFields',
:'metric' => :'metric',
:'metrics' => :'metrics',
:'name' => :'name',
:'query' => :'query'
}
Expand All @@ -71,6 +75,7 @@ def self.openapi_types
:'distinct_fields' => :'Array<String>',
:'group_by_fields' => :'Array<String>',
:'metric' => :'String',
:'metrics' => :'Array<String>',
:'name' => :'String',
:'query' => :'String'
}
Expand Down Expand Up @@ -119,6 +124,12 @@ def initialize(attributes = {})
self.metric = attributes[:'metric']
end

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

if attributes.key?(:'name')
self.name = attributes[:'name']
end
Expand All @@ -145,6 +156,7 @@ def ==(o)
distinct_fields == o.distinct_fields &&
group_by_fields == o.group_by_fields &&
metric == o.metric &&
metrics == o.metrics &&
name == o.name &&
query == o.query
end
Expand All @@ -160,7 +172,7 @@ def eql?(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[aggregation, distinct_fields, group_by_fields, metric, name, query].hash
[aggregation, distinct_fields, group_by_fields, metric, metrics, name, query].hash
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ class SecurityMonitoringRuleQueryCreate
# aggregations.
attr_accessor :metric

# Group of target fields to aggregate over when using the new value aggregations.
attr_accessor :metrics

# Name of the query.
attr_accessor :name

Expand All @@ -52,6 +55,7 @@ def self.attribute_map
:'distinct_fields' => :'distinctFields',
:'group_by_fields' => :'groupByFields',
:'metric' => :'metric',
:'metrics' => :'metrics',
:'name' => :'name',
:'query' => :'query'
}
Expand All @@ -71,6 +75,7 @@ def self.openapi_types
:'distinct_fields' => :'Array<String>',
:'group_by_fields' => :'Array<String>',
:'metric' => :'String',
:'metrics' => :'Array<String>',
:'name' => :'String',
:'query' => :'String'
}
Expand Down Expand Up @@ -119,6 +124,12 @@ def initialize(attributes = {})
self.metric = attributes[:'metric']
end

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

if attributes.key?(:'name')
self.name = attributes[:'name']
end
Expand Down Expand Up @@ -156,6 +167,7 @@ def ==(o)
distinct_fields == o.distinct_fields &&
group_by_fields == o.group_by_fields &&
metric == o.metric &&
metrics == o.metrics &&
name == o.name &&
query == o.query
end
Expand All @@ -171,7 +183,7 @@ def eql?(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[aggregation, distinct_fields, group_by_fields, metric, name, query].hash
[aggregation, distinct_fields, group_by_fields, metric, metrics, name, query].hash
end
end
end