Skip to content

Commit d13e137

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

9 files changed

Lines changed: 355 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:
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Get a single entity context returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.get_single_entity_context".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
8+
p api_instance.get_single_entity_context("user@example.com")

features/scenarios_model_mapping.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2306,6 +2306,12 @@
23062306
"limit" => "Integer",
23072307
"page_token" => "String",
23082308
},
2309+
"v2.GetSingleEntityContext" => {
2310+
"id" => "String",
2311+
"from" => "String",
2312+
"to" => "String",
2313+
"as_of" => "String",
2314+
},
23092315
"v2.ListSecurityMonitoringRules" => {
23102316
"page_size" => "Integer",
23112317
"page_number" => "Integer",

features/v2/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

features/v2/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": {

lib/datadog_api_client/configuration.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ def initialize
360360
"v2.get_security_monitoring_histsignals_by_job_id": false,
361361
"v2.get_security_monitoring_integration_config": false,
362362
"v2.get_signal_entities": false,
363+
"v2.get_single_entity_context": false,
363364
"v2.get_static_analysis_default_rulesets": false,
364365
"v2.get_static_analysis_node_types": false,
365366
"v2.get_static_analysis_ruleset": false,

lib/datadog_api_client/inflector.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6527,6 +6527,7 @@ def overrides
65276527
"v2.single_aggregated_dns_response_data_attributes_group_by_items" => "SingleAggregatedDnsResponseDataAttributesGroupByItems",
65286528
"v2.single_aggregated_dns_response_data_attributes_metrics_items" => "SingleAggregatedDnsResponseDataAttributesMetricsItems",
65296529
"v2.single_aggregated_dns_response_data_type" => "SingleAggregatedDnsResponseDataType",
6530+
"v2.single_entity_context_response" => "SingleEntityContextResponse",
65306531
"v2.slack_integration_metadata" => "SlackIntegrationMetadata",
65316532
"v2.slack_integration_metadata_channel_item" => "SlackIntegrationMetadataChannelItem",
65326533
"v2.slack_trigger_wrapper" => "SlackTriggerWrapper",

lib/datadog_api_client/v2/api/security_monitoring_api.rb

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5494,6 +5494,86 @@ def get_signal_notification_rules_with_http_info(opts = {})
54945494
return data, status_code, headers
54955495
end
54965496

5497+
# Get a single entity context.
5498+
#
5499+
# @see #get_single_entity_context_with_http_info
5500+
def get_single_entity_context(id, opts = {})
5501+
data, _status_code, _headers = get_single_entity_context_with_http_info(id, opts)
5502+
data
5503+
end
5504+
5505+
# Get a single entity context.
5506+
#
5507+
# Get a single entity from the Cloud SIEM entity context store by its identifier, returning the historical
5508+
# revisions of the entity in the requested time range. The endpoint can either return revisions across an
5509+
# interval (`from` / `to`) or the snapshot of the entity at a single point in time (`as_of`); the two modes
5510+
# are mutually exclusive.
5511+
#
5512+
# @param id [String] The unique identifier of the entity to retrieve.
5513+
# @param opts [Hash] the optional parameters
5514+
# @option opts [String] :from The start of the time range to query, as an RFC3339 timestamp or a relative time (for example, `now-7d`). Defaults to `now-7d`. Ignored when `as_of` is set.
5515+
# @option opts [String] :to The end of the time range to query, as an RFC3339 timestamp or a relative time (for example, `now`). Defaults to `now`. Ignored when `as_of` is set.
5516+
# @option opts [String] :as_of A point in time at which to query the entity revisions, as an RFC3339 timestamp, a Unix timestamp (in seconds), or a relative time (for example, `now-1d`). When set, `from` and `to` are ignored. Cannot be combined with custom `from` / `to` values.
5517+
# @return [Array<(SingleEntityContextResponse, Integer, Hash)>] SingleEntityContextResponse data, response status code and response headers
5518+
def get_single_entity_context_with_http_info(id, opts = {})
5519+
unstable_enabled = @api_client.config.unstable_operations["v2.get_single_entity_context".to_sym]
5520+
if unstable_enabled
5521+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_single_entity_context")
5522+
else
5523+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_single_entity_context"))
5524+
end
5525+
5526+
if @api_client.config.debugging
5527+
@api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_single_entity_context ...'
5528+
end
5529+
# verify the required parameter 'id' is set
5530+
if @api_client.config.client_side_validation && id.nil?
5531+
fail ArgumentError, "Missing the required parameter 'id' when calling SecurityMonitoringAPI.get_single_entity_context"
5532+
end
5533+
# resource path
5534+
local_var_path = '/api/v2/security_monitoring/entity_context/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))
5535+
5536+
# query parameters
5537+
query_params = opts[:query_params] || {}
5538+
query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
5539+
query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
5540+
query_params[:'as_of'] = opts[:'as_of'] if !opts[:'as_of'].nil?
5541+
5542+
# header parameters
5543+
header_params = opts[:header_params] || {}
5544+
# HTTP header 'Accept' (if needed)
5545+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
5546+
5547+
# form parameters
5548+
form_params = opts[:form_params] || {}
5549+
5550+
# http body (model)
5551+
post_body = opts[:debug_body]
5552+
5553+
# return_type
5554+
return_type = opts[:debug_return_type] || 'SingleEntityContextResponse'
5555+
5556+
# auth_names
5557+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
5558+
5559+
new_options = opts.merge(
5560+
:operation => :get_single_entity_context,
5561+
:header_params => header_params,
5562+
:query_params => query_params,
5563+
:form_params => form_params,
5564+
:body => post_body,
5565+
:auth_names => auth_names,
5566+
:return_type => return_type,
5567+
:api_version => "V2"
5568+
)
5569+
5570+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
5571+
if @api_client.config.debugging
5572+
@api_client.config.logger.debug "API called: SecurityMonitoringAPI#get_single_entity_context\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
5573+
end
5574+
return data, status_code, headers
5575+
end
5576+
54975577
# Get default rulesets for a language.
54985578
#
54995579
# @see #get_static_analysis_default_rulesets_with_http_info

0 commit comments

Comments
 (0)