Skip to content

Commit 9294cf9

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 9ebecac of spec repo (#3661)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent f7253f2 commit 9294cf9

9 files changed

Lines changed: 284 additions & 5 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 106 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31464,9 +31464,10 @@ components:
3146431464
additionalProperties: {}
3146531465
description: The set of attributes recorded for the entity at this revision. The keys depend on the kind of entity.
3146631466
example:
31467+
accounts:
31468+
- linked-account-123
3146731469
display_name: Test User
31468-
emails:
31469-
- user@example.com
31470+
email: user@example.com
3147031471
principal_id: user@example.com
3147131472
type: object
3147231473
EntityData:
@@ -88286,6 +88287,14 @@ components:
8828688287
type: string
8828788288
x-enum-varnames:
8828888289
- AGGREGATED_DNS
88290+
SingleEntityContextResponse:
88291+
description: Response from the single entity context endpoint, containing the matching entity.
88292+
properties:
88293+
data:
88294+
$ref: "#/components/schemas/EntityContextEntity"
88295+
required:
88296+
- data
88297+
type: object
8828988298
SlackIntegrationMetadata:
8829088299
description: Incident integration metadata for the Slack integration.
8829188300
properties:
@@ -166474,9 +166483,10 @@ paths:
166474166483
- attributes:
166475166484
revisions:
166476166485
- attributes:
166486+
accounts:
166487+
- linked-account-123
166477166488
display_name: Test User
166478-
emails:
166479-
- user@example.com
166489+
email: user@example.com
166480166490
principal_id: user@example.com
166481166491
first_seen_at: "2026-04-01T00:00:00Z"
166482166492
last_seen_at: "2026-05-01T00:00:00Z"
@@ -166507,7 +166517,98 @@ paths:
166507166517
permissions:
166508166518
- siem_entities_read
166509166519
x-unstable: |-
166510-
**Note**: This endpoint is in preview and is subject to change.
166520+
**Note**: This endpoint is in Preview and is subject to change.
166521+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
166522+
/api/v2/security_monitoring/entity_context/{id}:
166523+
get:
166524+
description: |-
166525+
Get a single entity from the Cloud SIEM entity context store by its identifier, returning the historical
166526+
revisions of the entity in the requested time range. The endpoint can either return revisions across an
166527+
interval (`from` / `to`) or the snapshot of the entity at a single point in time (`as_of`); the two modes
166528+
are mutually exclusive.
166529+
operationId: GetSingleEntityContext
166530+
parameters:
166531+
- description: The unique identifier of the entity to retrieve.
166532+
in: path
166533+
name: id
166534+
required: true
166535+
schema:
166536+
example: user@example.com
166537+
type: string
166538+
- description: |-
166539+
The start of the time range to query, as an RFC3339 timestamp or a relative time (for example, `now-7d`).
166540+
Defaults to `now-7d`. Ignored when `as_of` is set.
166541+
in: query
166542+
name: from
166543+
required: false
166544+
schema:
166545+
default: now-7d
166546+
example: now-7d
166547+
type: string
166548+
- description: |-
166549+
The end of the time range to query, as an RFC3339 timestamp or a relative time (for example, `now`).
166550+
Defaults to `now`. Ignored when `as_of` is set.
166551+
in: query
166552+
name: to
166553+
required: false
166554+
schema:
166555+
default: now
166556+
example: now
166557+
type: string
166558+
- description: |-
166559+
A point in time at which to query the entity revisions, as an RFC3339 timestamp, a Unix timestamp
166560+
(in seconds), or a relative time (for example, `now-1d`). When set, `from` and `to` are ignored.
166561+
Cannot be combined with custom `from` / `to` values.
166562+
example: now-1d
166563+
in: query
166564+
name: as_of
166565+
required: false
166566+
schema:
166567+
type: string
166568+
responses:
166569+
"200":
166570+
content:
166571+
application/json:
166572+
examples:
166573+
default:
166574+
value:
166575+
data:
166576+
attributes:
166577+
revisions:
166578+
- attributes:
166579+
accounts:
166580+
- linked-account-123
166581+
display_name: Test User
166582+
email: user@example.com
166583+
principal_id: user@example.com
166584+
first_seen_at: "2026-04-01T00:00:00Z"
166585+
last_seen_at: "2026-05-01T00:00:00Z"
166586+
id: user@example.com
166587+
type: siem_entity_identity
166588+
schema:
166589+
$ref: "#/components/schemas/SingleEntityContextResponse"
166590+
description: OK
166591+
"400":
166592+
$ref: "#/components/responses/BadRequestResponse"
166593+
"403":
166594+
$ref: "#/components/responses/NotAuthorizedResponse"
166595+
"404":
166596+
$ref: "#/components/responses/NotFoundResponse"
166597+
"429":
166598+
$ref: "#/components/responses/TooManyRequestsResponse"
166599+
security:
166600+
- apiKeyAuth: []
166601+
appKeyAuth: []
166602+
- AuthZ:
166603+
- siem_entities_read
166604+
summary: Get a single entity context
166605+
tags: ["Security Monitoring"]
166606+
x-permission:
166607+
operator: OR
166608+
permissions:
166609+
- siem_entities_read
166610+
x-unstable: |-
166611+
**Note**: This endpoint is in Preview and is subject to change.
166511166612
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
166512166613
/api/v2/security_monitoring/rules:
166513166614
get:

docs/datadog_api_client.v2.model.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37965,6 +37965,13 @@ datadog\_api\_client.v2.model.single\_aggregated\_dns\_response\_data\_type modu
3796537965
:members:
3796637966
:show-inheritance:
3796737967

37968+
datadog\_api\_client.v2.model.single\_entity\_context\_response module
37969+
----------------------------------------------------------------------
37970+
37971+
.. automodule:: datadog_api_client.v2.model.single_entity_context_response
37972+
:members:
37973+
:show-inheritance:
37974+
3796837975
datadog\_api\_client.v2.model.slack\_integration\_metadata module
3796937976
-----------------------------------------------------------------
3797037977

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
Get a single entity context returns "OK" response
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["get_single_entity_context"] = True
10+
with ApiClient(configuration) as api_client:
11+
api_instance = SecurityMonitoringApi(api_client)
12+
response = api_instance.get_single_entity_context(
13+
id="user@example.com",
14+
)
15+
16+
print(response)

src/datadog_api_client/configuration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ def __init__(
418418
"v2.get_security_monitoring_histsignals_by_job_id": False,
419419
"v2.get_security_monitoring_integration_config": False,
420420
"v2.get_signal_entities": False,
421+
"v2.get_single_entity_context": False,
421422
"v2.get_static_analysis_default_rulesets": False,
422423
"v2.get_static_analysis_node_types": False,
423424
"v2.get_static_analysis_ruleset": False,

src/datadog_api_client/v2/api/security_monitoring_api.py

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@
156156
SecurityMonitoringDatasetVersionHistoryResponse,
157157
)
158158
from datadog_api_client.v2.model.entity_context_response import EntityContextResponse
159+
from datadog_api_client.v2.model.single_entity_context_response import SingleEntityContextResponse
159160
from datadog_api_client.v2.model.security_monitoring_list_rules_response import SecurityMonitoringListRulesResponse
160161
from datadog_api_client.v2.model.security_monitoring_rule_sort import SecurityMonitoringRuleSort
161162
from datadog_api_client.v2.model.security_monitoring_rule_response import SecurityMonitoringRuleResponse
@@ -2102,6 +2103,44 @@ def __init__(self, api_client=None):
21022103
api_client=api_client,
21032104
)
21042105

