Skip to content

Commit 46a4237

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 3e3bf46c of spec repo
1 parent 9e6633c commit 46a4237

File tree

8 files changed

+131
-11
lines changed

8 files changed

+131
-11
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-05-19 17:45:11.035218",
8-
"spec_repo_commit": "77e5efb9"
7+
"regenerated": "2025-05-20 12:22:25.982153",
8+
"spec_repo_commit": "3e3bf46c"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-05-19 17:45:11.092406",
13-
"spec_repo_commit": "77e5efb9"
12+
"regenerated": "2025-05-20 12:22:25.997865",
13+
"spec_repo_commit": "3e3bf46c"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14944,6 +14944,10 @@ components:
1494414944
FindingAttributes:
1494514945
description: The JSON:API attributes of the finding.
1494614946
properties:
14947+
datadog_link:
14948+
$ref: '#/components/schemas/FindingDatadogLink'
14949+
description:
14950+
$ref: '#/components/schemas/FindingDescription'
1494714951
evaluation:
1494814952
$ref: '#/components/schemas/FindingEvaluation'
1494914953
evaluation_changed_at:
@@ -14965,6 +14969,22 @@ components:
1496514969
vulnerability_type:
1496614970
$ref: '#/components/schemas/FindingVulnerabilityType'
1496714971
type: object
14972+
FindingDatadogLink:
14973+
description: The Datadog relative link for this finding.
14974+
example: /security/compliance?panels=cpfinding%7Cevent%7CruleId%3Adef-000-u5t%7CresourceId%3Ae8c9ab7c52ebd7bf2fdb4db641082d7d%7CtabId%3Aoverview
14975+
type: string
14976+
FindingDescription:
14977+
description: The description and remediation steps for this finding.
14978+
example: '## Remediation
14979+
14980+
14981+
1. In the console, go to **Storage Account**.
14982+
14983+
2. For each Storage Account, navigate to **Data Protection**.
14984+
14985+
3. Select **Set soft delete enabled** and enter the number of days to retain
14986+
soft deleted data.'
14987+
type: string
1496814988
FindingEvaluation:
1496914989
description: The evaluation of the finding.
1497014990
enum:
@@ -52046,13 +52066,18 @@ paths:
5204652066
the equal sign: `filter[evaluation_changed_at]=>=1678809373257`.\n\nQuery
5204752067
parameters must be only among the documented ones and with values of correct
5204852068
types. Duplicated query parameters (e.g. `filter[status]=low&filter[status]=info`)
52049-
are not allowed.\n\n### Response\n\nThe response includes an array of finding
52050-
objects, pagination metadata, and a count of items that match the query.\n\nEach
52051-
finding object contains the following:\n\n- The finding ID that can be used
52052-
in a `GetFinding` request to retrieve the full finding details.\n- Core attributes,
52053-
including status, evaluation, high-level resource details, muted state, and
52054-
rule details.\n- `evaluation_changed_at` and `resource_discovery_date` time
52055-
stamps.\n- An array of associated tags.\n"
52069+
are not allowed.\n\n### Additional extension fields\n\nAdditional extension
52070+
fields are available for some findings.\n\nThe data is available when you
52071+
include the query parameter `?detailed_findings=true` in the request.\n\nThe
52072+
following fields are available for findings:\n- `description`: The description
52073+
and remediation steps for the finding.\n- `datadog_link`: The Datadog relative
52074+
link for the finding.\n\n### Response\n\nThe response includes an array of
52075+
finding objects, pagination metadata, and a count of items that match the
52076+
query.\n\nEach finding object contains the following:\n\n- The finding ID
52077+
that can be used in a `GetFinding` request to retrieve the full finding details.\n-
52078+
Core attributes, including status, evaluation, high-level resource details,
52079+
muted state, and rule details.\n- `evaluation_changed_at` and `resource_discovery_date`
52080+
time stamps.\n- An array of associated tags.\n"
5205652081
operationId: ListFindings
5205752082
parameters:
5205852083
- description: Limit the number of findings returned. Must be <= 1000.
@@ -52155,6 +52180,14 @@ paths:
5215552180
items:
5215652181
$ref: '#/components/schemas/FindingVulnerabilityType'
5215752182
type: array
52183+
- description: Return additional fields for some findings.
52184+
example:
52185+
- true
52186+
in: query
52187+
name: detailed_findings
52188+
required: false
52189+
schema:
52190+
type: boolean
5215852191
responses:
5215952192
'200':
5216052193
content:
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
List findings returns "OK" response with details
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi
7+
8+
configuration = Configuration()
9+
configuration.unstable_operations["list_findings"] = True
10+
with ApiClient(configuration) as api_client:
11+
api_instance = SecurityMonitoringApi(api_client)
12+
response = api_instance.list_findings(
13+
detailed_findings=True,
14+
)
15+
16+
print(response)

