Skip to content

Commit 5b771c6

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit c591f36 of spec repo
1 parent d765a5b commit 5b771c6

29 files changed

Lines changed: 2157 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 594 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
@@ -592,6 +592,13 @@ datadog\_api\_client.v2.api.reference\_tables\_api module
592592
:members:
593593
:show-inheritance:
594594

595+
datadog\_api\_client.v2.api.report\_schedules\_api module
596+
---------------------------------------------------------
597+
598+
.. automodule:: datadog_api_client.v2.api.report_schedules_api
599+
:members:
600+
:show-inheritance:
601+
595602
datadog\_api\_client.v2.api.restriction\_policies\_api module
596603
-------------------------------------------------------------
597604

docs/datadog_api_client.v2.model.rst

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

30443+
datadog\_api\_client.v2.model.report\_schedule\_author module
30444+
-------------------------------------------------------------
30445+
30446+
.. automodule:: datadog_api_client.v2.model.report_schedule_author
30447+
:members:
30448+
:show-inheritance:
30449+
30450+
datadog\_api\_client.v2.model.report\_schedule\_author\_attributes module
30451+
-------------------------------------------------------------------------
30452+
30453+
.. automodule:: datadog_api_client.v2.model.report_schedule_author_attributes
30454+
:members:
30455+
:show-inheritance:
30456+
30457+
datadog\_api\_client.v2.model.report\_schedule\_author\_type module
30458+
-------------------------------------------------------------------
30459+
30460+
.. automodule:: datadog_api_client.v2.model.report_schedule_author_type
30461+
:members:
30462+
:show-inheritance:
30463+
30464+
datadog\_api\_client.v2.model.report\_schedule\_create\_request module
30465+
----------------------------------------------------------------------
30466+
30467+
.. automodule:: datadog_api_client.v2.model.report_schedule_create_request
30468+
:members:
30469+
:show-inheritance:
30470+
30471+
datadog\_api\_client.v2.model.report\_schedule\_create\_request\_attributes module
30472+
----------------------------------------------------------------------------------
30473+
30474+
.. automodule:: datadog_api_client.v2.model.report_schedule_create_request_attributes
30475+
:members:
30476+
:show-inheritance:
30477+
30478+
datadog\_api\_client.v2.model.report\_schedule\_create\_request\_data module
30479+
----------------------------------------------------------------------------
30480+
30481+
.. automodule:: datadog_api_client.v2.model.report_schedule_create_request_data
30482+
:members:
30483+
:show-inheritance:
30484+
30485+
datadog\_api\_client.v2.model.report\_schedule\_delivery\_format module
30486+
-----------------------------------------------------------------------
30487+
30488+
.. automodule:: datadog_api_client.v2.model.report_schedule_delivery_format
30489+
:members:
30490+
:show-inheritance:
30491+
30492+
datadog\_api\_client.v2.model.report\_schedule\_included\_resource module
30493+
-------------------------------------------------------------------------
30494+
30495+
.. automodule:: datadog_api_client.v2.model.report_schedule_included_resource
30496+
:members:
30497+
:show-inheritance:
30498+
30499+
datadog\_api\_client.v2.model.report\_schedule\_patch\_request module
30500+
---------------------------------------------------------------------
30501+
30502+
.. automodule:: datadog_api_client.v2.model.report_schedule_patch_request
30503+
:members:
30504+
:show-inheritance:
30505+
30506+
datadog\_api\_client.v2.model.report\_schedule\_patch\_request\_attributes module
30507+
---------------------------------------------------------------------------------
30508+
30509+
.. automodule:: datadog_api_client.v2.model.report_schedule_patch_request_attributes
30510+
:members:
30511+
:show-inheritance:
30512+
30513+
datadog\_api\_client.v2.model.report\_schedule\_patch\_request\_data module
30514+
---------------------------------------------------------------------------
30515+
30516+
.. automodule:: datadog_api_client.v2.model.report_schedule_patch_request_data
30517+
:members:
30518+
:show-inheritance:
30519+
30520+
datadog\_api\_client.v2.model.report\_schedule\_resource\_type module
30521+
---------------------------------------------------------------------
30522+
30523+
.. automodule:: datadog_api_client.v2.model.report_schedule_resource_type
30524+
:members:
30525+
:show-inheritance:
30526+
30527+
datadog\_api\_client.v2.model.report\_schedule\_response module
30528+
---------------------------------------------------------------
30529+
30530+
.. automodule:: datadog_api_client.v2.model.report_schedule_response
30531+
:members:
30532+
:show-inheritance:
30533+
30534+
datadog\_api\_client.v2.model.report\_schedule\_response\_attributes module
30535+
---------------------------------------------------------------------------
30536+
30537+
.. automodule:: datadog_api_client.v2.model.report_schedule_response_attributes
30538+
:members:
30539+
:show-inheritance:
30540+
30541+
datadog\_api\_client.v2.model.report\_schedule\_response\_attributes\_delivery\_format module
30542+
---------------------------------------------------------------------------------------------
30543+
30544+
.. automodule:: datadog_api_client.v2.model.report_schedule_response_attributes_delivery_format
30545+
:members:
30546+
:show-inheritance:
30547+
30548+
datadog\_api\_client.v2.model.report\_schedule\_response\_data module
30549+
---------------------------------------------------------------------
30550+
30551+
.. automodule:: datadog_api_client.v2.model.report_schedule_response_data
30552+
:members:
30553+
:show-inheritance:
30554+
30555+
datadog\_api\_client.v2.model.report\_schedule\_status module
30556+
-------------------------------------------------------------
30557+
30558+
.. automodule:: datadog_api_client.v2.model.report_schedule_status
30559+
:members:
30560+
:show-inheritance:
30561+
30562+
datadog\_api\_client.v2.model.report\_schedule\_template\_variable module
30563+
-------------------------------------------------------------------------
30564+
30565+
.. automodule:: datadog_api_client.v2.model.report_schedule_template_variable
30566+
:members:
30567+
:show-inheritance:
30568+
30569+
datadog\_api\_client.v2.model.report\_schedule\_type module
30570+
-----------------------------------------------------------
30571+
30572+
.. automodule:: datadog_api_client.v2.model.report_schedule_type
30573+
:members:
30574+
:show-inheritance:
30575+
3044330576
datadog\_api\_client.v2.model.resolve\_vulnerable\_symbols\_request module
3044430577
--------------------------------------------------------------------------
3044530578

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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+
recipients=[
21+
"user@example.com",
22+
"slack:T01234567.C01234567.alerts",
23+
"teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2",
24+
],
25+
resource_id="abc-def-ghi",
26+
resource_type=ReportScheduleResourceType.DASHBOARD,
27+
rrule="DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0",
28+
tab_id="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.create_report_schedule(body=body)
49+
50+
print(response)
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
recipients=[
21+
"user@example.com",
22+
"slack:T01234567.C01234567.alerts",
23+
"teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2",
24+
],
25+
rrule="DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0",
26+
tab_id=UUID("66666666-7777-8888-9999-000000000000"),
27+
template_variables=[
28+
ReportScheduleTemplateVariable(
29+
name="env",
30+
values=[
31+
"prod",
32+
],
33+
),
34+
],
35+
timeframe="1w",
36+
timezone="America/New_York",
37+
title="Weekly Infrastructure Report",
38+
),
39+
type=ReportScheduleType.SCHEDULE,
40+
),
41+
)
42+
43+
configuration = Configuration()
44+
with ApiClient(configuration) as api_client:
45+
api_instance = ReportSchedulesApi(api_client)
46+
response = api_instance.patch_report_schedule(schedule_uuid=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), body=body)
47+
48+
print(response)
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
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 or integration
21+
dashboard on a recurring cadence and delivers it to a set of recipients over email, Slack,
22+
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 or integration dashboard
83+
on a recurring cadence and delivers it to the configured recipients over email, Slack,
84+
or Microsoft Teams.
85+
Requires the ``generate_dashboard_reports`` permission.
86+
87+
:type body: ReportScheduleCreateRequest
88+
:rtype: ReportScheduleResponse
89+
"""
90+
kwargs: Dict[str, Any] = {}
91+
kwargs["body"] = body
92+
93+
return self._create_report_schedule_endpoint.call_with_http_info(**kwargs)
94+
95+
def patch_report_schedule(
96+
self,
97+
schedule_uuid: UUID,
98+
body: ReportSchedulePatchRequest,
99+
) -> ReportScheduleResponse:
100+
"""Update a report schedule.
101+
102+
Update an existing scheduled report by its identifier. The editable attributes
103+
are replaced with the supplied values; the targeted resource ( ``resource_id`` and
104+
``resource_type`` ) cannot be changed after creation.
105+
Requires the ``generate_dashboard_reports`` permission and schedule ownership.
106+
107+
:param schedule_uuid: The unique identifier of the report schedule to update.
108+
:type schedule_uuid: UUID
109+
:type body: ReportSchedulePatchRequest
110+
:rtype: ReportScheduleResponse
111+
"""
112+
kwargs: Dict[str, Any] = {}
113+
kwargs["schedule_uuid"] = schedule_uuid
114+
115+
kwargs["body"] = body
116+
117+
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
@@ -85,6 +85,7 @@
8585
from datadog_api_client.v2.api.rum_insights_api import RUMInsightsApi
8686
from datadog_api_client.v2.api.rum_retention_filters_hardcoded_api import RUMRetentionFiltersHardcodedApi
8787
from datadog_api_client.v2.api.reference_tables_api import ReferenceTablesApi
88+
from datadog_api_client.v2.api.report_schedules_api import ReportSchedulesApi
8889
from datadog_api_client.v2.api.restriction_policies_api import RestrictionPoliciesApi
8990
from datadog_api_client.v2.api.roles_api import RolesApi
9091
from datadog_api_client.v2.api.rum_audience_management_api import RumAudienceManagementApi
@@ -211,6 +212,7 @@
211212
"RUMInsightsApi",
212213
"RUMRetentionFiltersHardcodedApi",
213214
"ReferenceTablesApi",
215+
"ReportSchedulesApi",
214216
"RestrictionPoliciesApi",
215217
"RolesApi",
216218
"RumAudienceManagementApi",

0 commit comments

Comments
 (0)