2106+
self._get_single_entity_context_endpoint = _Endpoint(
2107+
settings={
2108+
"response_type": (SingleEntityContextResponse,),
2109+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
2110+
"endpoint_path": "/api/v2/security_monitoring/entity_context/{id}",
2111+
"operation_id": "get_single_entity_context",
2112+
"http_method": "GET",
2113+
"version": "v2",
2114+
},
2115+
params_map={
2116+
"id": {
2117+
"required": True,
2118+
"openapi_types": (str,),
2119+
"attribute": "id",
2120+
"location": "path",
2121+
},
2122+
"_from": {
2123+
"openapi_types": (str,),
2124+
"attribute": "from",
2125+
"location": "query",
2126+
},
2127+
"to": {
2128+
"openapi_types": (str,),
2129+
"attribute": "to",
2130+
"location": "query",
2131+
},
2132+
"as_of": {
2133+
"openapi_types": (str,),
2134+
"attribute": "as_of",
2135+
"location": "query",
2136+
},
2137+
},
2138+
headers_map={
2139+
"accept": ["application/json"],
2140+
},
2141+
api_client=api_client,
2142+
)
2143+
21052144
self._get_static_analysis_default_rulesets_endpoint = _Endpoint(
21062145
settings={
21072146
"response_type": (DefaultRulesetsPerLanguageResponse,),
@@ -5488,6 +5527,49 @@ def get_signal_notification_rules(
54885527
kwargs: Dict[str, Any] = {}
54895528
return self._get_signal_notification_rules_endpoint.call_with_http_info(**kwargs)
54905529

5530+
def get_single_entity_context(
5531+
self,
5532+
id: str,
5533+
*,
5534+
_from: Union[str, UnsetType] = unset,
5535+
to: Union[str, UnsetType] = unset,
5536+
as_of: Union[str, UnsetType] = unset,
5537+
) -> SingleEntityContextResponse:
5538+
"""Get a single entity context.
5539+
5540+
Get a single entity from the Cloud SIEM entity context store by its identifier, returning the historical
5541+
revisions of the entity in the requested time range. The endpoint can either return revisions across an
5542+
interval ( ``from`` / ``to`` ) or the snapshot of the entity at a single point in time ( ``as_of`` ); the two modes
5543+
are mutually exclusive.
5544+
5545+
:param id: The unique identifier of the entity to retrieve.
5546+
:type id: str
5547+
:param _from: The start of the time range to query, as an RFC3339 timestamp or a relative time (for example, ``now-7d`` ).
5548+
Defaults to ``now-7d``. Ignored when ``as_of`` is set.
5549+
:type _from: str, optional
5550+
:param to: The end of the time range to query, as an RFC3339 timestamp or a relative time (for example, ``now`` ).
5551+
Defaults to ``now``. Ignored when ``as_of`` is set.
5552+
:type to: str, optional
5553+
:param as_of: A point in time at which to query the entity revisions, as an RFC3339 timestamp, a Unix timestamp
5554+
(in seconds), or a relative time (for example, ``now-1d`` ). When set, ``from`` and ``to`` are ignored.
5555+
Cannot be combined with custom ``from`` / ``to`` values.
5556+
:type as_of: str, optional
5557+
:rtype: SingleEntityContextResponse
5558+
"""
5559+
kwargs: Dict[str, Any] = {}
5560+
kwargs["id"] = id
5561+
5562+
if _from is not unset:
5563+
kwargs["_from"] = _from
5564+
5565+
if to is not unset:
5566+
kwargs["to"] = to
5567+
5568+
if as_of is not unset:
5569+
kwargs["as_of"] = as_of
5570+
5571+
return self._get_single_entity_context_endpoint.call_with_http_info(**kwargs)
5572+
54915573
def get_static_analysis_default_rulesets(
54925574
self,
54935575
language: str,
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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 TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
)
12+
13+
14+
if TYPE_CHECKING:
15+
from datadog_api_client.v2.model.entity_context_entity import EntityContextEntity
16+
17+
18+
class SingleEntityContextResponse(ModelNormal):
19+
@cached_property
20+
def openapi_types(_):
21+
from datadog_api_client.v2.model.entity_context_entity import EntityContextEntity
22+
23+
return {
24+
"data": (EntityContextEntity,),
25+
}
26+
27+
attribute_map = {
28+
"data": "data",
29+
}
30+
31+
def __init__(self_, data: EntityContextEntity, **kwargs):
32+
"""
33+
Response from the single entity context endpoint, containing the matching entity.
34+
35+
:param data: A single entity returned by the entity context endpoint.
36+
:type data: EntityContextEntity
37+
"""
38+
super().__init__(kwargs)
39+
40+
self_.data = data

src/datadog_api_client/v2/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7689,6 +7689,7 @@
76897689
SingleAggregatedDnsResponseDataAttributesMetricsItems,
76907690
)
76917691
from datadog_api_client.v2.model.single_aggregated_dns_response_data_type import SingleAggregatedDnsResponseDataType
7692+
from datadog_api_client.v2.model.single_entity_context_response import SingleEntityContextResponse
76927693
from datadog_api_client.v2.model.slack_integration_metadata import SlackIntegrationMetadata
76937694
from datadog_api_client.v2.model.slack_integration_metadata_channel_item import SlackIntegrationMetadataChannelItem
76947695
from datadog_api_client.v2.model.slack_trigger_wrapper import SlackTriggerWrapper
@@ -14488,6 +14489,7 @@
1448814489
"SingleAggregatedDnsResponseDataAttributesGroupByItems",
1448914490
"SingleAggregatedDnsResponseDataAttributesMetricsItems",
1449014491
"SingleAggregatedDnsResponseDataType",
14492+
"SingleEntityContextResponse",
1449114493
"SlackIntegrationMetadata",
1449214494
"SlackIntegrationMetadataChannelItem",
1449314495
"SlackTriggerWrapper",

tests/v2/features/security_monitoring.feature

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,6 +1608,30 @@ Feature: Security Monitoring
16081608
When the request is sent
16091609
Then the response status is 200 OK
16101610

1611+
@generated @skip @team:DataDog/k9-cloud-siem
1612+
Scenario: Get a single entity context returns "Bad Request" response
1613+
Given operation "GetSingleEntityContext" enabled
1614+
And new "GetSingleEntityContext" request
1615+
And request contains "id" parameter from "REPLACE.ME"
1616+
When the request is sent
1617+
Then the response status is 400 Bad Request
1618+
1619+
@generated @skip @team:DataDog/k9-cloud-siem
1620+
Scenario: Get a single entity context returns "Not Found" response
1621+
Given operation "GetSingleEntityContext" enabled
1622+
And new "GetSingleEntityContext" request
1623+
And request contains "id" parameter from "REPLACE.ME"
1624+
When the request is sent
1625+
Then the response status is 404 Not Found
1626+
1627+
@generated @skip @team:DataDog/k9-cloud-siem
1628+
Scenario: Get a single entity context returns "OK" response
1629+
Given operation "GetSingleEntityContext" enabled
1630+
And new "GetSingleEntityContext" request
1631+
And request contains "id" parameter from "REPLACE.ME"
1632+
When the request is sent
1633+
Then the response status is 200 OK
1634+
16111635
@skip-validation @team:DataDog/k9-cloud-siem
16121636
Scenario: Get a suppression rule returns "Not Found" response
16131637
Given new "GetSecurityMonitoringSuppression" request

tests/v2/features/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7227,6 +7227,12 @@
72277227
"type": "safe"
72287228
}
72297229
},
7230+
"GetSingleEntityContext": {
7231+
"tag": "Security Monitoring",
7232+
"undo": {
7233+
"type": "safe"
7234+
}
7235+
},
72307236
"ListSecurityMonitoringRules": {
72317237
"tag": "Security Monitoring",
72327238
"undo": {

0 commit comments

Comments
 (0)