Skip to content

Commit 76eb0b6

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit a000dfa of spec repo
1 parent 6f09ae5 commit 76eb0b6

19 files changed

Lines changed: 1089 additions & 6 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23464,6 +23464,8 @@ components:
2346423464
$ref: "#/components/schemas/Enabled"
2346523465
name:
2346623466
$ref: "#/components/schemas/RuleName"
23467+
routing:
23468+
$ref: "#/components/schemas/NotificationRuleRouting"
2346723469
selectors:
2346823470
$ref: "#/components/schemas/Selectors"
2346923471
targets:
@@ -58623,6 +58625,76 @@ components:
5862358625
- targets
5862458626
- version
5862558627
type: object
58628+
NotificationRulePreviewNotificationStatus:
58629+
description: The notification status for the given rule type. `SUCCESS` means a matching event was found and the notification was sent successfully. `DEFAULT` means no matching event was found and a default placeholder notification was sent instead. `ERROR` means an error occurred while sending the notification.
58630+
enum:
58631+
- SUCCESS
58632+
- DEFAULT
58633+
- ERROR
58634+
example: SUCCESS
58635+
type: string
58636+
x-enum-varnames:
58637+
- SUCCESS
58638+
- DEFAULT
58639+
- ERROR
58640+
NotificationRulePreviewResponse:
58641+
description: Response from the notification preview request.
58642+
properties:
58643+
data:
58644+
$ref: "#/components/schemas/NotificationRulePreviewResponseData"
58645+
required:
58646+
- data
58647+
type: object
58648+
NotificationRulePreviewResponseAttributes:
58649+
description: Attributes of the notification preview response.
58650+
properties:
58651+
preview_results:
58652+
$ref: "#/components/schemas/NotificationRulePreviewResults"
58653+
required:
58654+
- preview_results
58655+
type: object
58656+
NotificationRulePreviewResponseData:
58657+
description: The notification preview response data.
58658+
properties:
58659+
attributes:
58660+
$ref: "#/components/schemas/NotificationRulePreviewResponseAttributes"
58661+
id:
58662+
description: The ID of the notification preview response.
58663+
example: rka-loa-zwu
58664+
type: string
58665+
type:
58666+
$ref: "#/components/schemas/NotificationRulePreviewResponseType"
58667+
required:
58668+
- type
58669+
- attributes
58670+
type: object
58671+
NotificationRulePreviewResponseType:
58672+
description: The type of the notification preview response.
58673+
enum:
58674+
- notification_preview_response
58675+
example: notification_preview_response
58676+
type: string
58677+
x-enum-varnames:
58678+
- NOTIFICATION_PREVIEW_RESPONSE
58679+
NotificationRulePreviewResult:
58680+
description: The preview result for a single rule type.
58681+
properties:
58682+
notification_status:
58683+
$ref: "#/components/schemas/NotificationRulePreviewNotificationStatus"
58684+
rule_type:
58685+
$ref: "#/components/schemas/RuleTypesItems"
58686+
required:
58687+
- rule_type
58688+
- notification_status
58689+
type: object
58690+
NotificationRulePreviewResults:
58691+
description: List of preview results for each rule type matched by the notification rule.
58692+
example:
58693+
- notification_status: DEFAULT
58694+
rule_type: log_detection
58695+
items:
58696+
$ref: "#/components/schemas/NotificationRulePreviewResult"
58697+
type: array
5862658698
NotificationRuleQuery:
5862758699
description: The query is composed of one or several key:value pairs, which can be used to filter security issues on tags and attributes.
5862858700
example: (source:production_service OR env:prod)
@@ -58633,6 +58705,22 @@ components:
5863358705
data:
5863458706
$ref: "#/components/schemas/NotificationRule"
5863558707
type: object
58708+
NotificationRuleRouting:
58709+
description: Routing configuration for the notification rule.
58710+
properties:
58711+
mode:
58712+
$ref: "#/components/schemas/NotificationRuleRoutingMode"
58713+
required:
58714+
- mode
58715+
type: object
58716+
NotificationRuleRoutingMode:
58717+
description: The routing mode for the notification rule. `manual` sends notifications to the configured targets.
58718+
enum:
58719+
- manual
58720+
example: manual
58721+
type: string
58722+
x-enum-varnames:
58723+
- MANUAL
5863658724
NotificationRulesListResponse:
5863758725
description: The list of notification rules.
5863858726
properties:
@@ -68437,6 +68525,8 @@ components:
6843768525
$ref: "#/components/schemas/Enabled"
6843868526
name:
6843968527
$ref: "#/components/schemas/RuleName"
68528+
routing:
68529+
$ref: "#/components/schemas/NotificationRuleRouting"
6844068530
selectors:
6844168531
$ref: "#/components/schemas/Selectors"
6844268532
targets:
@@ -74747,6 +74837,7 @@ components:
7474774837
- iac_misconfiguration
7474874838
- sast_vulnerability
7474974839
- secret_vulnerability
74840+
example: log_detection
7475074841
type: string
7475174842
x-enum-varnames:
7475274843
- APPLICATION_SECURITY
@@ -163272,6 +163363,73 @@ paths:
163272163363
x-unstable: |-
163273163364
**Note**: This endpoint is in preview and is subject to change.
163274163365
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
163366+
/api/v2/security_monitoring/configuration/notification_rules/send_notification_preview:
163367+
post:
163368+
description: Send a notification preview to test that a notification rule's targets are properly configured.
163369+
operationId: SendSecurityMonitoringNotificationPreview
163370+
requestBody:
163371+
content:
163372+
application/json:
163373+
examples:
163374+
default:
163375+
value:
163376+
data:
163377+
attributes:
163378+
enabled: true
163379+
name: Rule 1
163380+
selectors:
163381+
query: env:prod
163382+
rule_types:
163383+
- log_detection
163384+
severities:
163385+
- critical
163386+
trigger_source: security_signals
163387+
targets:
163388+
- "@john.doe@email.com"
163389+
type: notification_rules
163390+
schema:
163391+
$ref: "#/components/schemas/CreateNotificationRuleParameters"
163392+
required: true
163393+
responses:
163394+
"200":
163395+
content:
163396+
application/json:
163397+
examples:
163398+
default:
163399+
value:
163400+
data:
163401+
attributes:
163402+
preview_results:
163403+
- notification_status: DEFAULT
163404+
rule_type: log_detection
163405+
id: rka-loa-zwu
163406+
type: notification_preview_response
163407+
schema:
163408+
$ref: "#/components/schemas/NotificationRulePreviewResponse"
163409+
description: OK
163410+
"400":
163411+
content:
163412+
application/json:
163413+
schema:
163414+
$ref: "#/components/schemas/JSONAPIErrorResponse"
163415+
description: Bad Request
163416+
"403":
163417+
$ref: "#/components/responses/NotAuthorizedResponse"
163418+
"429":
163419+
$ref: "#/components/responses/TooManyRequestsResponse"
163420+
security:
163421+
- apiKeyAuth: []
163422+
appKeyAuth: []
163423+
- AuthZ:
163424+
- security_monitoring_notification_profiles_write
163425+
summary: Test a notification rule
163426+
tags:
163427+
- Security Monitoring
163428+
x-codegen-request-body-name: body
163429+
"x-permission":
163430+
operator: OR
163431+
permissions:
163432+
- security_monitoring_notification_profiles_write
163275163433
/api/v2/security_monitoring/configuration/security_filters:
163276163434
get:
163277163435
description: Get the list of configured security filters with their definitions.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2026-06-10T09:27:59.116Z

