Skip to content
Open
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
704 changes: 704 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

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

require "datadog_api_client"
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.",
file_row_limit: 5000,
inline_row_limit: 100,
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: "1w",
timezone: "America/New_York",
title: "Weekly Infrastructure Report",
}),
type: DatadogAPIClient::V2::ReportScheduleType::SCHEDULE,
}),
})
p api_instance.create_report_schedule(body)
35 changes: 35 additions & 0 deletions examples/v2/report-schedules/PatchReportSchedule.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Update a report schedule returns "OK" response

require "datadog_api_client"
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.",
file_row_limit: 5000,
inline_row_limit: 100,
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: "1w",
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)
7 changes: 7 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4530,6 +4530,13 @@
"snapshot_id" => "String",
"body" => "SnapshotUpdateRequest",
},
"v2.CreateReportSchedule" => {
"body" => "ReportScheduleCreateRequest",
},
"v2.PatchReportSchedule" => {
"schedule_uuid" => "UUID",
"body" => "ReportSchedulePatchRequest",
},
"v2.DeleteRestrictionPolicy" => {
"resource_id" => "String",
},
Expand Down
56 changes: 56 additions & 0 deletions features/v2/report_schedules.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
@endpoint(report-schedules) @endpoint(report-schedules-v2)
Feature: Report Schedules
Create and manage scheduled reports. A scheduled report renders a
dashboard, integration dashboard, uniboard, or widget 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 new "CreateReportSchedule" request
And body with value {"data": {"attributes": {"delivery_format": "pdf", "description": "Weekly summary of infrastructure health.", "file_row_limit": 5000, "inline_row_limit": 100, "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": "1w", "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 new "CreateReportSchedule" request
And body with value {"data": {"attributes": {"delivery_format": "pdf", "description": "Weekly summary of infrastructure health.", "file_row_limit": 5000, "inline_row_limit": 100, "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": "1w", "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 new "CreateReportSchedule" request
And body with value {"data": {"attributes": {"delivery_format": "pdf", "description": "Weekly summary of infrastructure health.", "file_row_limit": 5000, "inline_row_limit": 100, "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": "1w", "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 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.", "file_row_limit": 5000, "inline_row_limit": 100, "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": "1w", "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 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.", "file_row_limit": 5000, "inline_row_limit": 100, "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": "1w", "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 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.", "file_row_limit": 5000, "inline_row_limit": 100, "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": "1w", "timezone": "America/New_York", "title": "Weekly Infrastructure Report"}, "type": "schedule"}}
When the request is sent
Then the response status is 200 OK
13 changes: 13 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5895,6 +5895,19 @@
"type": "idempotent"
}
},
"CreateReportSchedule": {
"tag": "Report Schedules",
"undo": {
"type": "unsafe"
}
},
"PatchReportSchedule": {
"tag": "Report Schedules",
"undo": {
"operationId": "PatchReportSchedule",
"type": "idempotent"
}
},
"DeleteRestrictionPolicy": {
"tag": "Restriction Policies",
"undo": {
Expand Down
20 changes: 20 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5412,6 +5412,25 @@ def overrides
"v2.reorder_ruleset_resource_array" => "ReorderRulesetResourceArray",
"v2.reorder_ruleset_resource_data" => "ReorderRulesetResourceData",
"v2.reorder_ruleset_resource_data_type" => "ReorderRulesetResourceDataType",
"v2.report_schedule_author" => "ReportScheduleAuthor",
"v2.report_schedule_author_attributes" => "ReportScheduleAuthorAttributes",
"v2.report_schedule_author_type" => "ReportScheduleAuthorType",
"v2.report_schedule_create_request" => "ReportScheduleCreateRequest",
"v2.report_schedule_create_request_attributes" => "ReportScheduleCreateRequestAttributes",
"v2.report_schedule_create_request_data" => "ReportScheduleCreateRequestData",
"v2.report_schedule_delivery_format" => "ReportScheduleDeliveryFormat",
"v2.report_schedule_included_resource" => "ReportScheduleIncludedResource",
"v2.report_schedule_patch_request" => "ReportSchedulePatchRequest",
"v2.report_schedule_patch_request_attributes" => "ReportSchedulePatchRequestAttributes",
"v2.report_schedule_patch_request_data" => "ReportSchedulePatchRequestData",
"v2.report_schedule_resource_type" => "ReportScheduleResourceType",
"v2.report_schedule_response" => "ReportScheduleResponse",
"v2.report_schedule_response_attributes" => "ReportScheduleResponseAttributes",
"v2.report_schedule_response_attributes_delivery_format" => "ReportScheduleResponseAttributesDeliveryFormat",
"v2.report_schedule_response_data" => "ReportScheduleResponseData",
"v2.report_schedule_status" => "ReportScheduleStatus",
"v2.report_schedule_template_variable" => "ReportScheduleTemplateVariable",
"v2.report_schedule_type" => "ReportScheduleType",
"v2.resolve_vulnerable_symbols_request" => "ResolveVulnerableSymbolsRequest",
"v2.resolve_vulnerable_symbols_request_data" => "ResolveVulnerableSymbolsRequestData",
"v2.resolve_vulnerable_symbols_request_data_attributes" => "ResolveVulnerableSymbolsRequestDataAttributes",
Expand Down Expand Up @@ -7394,6 +7413,7 @@ def overrides
"v2.processes_api" => "ProcessesAPI",
"v2.product_analytics_api" => "ProductAnalyticsAPI",
"v2.reference_tables_api" => "ReferenceTablesAPI",
"v2.report_schedules_api" => "ReportSchedulesAPI",
"v2.restriction_policies_api" => "RestrictionPoliciesAPI",
"v2.roles_api" => "RolesAPI",
"v2.rum_api" => "RUMAPI",
Expand Down
Loading
Loading