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
917 changes: 912 additions & 5 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2026-06-10T09:27:59.116Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions examples/v2/report-schedules/CreateReportSchedule.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Create a report schedule returns "CREATED" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.create_report_schedule".to_sym] = true
end
api_instance = DatadogAPIClient::V2::ReportSchedulesAPI.new

body = DatadogAPIClient::V2::ReportScheduleCreateRequest.new({
data: DatadogAPIClient::V2::ReportScheduleCreateRequestData.new({
attributes: DatadogAPIClient::V2::ReportScheduleCreateRequestAttributes.new({
delivery_format: DatadogAPIClient::V2::ReportScheduleDeliveryFormat::PDF,
description: "Weekly summary of infrastructure health.",
recipients: [
"user@example.com",
"slack:T01234567.C01234567.alerts",
"teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2",
],
resource_id: "abc-def-ghi",
resource_type: DatadogAPIClient::V2::ReportScheduleResourceType::DASHBOARD,
rrule: 'DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0',
tab_id: "66666666-7777-8888-9999-000000000000",
template_variables: [
DatadogAPIClient::V2::ReportScheduleTemplateVariable.new({
name: "env",
values: [
"prod",
],
}),
],
timeframe: "calendar_month",
timezone: "America/New_York",
title: "Weekly Infrastructure Report",
}),
type: DatadogAPIClient::V2::ReportScheduleType::SCHEDULE,
}),
})
p api_instance.create_report_schedule(body)
36 changes: 36 additions & 0 deletions examples/v2/report-schedules/PatchReportSchedule.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Update a report schedule returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.patch_report_schedule".to_sym] = true
end
api_instance = DatadogAPIClient::V2::ReportSchedulesAPI.new

body = DatadogAPIClient::V2::ReportSchedulePatchRequest.new({
data: DatadogAPIClient::V2::ReportSchedulePatchRequestData.new({
attributes: DatadogAPIClient::V2::ReportSchedulePatchRequestAttributes.new({
delivery_format: DatadogAPIClient::V2::ReportScheduleDeliveryFormat::PDF,
description: "Updated weekly summary of infrastructure health.",
recipients: [
"user@example.com",
"slack:T01234567.C01234567.alerts",
"teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2",
],
rrule: 'DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0',
tab_id: "66666666-7777-8888-9999-000000000000",
template_variables: [
DatadogAPIClient::V2::ReportScheduleTemplateVariable.new({
name: "env",
values: [
"prod",
],
}),
],
timeframe: "calendar_month",
timezone: "America/New_York",
title: "Weekly Infrastructure Report",
}),
type: DatadogAPIClient::V2::ReportScheduleType::SCHEDULE,
}),
})
p api_instance.patch_report_schedule("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body)
8 changes: 8 additions & 0 deletions examples/v2/security-monitoring/GetSingleEntityContext.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get a single entity context returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_single_entity_context".to_sym] = true
end
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
p api_instance.get_single_entity_context("user@example.com")
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Test a notification rule returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new

body = DatadogAPIClient::V2::CreateNotificationRuleParameters.new({
data: DatadogAPIClient::V2::CreateNotificationRuleParametersData.new({
attributes: DatadogAPIClient::V2::CreateNotificationRuleParametersDataAttributes.new({
enabled: true,
name: "Rule 1",
selectors: DatadogAPIClient::V2::Selectors.new({
query: "env:prod",
rule_types: [
DatadogAPIClient::V2::RuleTypesItems::LOG_DETECTION,
],
severities: [
DatadogAPIClient::V2::RuleSeverity::CRITICAL,
],
trigger_source: DatadogAPIClient::V2::TriggerSource::SECURITY_SIGNALS,
}),
targets: [
"@john.doe@email.com",
],
}),
type: DatadogAPIClient::V2::NotificationRulesType::NOTIFICATION_RULES,
}),
})
p api_instance.send_security_monitoring_notification_preview(body)
16 changes: 16 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2212,6 +2212,9 @@
"v2.ValidateSecurityMonitoringIntegrationConfig" => {
"integration_config_id" => "String",
},
"v2.SendSecurityMonitoringNotificationPreview" => {
"body" => "CreateNotificationRuleParameters",
},
"v2.CreateSecurityFilter" => {
"body" => "SecurityFilterCreateRequest",
},
Expand Down Expand Up @@ -2303,6 +2306,12 @@
"limit" => "Integer",
"page_token" => "String",
},
"v2.GetSingleEntityContext" => {
"id" => "String",
"from" => "String",
"to" => "String",
"as_of" => "String",
},
"v2.ListSecurityMonitoringRules" => {
"page_size" => "Integer",
"page_number" => "Integer",
Expand Down Expand Up @@ -4653,6 +4662,13 @@
"snapshot_id" => "String",
"body" => "SnapshotUpdateRequest",
},
"v2.CreateReportSchedule" => {
"body" => "ReportScheduleCreateRequest",
},
"v2.PatchReportSchedule" => {
"schedule_uuid" => "UUID",
"body" => "ReportSchedulePatchRequest",
},
"v2.DeleteRestrictionPolicy" => {
"resource_id" => "String",
},
Expand Down
61 changes: 61 additions & 0 deletions features/v2/report_schedules.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
@endpoint(report-schedules) @endpoint(report-schedules-v2)
Feature: Report Schedules
Create and manage scheduled reports. A scheduled report renders a
dashboard or integration dashboard on a recurring cadence and delivers it
to a set of recipients over email, Slack, or Microsoft Teams.

Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "ReportSchedules" API