cassettes/features/v2/security_monitoring/Test-a-notification-rule-returns-OK-response.yml

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Test a notification rule returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
5+
6+
body = DatadogAPIClient::V2::CreateNotificationRuleParameters.new({
7+
data: DatadogAPIClient::V2::CreateNotificationRuleParametersData.new({
8+
attributes: DatadogAPIClient::V2::CreateNotificationRuleParametersDataAttributes.new({
9+
enabled: true,
10+
name: "Rule 1",
11+
selectors: DatadogAPIClient::V2::Selectors.new({
12+
query: "env:prod",
13+
rule_types: [
14+
DatadogAPIClient::V2::RuleTypesItems::LOG_DETECTION,
15+
],
16+
severities: [
17+
DatadogAPIClient::V2::RuleSeverity::CRITICAL,
18+
],
19+
trigger_source: DatadogAPIClient::V2::TriggerSource::SECURITY_SIGNALS,
20+
}),
21+
targets: [
22+
"@john.doe@email.com",
23+
],
24+
}),
25+
type: DatadogAPIClient::V2::NotificationRulesType::NOTIFICATION_RULES,
26+
}),
27+
})
28+
p api_instance.send_security_monitoring_notification_preview(body)

features/scenarios_model_mapping.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2212,6 +2212,9 @@
22122212
"v2.ValidateSecurityMonitoringIntegrationConfig" => {
22132213
"integration_config_id" => "String",
22142214
},
2215+
"v2.SendSecurityMonitoringNotificationPreview" => {
2216+
"body" => "CreateNotificationRuleParameters",
2217+
},
22152218
"v2.CreateSecurityFilter" => {
22162219
"body" => "SecurityFilterCreateRequest",
22172220
},

