Skip to content

Commit e4bfa3e

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 1a98e8e of spec repo
1 parent e0291e2 commit e4bfa3e

29 files changed

Lines changed: 2436 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 704 additions & 0 deletions
Large diffs are not rendered by default.

docs/datadog_api_client.v2.api.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,13 @@ datadog\_api\_client.v2.api.reference\_tables\_api module
585585
:members:
586586
:show-inheritance:
587587

588+
datadog\_api\_client.v2.api.report\_schedules\_api module
589+
---------------------------------------------------------
590+
591+
.. automodule:: datadog_api_client.v2.api.report_schedules_api
592+
:members:
593+
:show-inheritance:
594+
588595
datadog\_api\_client.v2.api.restriction\_policies\_api module
589596
-------------------------------------------------------------
590597

docs/datadog_api_client.v2.model.rst

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30153,6 +30153,139 @@ datadog\_api\_client.v2.model.reorder\_ruleset\_resource\_data\_type module
3015330153
:members:
3015430154
:show-inheritance:
3015530155

30156+
datadog\_api\_client.v2.model.report\_schedule\_author module
30157+
-------------------------------------------------------------
30158+
30159+
.. automodule:: datadog_api_client.v2.model.report_schedule_author
30160+
:members:
30161+
:show-inheritance:
30162+
30163+
datadog\_api\_client.v2.model.report\_schedule\_author\_attributes module
30164+
-------------------------------------------------------------------------
30165+
30166+
.. automodule:: datadog_api_client.v2.model.report_schedule_author_attributes
30167+
:members:
30168+
:show-inheritance:
30169+
30170+
datadog\_api\_client.v2.model.report\_schedule\_author\_type module
30171+
-------------------------------------------------------------------
30172+
30173+
.. automodule:: datadog_api_client.v2.model.report_schedule_author_type
30174+
:members:
30175+
:show-inheritance:
30176+
30177+
datadog\_api\_client.v2.model.report\_schedule\_create\_request module
30178+
----------------------------------------------------------------------
30179+
30180+
.. automodule:: datadog_api_client.v2.model.report_schedule_create_request
30181+
:members:
30182+
:show-inheritance:
30183+
30184+
datadog\_api\_client.v2.model.report\_schedule\_create\_request\_attributes module
30185+
----------------------------------------------------------------------------------
30186+
30187+
.. automodule:: datadog_api_client.v2.model.report_schedule_create_request_attributes
30188+
:members:
30189+
:show-inheritance:
30190+
30191+
datadog\_api\_client.v2.model.report\_schedule\_create\_request\_data module
30192+
----------------------------------------------------------------------------
30193+
30194+
.. automodule:: datadog_api_client.v2.model.report_schedule_create_request_data
30195+
:members:
30196+
:show-inheritance:
30197+
30198+
datadog\_api\_client.v2.model.report\_schedule\_delivery\_format module
30199+
-----------------------------------------------------------------------
30200+
30201+
.. automodule:: datadog_api_client.v2.model.report_schedule_delivery_format
30202+
:members:
30203+
:show-inheritance:
30204+
30205+
datadog\_api\_client.v2.model.report\_schedule\_included\_resource module
30206+
-------------------------------------------------------------------------
30207+
30208+
.. automodule:: datadog_api_client.v2.model.report_schedule_included_resource
30209+
:members:
30210+
:show-inheritance:
30211+
30212+
datadog\_api\_client.v2.model.report\_schedule\_patch\_request module
30213+
---------------------------------------------------------------------
30214+
30215+
.. automodule:: datadog_api_client.v2.model.report_schedule_patch_request
30216+
:members:
30217+
:show-inheritance:
30218+
30219+
datadog\_api\_client.v2.model.report\_schedule\_patch\_request\_attributes module
30220+
---------------------------------------------------------------------------------
30221+
30222+
.. automodule:: datadog_api_client.v2.model.report_schedule_patch_request_attributes
30223+
:members:
30224+
:show-inheritance:
30225+
30226+
datadog\_api\_client.v2.model.report\_schedule\_patch\_request\_data module
30227+
---------------------------------------------------------------------------
30228+
30229+
.. automodule:: datadog_api_client.v2.model.report_schedule_patch_request_data
30230+
:members:
30231+
:show-inheritance:
30232+
30233+
datadog\_api\_client.v2.model.report\_schedule\_resource\_type module
30234+
---------------------------------------------------------------------
30235+
30236+
.. automodule:: datadog_api_client.v2.model.report_schedule_resource_type
30237+
:members:
30238+
:show-inheritance:
30239+
30240+
datadog\_api\_client.v2.model.report\_schedule\_response module
30241+
---------------------------------------------------------------
30242+
30243+
.. automodule:: datadog_api_client.v2.model.report_schedule_response
30244+
:members:
30245+
:show-inheritance:
30246+
30247+
datadog\_api\_client.v2.model.report\_schedule\_response\_attributes module
30248+
---------------------------------------------------------------------------
30249+
30250+
.. automodule:: datadog_api_client.v2.model.report_schedule_response_attributes
30251+
:members:
30252+
:show-inheritance:
30253+
30254+
datadog\_api\_client.v2.model.report\_schedule\_response\_attributes\_delivery\_format module
30255+
---------------------------------------------------------------------------------------------
30256+
30257+
.. automodule:: datadog_api_client.v2.model.report_schedule_response_attributes_delivery_format
30258+
:members:
30259+
:show-inheritance:
30260+
30261+
datadog\_api\_client.v2.model.report\_schedule\_response\_data module
30262+
---------------------------------------------------------------------
30263+
30264+
.. automodule:: datadog_api_client.v2.model.report_schedule_response_data
30265+
:members:
30266+
:show-inheritance:
30267+
30268+
datadog\_api\_client.v2.model.report\_schedule\_status module
30269+
-------------------------------------------------------------
30270+
30271+
.. automodule:: datadog_api_client.v2.model.report_schedule_status
30272+
:members:
30273+
:show-inheritance:
30274+
30275+
datadog\_api\_client.v2.model.report\_schedule\_template\_variable module
30276+
-------------------------------------------------------------------------
30277+
30278+
.. automodule:: datadog_api_client.v2.model.report_schedule_template_variable
30279+
:members:
30280+
:show-inheritance:
30281+
30282+
datadog\_api\_client.v2.model.report\_schedule\_type module
30283+
-----------------------------------------------------------
30284+
30285+
.. automodule:: datadog_api_client.v2.model.report_schedule_type
30286+
:members:
30287+
:show-inheritance:
30288+
3015630289
datadog\_api\_client.v2.model.resolve\_vulnerable\_symbols\_request module
3015730290
--------------------------------------------------------------------------
3015830291

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
"""
2+
Create a report schedule returns "CREATED" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.report_schedules_api import ReportSchedulesApi
7+
from datadog_api_client.v2.model.report_schedule_create_request import ReportScheduleCreateRequest
8+
from datadog_api_client.v2.model.report_schedule_create_request_attributes import ReportScheduleCreateRequestAttributes
9+
from datadog_api_client.v2.model.report_schedule_create_request_data import ReportScheduleCreateRequestData
10+
from datadog_api_client.v2.model.report_schedule_delivery_format import ReportScheduleDeliveryFormat
11+
from datadog_api_client.v2.model.report_schedule_resource_type import ReportScheduleResourceType
12+
from datadog_api_client.v2.model.report_schedule_template_variable import ReportScheduleTemplateVariable
13+
from datadog_api_client.v2.model.report_schedule_type import ReportScheduleType
14+
15+
body = ReportScheduleCreateRequest(
16+
data=ReportScheduleCreateRequestData(
17+
attributes=ReportScheduleCreateRequestAttributes(
18+
delivery_format=ReportScheduleDeliveryFormat.PDF,
19+
description="Weekly summary of infrastructure health.",
20+
file_row_limit=5000,
21+
inline_row_limit=100,
22+
recipients=[
23+
"user@example.com",
24+
"slack:T01234567.C01234567.alerts",
25+
"teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2",
26+
],
27+
resource_id="abc-def-ghi",
28+
resource_type=ReportScheduleResourceType.DASHBOARD,
29+
rrule="DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0",
30+
tab_id="66666666-7777-8888-9999-000000000000",
31+
template_variables=[
32+
ReportScheduleTemplateVariable(
33+
name="env",
34+
values=[
35+
"prod",
36+
],
37+
),
38+
],
39+
timeframe="1w",
40+
timezone="America/New_York",
41+
title="Weekly Infrastructure Report",
42+
),
43+
type=ReportScheduleType.SCHEDULE,
44+
),
45+
)
46+
47+
configuration = Configuration()
48+
with ApiClient(configuration) as api_client:
49+
api_instance = ReportSchedulesApi(api_client)
50+
response = api_instance.create_report_schedule(body=body)
51+
52+
print(response)
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
"""
2+
Update a report schedule returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.report_schedules_api import ReportSchedulesApi
7+
from datadog_api_client.v2.model.report_schedule_delivery_format import ReportScheduleDeliveryFormat
8+
from datadog_api_client.v2.model.report_schedule_patch_request import ReportSchedulePatchRequest
9+
from datadog_api_client.v2.model.report_schedule_patch_request_attributes import ReportSchedulePatchRequestAttributes
10+
from datadog_api_client.v2.model.report_schedule_patch_request_data import ReportSchedulePatchRequestData
11+
from datadog_api_client.v2.model.report_schedule_template_variable import ReportScheduleTemplateVariable
12+
from datadog_api_client.v2.model.report_schedule_type import ReportScheduleType
13+
from uuid import UUID
14+
15+
body = ReportSchedulePatchRequest(
16+
data=ReportSchedulePatchRequestData(
17+
attributes=ReportSchedulePatchRequestAttributes(
18+
delivery_format=ReportScheduleDeliveryFormat.PDF,
19+
description="Updated weekly summary of infrastructure health.",
20+
file_row_limit=5000,
21+
inline_row_limit=100,
22+
recipients=[
23+
"user@example.com",
24+
"slack:T01234567.C01234567.alerts",
25+
"teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2",
26+
],
27+
rrule="DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0",
28+
tab_id=UUID("66666666-7777-8888-9999-000000000000"),
29+
template_variables=[
30+
ReportScheduleTemplateVariable(
31+
name="env",
32+
values=[
33+
"prod",
34+
],
35+
),
36+
],
37+
timeframe="1w",
38+
timezone="America/New_York",
39+
title="Weekly Infrastructure Report",
40+
),
41+
type=ReportScheduleType.SCHEDULE,
42+
),
43+
)
44+
45+
configuration = Configuration()
46+
with ApiClient(configuration) as api_client:
47+
api_instance = ReportSchedulesApi(api_client)
48+
response = api_instance.patch_report_schedule(schedule_uuid=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), body=body)
49+
50+
print(response)
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import Any, Dict
7+
8+
from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint
9+
from datadog_api_client.configuration import Configuration
10+
from datadog_api_client.model_utils import (
11+
UUID,
12+
)
13+
from datadog_api_client.v2.model.report_schedule_response import ReportScheduleResponse
14+
from datadog_api_client.v2.model.report_schedule_create_request import ReportScheduleCreateRequest
15+
from datadog_api_client.v2.model.report_schedule_patch_request import ReportSchedulePatchRequest
16+
17+
18+
class ReportSchedulesApi:
19+
"""
20+
Create and manage scheduled reports. A scheduled report renders a dashboard, integration
21+
dashboard, uniboard, or widget on a recurring cadence and delivers it to a set of
22+
recipients over email, Slack, or Microsoft Teams.
23+
"""
24+
25+
def __init__(self, api_client=None):
26+
if api_client is None:
27+
api_client = ApiClient(Configuration())
28+
self.api_client = api_client
29+
30+
self._create_report_schedule_endpoint = _Endpoint(
31+
settings={
32+
"response_type": (ReportScheduleResponse,),
33+
"auth": ["apiKeyAuth", "appKeyAuth"],
34+
"endpoint_path": "/api/v2/reporting/schedule",
35+
"operation_id": "create_report_schedule",
36+
"http_method": "POST",
37+
"version": "v2",
38+
},
39+
params_map={
40+
"body": {
41+
"required": True,
42+
"openapi_types": (ReportScheduleCreateRequest,),
43+
"location": "body",
44+
},
45+
},
46+
headers_map={"accept": ["application/json"], "content_type": ["application/json"]},
47+
api_client=api_client,
48+
)
49+
50+
self._patch_report_schedule_endpoint = _Endpoint(
51+
settings={
52+
"response_type": (ReportScheduleResponse,),
53+
"auth": ["apiKeyAuth", "appKeyAuth"],
54+
"endpoint_path": "/api/v2/reporting/schedule/{schedule_uuid}",
55+
"operation_id": "patch_report_schedule",
56+
"http_method": "PATCH",
57+
"version": "v2",
58+
},
59+
params_map={
60+
"schedule_uuid": {
61+
"required": True,
62+
"openapi_types": (UUID,),
63+
"attribute": "schedule_uuid",
64+
"location": "path",
65+
},
66+
"body": {
67+
"required": True,
68+
"openapi_types": (ReportSchedulePatchRequest,),
69+
"location": "body",
70+
},
71+
},
72+
headers_map={"accept": ["application/json"], "content_type": ["application/json"]},
73+
api_client=api_client,
74+
)
75+
76+
def create_report_schedule(
77+
self,
78+
body: ReportScheduleCreateRequest,
79+
) -> ReportScheduleResponse:
80+
"""Create a report schedule.
81+
82+
Create a new scheduled report. A schedule renders a dashboard, integration dashboard,
83+
uniboard, or widget on a recurring cadence and delivers
84+
it to the configured recipients over email, Slack, or Microsoft Teams.
85+
Requires a reporting write permission appropriate to the targeted resource type, such as
86+
``generate_dashboard_reports`` for dashboards or ``generate_log_reports`` for log widgets.
87+
88+
:type body: ReportScheduleCreateRequest
89+
:rtype: ReportScheduleResponse
90+
"""
91+
kwargs: Dict[str, Any] = {}
92+
kwargs["body"] = body
93+
94+
return self._create_report_schedule_endpoint.call_with_http_info(**kwargs)
95+
96+
def patch_report_schedule(
97+
self,
98+
schedule_uuid: UUID,
99+
body: ReportSchedulePatchRequest,
100+
) -> ReportScheduleResponse:
101+
"""Update a report schedule.
102+
103+
Update an existing scheduled report by its identifier. The editable attributes
104+
are replaced with the supplied values; the targeted resource ( ``resource_id`` and
105+
``resource_type`` ) cannot be changed after creation. PDF schedules support ``delivery_format`` ;
106+
CSV schedules support ``file_row_limit`` and ``inline_row_limit``.
107+
Requires a reporting write permission appropriate to the targeted resource type and schedule ownership,
108+
such as ``generate_dashboard_reports`` for dashboard schedules or ``generate_log_reports`` / ``manage_log_reports``
109+
for log widget schedules.
110+
111+
:param schedule_uuid: The unique identifier of the report schedule to update.
112+
:type schedule_uuid: UUID
113+
:type body: ReportSchedulePatchRequest
114+
:rtype: ReportScheduleResponse
115+
"""
116+
kwargs: Dict[str, Any] = {}
117+
kwargs["schedule_uuid"] = schedule_uuid
118+
119+
kwargs["body"] = body
120+
121+
return self._patch_report_schedule_endpoint.call_with_http_info(**kwargs)

src/datadog_api_client/v2/apis/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
from datadog_api_client.v2.api.rum_insights_api import RUMInsightsApi
8585
from datadog_api_client.v2.api.rum_retention_filters_hardcoded_api import RUMRetentionFiltersHardcodedApi
8686
from datadog_api_client.v2.api.reference_tables_api import ReferenceTablesApi
87+
from datadog_api_client.v2.api.report_schedules_api import ReportSchedulesApi
8788
from datadog_api_client.v2.api.restriction_policies_api import RestrictionPoliciesApi
8889
from datadog_api_client.v2.api.roles_api import RolesApi
8990
from datadog_api_client.v2.api.rum_audience_management_api import RumAudienceManagementApi
@@ -209,6 +210,7 @@
209210
"RUMInsightsApi",
210211
"RUMRetentionFiltersHardcodedApi",
211212
"ReferenceTablesApi",
213+
"ReportSchedulesApi",
212214
"RestrictionPoliciesApi",
213215
"RolesApi",
214216
"RumAudienceManagementApi",

0 commit comments

Comments
 (0)