src/datadog_api_client/v2/api/security_monitoring_api.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,11 @@ def __init__(self, api_client=None):
961961
"location": "query",
962962
"collection_format": "multi",
963963
},
964+
"detailed_findings": {
965+
"openapi_types": (bool,),
966+
"attribute": "detailed_findings",
967+
"location": "query",
968+
},
964969
},
965970
headers_map={
966971
"accept": ["application/json"],
@@ -2372,6 +2377,7 @@ def list_findings(
23722377
filter_evaluation: Union[FindingEvaluation, UnsetType] = unset,
23732378
filter_status: Union[FindingStatus, UnsetType] = unset,
23742379
filter_vulnerability_type: Union[List[FindingVulnerabilityType], UnsetType] = unset,
2380+
detailed_findings: Union[bool, UnsetType] = unset,
23752381
) -> ListFindingsResponse:
23762382
"""List findings.
23772383
@@ -2397,6 +2403,17 @@ def list_findings(
23972403
23982404
Query parameters must be only among the documented ones and with values of correct types. Duplicated query parameters (e.g. ``filter[status]=low&filter[status]=info`` ) are not allowed.
23992405
2406+
**Additional extension fields**
2407+
2408+
Additional extension fields are available for some findings.
2409+
2410+
The data is available when you include the query parameter ``?detailed_findings=true`` in the request.
2411+
2412+
The following fields are available for findings:
2413+
2414+
* ``description`` : The description and remediation steps for the finding.
2415+
* ``datadog_link`` : The Datadog relative link for the finding.
2416+
24002417
**Response**
24012418
24022419
The response includes an array of finding objects, pagination metadata, and a count of items that match the query.
@@ -2434,6 +2451,8 @@ def list_findings(
24342451
:type filter_status: FindingStatus, optional
24352452
:param filter_vulnerability_type: Return findings that match the selected vulnerability types (repeatable).
24362453
:type filter_vulnerability_type: [FindingVulnerabilityType], optional
2454+
:param detailed_findings: Return additional fields for some findings.
2455+
:type detailed_findings: bool, optional
24372456
:rtype: ListFindingsResponse
24382457
"""
24392458
kwargs: Dict[str, Any] = {}
@@ -2476,6 +2495,9 @@ def list_findings(
24762495
if filter_vulnerability_type is not unset:
24772496
kwargs["filter_vulnerability_type"] = filter_vulnerability_type
24782497

2498+
if detailed_findings is not unset:
2499+
kwargs["detailed_findings"] = detailed_findings
2500+
24792501
return self._list_findings_endpoint.call_with_http_info(**kwargs)
24802502

24812503
def list_findings_with_pagination(
@@ -2494,6 +2516,7 @@ def list_findings_with_pagination(
24942516
filter_evaluation: Union[FindingEvaluation, UnsetType] = unset,
24952517
filter_status: Union[FindingStatus, UnsetType] = unset,
24962518
filter_vulnerability_type: Union[List[FindingVulnerabilityType], UnsetType] = unset,
2519+
detailed_findings: Union[bool, UnsetType] = unset,
24972520
) -> collections.abc.Iterable[Finding]:
24982521
"""List findings.
24992522
@@ -2525,6 +2548,8 @@ def list_findings_with_pagination(
25252548
:type filter_status: FindingStatus, optional
25262549
:param filter_vulnerability_type: Return findings that match the selected vulnerability types (repeatable).
25272550
:type filter_vulnerability_type: [FindingVulnerabilityType], optional
2551+
:param detailed_findings: Return additional fields for some findings.
2552+
:type detailed_findings: bool, optional
25282553
25292554
:return: A generator of paginated results.
25302555
:rtype: collections.abc.Iterable[Finding]
@@ -2569,6 +2594,9 @@ def list_findings_with_pagination(
25692594
if filter_vulnerability_type is not unset:
25702595
kwargs["filter_vulnerability_type"] = filter_vulnerability_type
25712596

2597+
if detailed_findings is not unset:
2598+
kwargs["detailed_findings"] = detailed_findings
2599+
25722600
local_page_size = get_attribute_from_path(kwargs, "page_limit", 100)
25732601
endpoint = self._list_findings_endpoint
25742602
set_attribute_from_path(kwargs, "page_limit", local_page_size, endpoint.params_map)

src/datadog_api_client/v2/model/finding_attributes.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ def openapi_types(_):
4040
from datadog_api_client.v2.model.finding_vulnerability_type import FindingVulnerabilityType
4141

4242
return {
43+
"datadog_link": (str,),
44+
"description": (str,),
4345
"evaluation": (FindingEvaluation,),
4446
"evaluation_changed_at": (int,),
4547
"mute": (FindingMute,),
@@ -53,6 +55,8 @@ def openapi_types(_):
5355
}
5456

5557
attribute_map = {
58+
"datadog_link": "datadog_link",
59+
"description": "description",
5660
"evaluation": "evaluation",
5761
"evaluation_changed_at": "evaluation_changed_at",
5862
"mute": "mute",
@@ -67,6 +71,8 @@ def openapi_types(_):
6771

6872
def __init__(
6973
self_,
74+
datadog_link: Union[str, UnsetType] = unset,
75+
description: Union[str, UnsetType] = unset,
7076
evaluation: Union[FindingEvaluation, UnsetType] = unset,
7177
evaluation_changed_at: Union[int, UnsetType] = unset,
7278
mute: Union[FindingMute, UnsetType] = unset,
@@ -82,6 +88,12 @@ def __init__(
8288
"""
8389
The JSON:API attributes of the finding.
8490
91+
:param datadog_link: The Datadog relative link for this finding.
92+
:type datadog_link: str, optional
93+
94+
:param description: The description and remediation steps for this finding.
95+
:type description: str, optional
96+
8597
:param evaluation: The evaluation of the finding.
8698
:type evaluation: FindingEvaluation, optional
8799
@@ -112,6 +124,10 @@ def __init__(
112124
:param vulnerability_type: The vulnerability type of the finding.
113125
:type vulnerability_type: FindingVulnerabilityType, optional
114126
"""
127+
if datadog_link is not unset:
128+
kwargs["datadog_link"] = datadog_link
129+
if description is not unset:
130+
kwargs["description"] = description
115131
if evaluation is not unset:
116132
kwargs["evaluation"] = evaluation
117133
if evaluation_changed_at is not unset:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-05-20T12:11:24.321Z
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
interactions:
2+
- request:
3+
body: null
4+
headers:
5+
accept:
6+
- application/json
7+
method: GET
8+
uri: https://api.datadoghq.com/api/v2/posture_management/findings?detailed_findings=true
9+
response:
10+
body:
11+
string: '{"data":[],"meta":{"page":{"total_filtered_count":0},"snapshot_timestamp":1747743085077}}'
12+
headers:
13+
content-type:
14+
- application/vnd.api+json
15+
status:
16+
code: 200
17+
message: OK
18+
version: 1

tests/v2/features/security_monitoring.feature

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,14 @@ Feature: Security Monitoring
840840
Then the response status is 200 OK
841841
And the response "data[0].type" is equal to "finding"
842842

843+
@team:DataDog/cloud-security-posture-management
844+
Scenario: List findings returns "OK" response with details
845+
Given operation "ListFindings" enabled
846+
And new "ListFindings" request
847+
And request contains "detailed_findings" parameter with value true
848+
When the request is sent
849+
Then the response status is 200 OK
850+
843851
@generated @skip @team:DataDog/cloud-security-posture-management @with-pagination
844852
Scenario: List findings returns "OK" response with pagination
845853
Given operation "ListFindings" enabled

0 commit comments

Comments
 (0)