features/v2/security_monitoring.feature

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ Feature: Security Monitoring
759759
@generated @skip @team:DataDog/cloud-security-posture-management
760760
Scenario: Create a new signal-based notification rule returns "Bad Request" response
761761
Given new "CreateSignalNotificationRule" request
762-
And body with value {"data": {"attributes": {"enabled": true, "name": "Rule 1", "selectors": {"query": "(source:production_service OR env:prod)", "rule_types": ["misconfiguration", "attack_path"], "severities": ["critical"], "trigger_source": "security_findings"}, "targets": ["@john.doe@email.com"], "time_aggregation": 86400}, "type": "notification_rules"}}
762+
And body with value {"data": {"attributes": {"enabled": true, "name": "Rule 1", "routing": {"mode": "manual"}, "selectors": {"query": "(source:production_service OR env:prod)", "rule_types": ["misconfiguration", "attack_path"], "severities": ["critical"], "trigger_source": "security_findings"}, "targets": ["@john.doe@email.com"], "time_aggregation": 86400}, "type": "notification_rules"}}
763763
When the request is sent
764764
Then the response status is 400 Bad Request
765765

@@ -773,7 +773,7 @@ Feature: Security Monitoring
773773
@generated @skip @team:DataDog/cloud-security-posture-management
774774
Scenario: Create a new vulnerability-based notification rule returns "Bad Request" response
775775
Given new "CreateVulnerabilityNotificationRule" request
776-
And body with value {"data": {"attributes": {"enabled": true, "name": "Rule 1", "selectors": {"query": "(source:production_service OR env:prod)", "rule_types": ["misconfiguration", "attack_path"], "severities": ["critical"], "trigger_source": "security_findings"}, "targets": ["@john.doe@email.com"], "time_aggregation": 86400}, "type": "notification_rules"}}
776+
And body with value {"data": {"attributes": {"enabled": true, "name": "Rule 1", "routing": {"mode": "manual"}, "selectors": {"query": "(source:production_service OR env:prod)", "rule_types": ["misconfiguration", "attack_path"], "severities": ["critical"], "trigger_source": "security_findings"}, "targets": ["@john.doe@email.com"], "time_aggregation": 86400}, "type": "notification_rules"}}
777777
When the request is sent
778778
Then the response status is 400 Bad Request
779779

@@ -2470,7 +2470,7 @@ Feature: Security Monitoring
24702470
Scenario: Patch a signal-based notification rule returns "The server cannot process the request because it contains invalid data." response
24712471
Given new "PatchSignalNotificationRule" request
24722472
And request contains "id" parameter from "REPLACE.ME"
2473-
And body with value {"data": {"attributes": {"enabled": true, "name": "Rule 1", "selectors": {"query": "(source:production_service OR env:prod)", "rule_types": ["misconfiguration", "attack_path"], "severities": ["critical"], "trigger_source": "security_findings"}, "targets": ["@john.doe@email.com"], "time_aggregation": 86400, "version": 1}, "id": "aaa-bbb-ccc", "type": "notification_rules"}}
2473+
And body with value {"data": {"attributes": {"enabled": true, "name": "Rule 1", "routing": {"mode": "manual"}, "selectors": {"query": "(source:production_service OR env:prod)", "rule_types": ["misconfiguration", "attack_path"], "severities": ["critical"], "trigger_source": "security_findings"}, "targets": ["@john.doe@email.com"], "time_aggregation": 86400, "version": 1}, "id": "aaa-bbb-ccc", "type": "notification_rules"}}
24742474
When the request is sent
24752475
Then the response status is 422 The server cannot process the request because it contains invalid data.
24762476