@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Create a report schedule returns "Bad Request" response
Given operation "CreateReportSchedule" enabled
And new "CreateReportSchedule" request
And body with value {"data": {"attributes": {"delivery_format": "pdf", "description": "Weekly summary of infrastructure health.", "recipients": ["user@example.com", "slack:T01234567.C01234567.alerts", "teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2"], "resource_id": "abc-def-ghi", "resource_type": "dashboard", "rrule": "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0", "tab_id": "66666666-7777-8888-9999-000000000000", "template_variables": [{"name": "env", "values": ["prod"]}], "timeframe": "calendar_month", "timezone": "America/New_York", "title": "Weekly Infrastructure Report"}, "type": "schedule"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Create a report schedule returns "CREATED" response
Given operation "CreateReportSchedule" enabled
And new "CreateReportSchedule" request
And body with value {"data": {"attributes": {"delivery_format": "pdf", "description": "Weekly summary of infrastructure health.", "recipients": ["user@example.com", "slack:T01234567.C01234567.alerts", "teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2"], "resource_id": "abc-def-ghi", "resource_type": "dashboard", "rrule": "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0", "tab_id": "66666666-7777-8888-9999-000000000000", "template_variables": [{"name": "env", "values": ["prod"]}], "timeframe": "calendar_month", "timezone": "America/New_York", "title": "Weekly Infrastructure Report"}, "type": "schedule"}}
When the request is sent
Then the response status is 201 CREATED

@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Create a report schedule returns "Not Found" response
Given operation "CreateReportSchedule" enabled
And new "CreateReportSchedule" request
And body with value {"data": {"attributes": {"delivery_format": "pdf", "description": "Weekly summary of infrastructure health.", "recipients": ["user@example.com", "slack:T01234567.C01234567.alerts", "teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2"], "resource_id": "abc-def-ghi", "resource_type": "dashboard", "rrule": "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0", "tab_id": "66666666-7777-8888-9999-000000000000", "template_variables": [{"name": "env", "values": ["prod"]}], "timeframe": "calendar_month", "timezone": "America/New_York", "title": "Weekly Infrastructure Report"}, "type": "schedule"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Update a report schedule returns "Bad Request" response
Given operation "PatchReportSchedule" enabled
And new "PatchReportSchedule" request
And request contains "schedule_uuid" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"delivery_format": "pdf", "description": "Updated weekly summary of infrastructure health.", "recipients": ["user@example.com", "slack:T01234567.C01234567.alerts", "teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2"], "rrule": "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0", "tab_id": "66666666-7777-8888-9999-000000000000", "template_variables": [{"name": "env", "values": ["prod"]}], "timeframe": "calendar_month", "timezone": "America/New_York", "title": "Weekly Infrastructure Report"}, "type": "schedule"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Update a report schedule returns "Not Found" response
Given operation "PatchReportSchedule" enabled
And new "PatchReportSchedule" request
And request contains "schedule_uuid" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"delivery_format": "pdf", "description": "Updated weekly summary of infrastructure health.", "recipients": ["user@example.com", "slack:T01234567.C01234567.alerts", "teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2"], "rrule": "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0", "tab_id": "66666666-7777-8888-9999-000000000000", "template_variables": [{"name": "env", "values": ["prod"]}], "timeframe": "calendar_month", "timezone": "America/New_York", "title": "Weekly Infrastructure Report"}, "type": "schedule"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Update a report schedule returns "OK" response
Given operation "PatchReportSchedule" enabled
And new "PatchReportSchedule" request
And request contains "schedule_uuid" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"delivery_format": "pdf", "description": "Updated weekly summary of infrastructure health.", "recipients": ["user@example.com", "slack:T01234567.C01234567.alerts", "teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2"], "rrule": "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0", "tab_id": "66666666-7777-8888-9999-000000000000", "template_variables": [{"name": "env", "values": ["prod"]}], "timeframe": "calendar_month", "timezone": "America/New_York", "title": "Weekly Infrastructure Report"}, "type": "schedule"}}
When the request is sent
Then the response status is 200 OK
Loading
Loading