Skip to content

Commit 49dba87

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 7d6e091 of spec repo
1 parent 43c4577 commit 49dba87

11 files changed

Lines changed: 1278 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49518,6 +49518,7 @@ components:
4951849518
- third_party
4951949519
- anomaly_threshold
4952049520
- sequence_detection
49521+
example: threshold
4952149522
type: string
4952249523
x-enum-varnames:
4952349524
- THRESHOLD
@@ -49617,6 +49618,58 @@ components:
4961749618
- SIX_HOURS
4961849619
- TWELVE_HOURS
4961949620
- ONE_DAY
49621+
SecurityMonitoringRuleLivetailRequest:
49622+
description: Request to preview a rule query with applied filters.
49623+
properties:
49624+
dataSource:
49625+
description: Data source for the query.
49626+
example: logs
49627+
type: string
49628+
detectionMethod:
49629+
$ref: '#/components/schemas/SecurityMonitoringRuleDetectionMethod'
49630+
distinctFields:
49631+
description: Fields to apply distinct on.
49632+
items:
49633+
type: string
49634+
type: array
49635+
filters:
49636+
description: Additional security filters to apply.
49637+
items:
49638+
$ref: '#/components/schemas/SecurityMonitoringFilter'
49639+
type: array
49640+
groupByFields:
49641+
description: Fields to group by.
49642+
items:
49643+
type: string
49644+
type: array
49645+
query:
49646+
description: The query to preview.
49647+
example: source:java
49648+
type: string
49649+
queryIndex:
49650+
description: Index of the query in the rule.
49651+
example: 0
49652+
format: int32
49653+
maximum: 9
49654+
minimum: 0
49655+
type: integer
49656+
type:
49657+
$ref: '#/components/schemas/SecurityMonitoringRuleTypeRead'
49658+
required:
49659+
- query
49660+
- queryIndex
49661+
- type
49662+
- detectionMethod
49663+
- dataSource
49664+
type: object
49665+
SecurityMonitoringRuleLivetailResponse:
49666+
description: Response containing the modified query with applied filters.
49667+
properties:
49668+
query:
49669+
description: The modified query with all filters applied.
49670+
example: source:java (service:payment OR service:auth)
49671+
type: string
49672+
type: object
4962049673
SecurityMonitoringRuleMaxSignalDuration:
4962149674
description: 'A signal will "close" regardless of the query being matched once
4962249675
the time exceeds the maximum duration.
@@ -49962,6 +50015,7 @@ components:
4996250015
- cloud_configuration
4996350016
- application_security
4996450017
- api_security
50018+
example: log_detection
4996550019
type: string
4996650020
x-enum-varnames:
4996750021
- LOG_DETECTION
@@ -86008,6 +86062,46 @@ paths:
8600886062
summary: Get a suppression's version history
8600986063
tags:
8601086064
- Security Monitoring
86065+
/api/v2/security_monitoring/livetail:
86066+
post:
86067+
description: 'Preview a security monitoring rule query with security filters,
86068+
group by fields, and distinct fields applied.
86069+
86070+
This endpoint is used in the rule editor to show how the query will be transformed
86071+
after applying additional filters.'
86072+
operationId: PreviewSecurityMonitoringRuleQuery
86073+
requestBody:
86074+
content:
86075+
application/json:
86076+
schema:
86077+
$ref: '#/components/schemas/SecurityMonitoringRuleLivetailRequest'
86078+
required: true
86079+
responses:
86080+
'200':
86081+
content:
86082+
application/json:
86083+
schema:
86084+
$ref: '#/components/schemas/SecurityMonitoringRuleLivetailResponse'
86085+
description: OK
86086+
'400':
86087+
$ref: '#/components/responses/BadRequestResponse'
86088+
'403':
86089+
$ref: '#/components/responses/NotAuthorizedResponse'
86090+
'429':
86091+
$ref: '#/components/responses/TooManyRequestsResponse'
86092+
security:
86093+
- apiKeyAuth: []
86094+
appKeyAuth: []
86095+
- AuthZ:
86096+
- security_monitoring_rules_read
86097+
summary: Preview a rule query with applied filters
86098+
tags:
86099+
- Security Monitoring
86100+
x-codegen-request-body-name: body
86101+
x-permission:
86102+
operator: OR
86103+
permissions:
86104+
- security_monitoring_rules_read
8601186105
/api/v2/security_monitoring/rules:
8601286106
get:
8601386107
description: List rules.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2026-01-20T10:27:51.146Z