@@ -2504,7 +2504,7 @@ Feature: Security Monitoring
25042504
Scenario: Patch a vulnerability-based notification rule returns "The server cannot process the request because it contains invalid data." response
25052505
Given new "PatchVulnerabilityNotificationRule" request
25062506
And request contains "id" parameter from "REPLACE.ME"
2507-
And body with value {"data": {"attributes": {"enabled": true, "name": "Rule 1", "selectors": {"query": "(source:production_service OR env:prod)", "rule_types": ["misconfiguration", "attack_path"], "severities": ["critical"], "trigger_source": "security_findings"}, "targets": ["@john.doe@email.com"], "time_aggregation": 86400, "version": 1}, "id": "aaa-bbb-ccc", "type": "notification_rules"}}
2507+
And body with value {"data": {"attributes": {"enabled": true, "name": "Rule 1", "routing": {"mode": "manual"}, "selectors": {"query": "(source:production_service OR env:prod)", "rule_types": ["misconfiguration", "attack_path"], "severities": ["critical"], "trigger_source": "security_findings"}, "targets": ["@john.doe@email.com"], "time_aggregation": 86400, "version": 1}, "id": "aaa-bbb-ccc", "type": "notification_rules"}}
25082508
When the request is sent
25092509
Then the response status is 422 The server cannot process the request because it contains invalid data.
25102510

@@ -2611,6 +2611,20 @@ Feature: Security Monitoring
26112611
When the request is sent
26122612
Then the response status is 200 OK
26132613

2614+
@generated @skip @team:DataDog/k9-cloud-siem
2615+
Scenario: Test a notification rule returns "Bad Request" response
2616+
Given new "SendSecurityMonitoringNotificationPreview" request
2617+
And body with value {"data": {"attributes": {"enabled": true, "name": "Rule 1", "routing": {"mode": "manual"}, "selectors": {"query": "(source:production_service OR env:prod)", "rule_types": ["misconfiguration", "attack_path"], "severities": ["critical"], "trigger_source": "security_findings"}, "targets": ["@john.doe@email.com"], "time_aggregation": 86400}, "type": "notification_rules"}}
2618+
When the request is sent
2619+
Then the response status is 400 Bad Request
2620+
2621+
@team:DataDog/k9-cloud-siem
2622+
Scenario: Test a notification rule returns "OK" response
2623+
Given new "SendSecurityMonitoringNotificationPreview" request
2624+
And body with value {"data": {"attributes": {"enabled": true, "name": "Rule 1", "selectors": {"query": "env:prod", "rule_types": ["log_detection"], "severities": ["critical"], "trigger_source": "security_signals"}, "targets": ["@john.doe@email.com"]}, "type": "notification_rules"}}
2625+
When the request is sent
2626+
Then the response status is 200 OK
2627+
26142628
@skip @team:DataDog/k9-cloud-siem
26152629
Scenario: Test a rule returns "Bad Request" response
26162630
Given new "TestSecurityMonitoringRule" request

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6981,6 +6981,12 @@
69816981
"type": "safe"
69826982
}
69836983
},
6984+
"SendSecurityMonitoringNotificationPreview": {
6985+
"tag": "Security Monitoring",
6986+
"undo": {
6987+
"type": "safe"
6988+
}
6989+
},
69846990
"ListSecurityFilters": {
69856991
"tag": "Security Monitoring",
69866992
"undo": {

lib/datadog_api_client/inflector.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4636,7 +4636,15 @@ def overrides
46364636
"v2.notification_channel_type" => "NotificationChannelType",
46374637
"v2.notification_rule" => "NotificationRule",
46384638
"v2.notification_rule_attributes" => "NotificationRuleAttributes",
4639+
"v2.notification_rule_preview_notification_status" => "NotificationRulePreviewNotificationStatus",
4640+
"v2.notification_rule_preview_response" => "NotificationRulePreviewResponse",
4641+
"v2.notification_rule_preview_response_attributes" => "NotificationRulePreviewResponseAttributes",
4642+
"v2.notification_rule_preview_response_data" => "NotificationRulePreviewResponseData",
4643+
"v2.notification_rule_preview_response_type" => "NotificationRulePreviewResponseType",
4644+
"v2.notification_rule_preview_result" => "NotificationRulePreviewResult",
46394645
"v2.notification_rule_response" => "NotificationRuleResponse",
4646+
"v2.notification_rule_routing" => "NotificationRuleRouting",
4647+
"v2.notification_rule_routing_mode" => "NotificationRuleRoutingMode",
46404648
"v2.notification_rules_list_response" => "NotificationRulesListResponse",
46414649
"v2.notification_rules_type" => "NotificationRulesType",
46424650
"v2.notion_api_key" => "NotionAPIKey",

0 commit comments

Comments
 (0)