cassettes/features/v2/security_monitoring/Preview-a-rule-query-with-applied-filters-returns-OK-response.yml

Lines changed: 718 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Preview a rule query with applied filters returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
5+
6+
body = DatadogAPIClient::V2::SecurityMonitoringRuleLivetailRequest.new({
7+
query: "source:cloudtrail",
8+
query_index: 0,
9+
filters: [],
10+
type: DatadogAPIClient::V2::SecurityMonitoringRuleTypeRead::LOG_DETECTION,
11+
detection_method: DatadogAPIClient::V2::SecurityMonitoringRuleDetectionMethod::THRESHOLD,
12+
data_source: "logs",
13+
group_by_fields: [],
14+
distinct_fields: [],
15+
})
16+
p api_instance.preview_security_monitoring_rule_query(body)

features/scenarios_model_mapping.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,6 +1590,9 @@
15901590
"page_size" => "Integer",
15911591
"page_number" => "Integer",
15921592
},
1593+
"v2.PreviewSecurityMonitoringRuleQuery" => {
1594+
"body" => "SecurityMonitoringRuleLivetailRequest",
1595+
},
15931596
"v2.ListSecurityMonitoringRules" => {
15941597
"page_size" => "Integer",
15951598
"page_number" => "Integer",

features/v2/security_monitoring.feature

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,6 +1644,20 @@ Feature: Security Monitoring
16441644
When the request is sent
16451645
Then the response status is 422 The server cannot process the request because it contains invalid data.
16461646

1647+
@skip @team:DataDog/k9-cloud-security-platform
1648+
Scenario: Preview a rule query with applied filters returns "Bad Request" response
1649+
Given new "PreviewSecurityMonitoringRuleQuery" request
1650+
And body with value {"query":"","queryIndex":0,"filters":[],"type":"log_detection","detectionMethod":"threshold","dataSource":"logs","groupByFields":[],"distinctFields":[]}
1651+
When the request is sent
1652+
Then the response status is 400 Bad Request
1653+
1654+
@team:DataDog/k9-cloud-security-platform
1655+
Scenario: Preview a rule query with applied filters returns "OK" response
1656+
Given new "PreviewSecurityMonitoringRuleQuery" request
1657+
And body with value {"query":"source:cloudtrail","queryIndex":0,"filters":[],"type":"log_detection","detectionMethod":"threshold","dataSource":"logs","groupByFields":[],"distinctFields":[]}
1658+
When the request is sent
1659+
Then the response status is 200 OK
1660+
16471661
@generated @skip @team:DataDog/k9-vm-ast
16481662
Scenario: Returns a list of Secrets rules returns "OK" response
16491663
Given operation "GetSecretsRules" enabled

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4137,6 +4137,12 @@
41374137
"type": "safe"
41384138
}
41394139
},
4140+
"PreviewSecurityMonitoringRuleQuery": {
4141+
"tag": "Security Monitoring",
4142+
"undo": {
4143+
"type": "safe"
4144+
}
4145+
},
41404146
"ListSecurityMonitoringRules": {
41414147
"tag": "Security Monitoring",
41424148
"undo": {

lib/datadog_api_client/inflector.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4086,6 +4086,8 @@ def overrides
40864086
"v2.security_monitoring_rule_hardcoded_evaluator_type" => "SecurityMonitoringRuleHardcodedEvaluatorType",
40874087
"v2.security_monitoring_rule_impossible_travel_options" => "SecurityMonitoringRuleImpossibleTravelOptions",
40884088
"v2.security_monitoring_rule_keep_alive" => "SecurityMonitoringRuleKeepAlive",
4089+
"v2.security_monitoring_rule_livetail_request" => "SecurityMonitoringRuleLivetailRequest",
4090+
"v2.security_monitoring_rule_livetail_response" => "SecurityMonitoringRuleLivetailResponse",
40894091
"v2.security_monitoring_rule_max_signal_duration" => "SecurityMonitoringRuleMaxSignalDuration",
40904092
"v2.security_monitoring_rule_new_value_options" => "SecurityMonitoringRuleNewValueOptions",
40914093
"v2.security_monitoring_rule_new_value_options_forget_after" => "SecurityMonitoringRuleNewValueOptionsForgetAfter",

lib/datadog_api_client/v2/api/security_monitoring_api.rb

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5145,6 +5145,74 @@ def patch_vulnerability_notification_rule_with_http_info(id, body, opts = {})
51455145
return data, status_code, headers
51465146
end
51475147

5148+
# Preview a rule query with applied filters.
5149+
#
5150+
# @see #preview_security_monitoring_rule_query_with_http_info
5151+
def preview_security_monitoring_rule_query(body, opts = {})
5152+
data, _status_code, _headers = preview_security_monitoring_rule_query_with_http_info(body, opts)
5153+
data
5154+
end
5155+
5156+
# Preview a rule query with applied filters.
5157+
#
5158+
# Preview a security monitoring rule query with security filters, group by fields, and distinct fields applied.
5159+
# This endpoint is used in the rule editor to show how the query will be transformed after applying additional filters.
5160+
#
5161+
# @param body [SecurityMonitoringRuleLivetailRequest]
5162+
# @param opts [Hash] the optional parameters
5163+
# @return [Array<(SecurityMonitoringRuleLivetailResponse, Integer, Hash)>] SecurityMonitoringRuleLivetailResponse data, response status code and response headers
5164+
def preview_security_monitoring_rule_query_with_http_info(body, opts = {})
5165+
5166+
if @api_client.config.debugging
5167+
@api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.preview_security_monitoring_rule_query ...'
5168+
end
5169+
# verify the required parameter 'body' is set
5170+
if @api_client.config.client_side_validation && body.nil?
5171+
fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.preview_security_monitoring_rule_query"
5172+
end
5173+
# resource path
5174+
local_var_path = '/api/v2/security_monitoring/livetail'
5175+
5176+
# query parameters
5177+
query_params = opts[:query_params] || {}
5178+
5179+
# header parameters
5180+
header_params = opts[:header_params] || {}
5181+
# HTTP header 'Accept' (if needed)
5182+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
5183+
# HTTP header 'Content-Type'
5184+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
5185+
5186+
# form parameters
5187+
form_params = opts[:form_params] || {}
5188+
5189+
# http body (model)
5190+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
5191+
5192+
# return_type
5193+
return_type = opts[:debug_return_type] || 'SecurityMonitoringRuleLivetailResponse'
5194+
5195+
# auth_names
5196+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
5197+
5198+
new_options = opts.merge(
5199+
:operation => :preview_security_monitoring_rule_query,
5200+
:header_params => header_params,
5201+
:query_params => query_params,
5202+
:form_params => form_params,
5203+
:body => post_body,
5204+
:auth_names => auth_names,
5205+
:return_type => return_type,
5206+
:api_version => "V2"
5207+
)
5208+
5209+
data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
5210+
if @api_client.config.debugging
5211+
@api_client.config.logger.debug "API called: SecurityMonitoringAPI#preview_security_monitoring_rule_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
5212+
end
5213+
return data, status_code, headers
5214+
end
5215+
51485216
# Run a threat hunting job.
51495217
#
51505218
# @see #run_threat_hunting_job_with_http_info

0 commit comments

Comments
 (0)