Skip to content

Commit c7eb36c

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 5f18afe of spec repo
1 parent 60c02c0 commit c7eb36c

10 files changed

Lines changed: 1018 additions & 0 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68667,6 +68667,68 @@ components:
6866768667
type: string
6866868668
x-enum-varnames:
6866968669
- MANAGED_ORGS
68670+
MatchingSignalAttributes:
68671+
description: Attributes of a matching security signal.
68672+
properties:
68673+
event_tracker_id:
68674+
description: The tracker ID linking the signal back to the originating event. Distinct from `id`, which identifies the matching signal itself.
68675+
example: AAAAAWgOAX0mtsWfeQAAAABzX1RyYWNrZXJfMTIzNDU2Nzg5MA
68676+
type: string
68677+
severity:
68678+
description: The severity of the signal.
68679+
example: high
68680+
type: string
68681+
title:
68682+
description: The title of the signal.
68683+
example: Unusual login activity detected
68684+
type: string
68685+
trigger_time_ms:
68686+
description: The Unix timestamp (in milliseconds) at which the signal was triggered.
68687+
example: 1707393746000
68688+
format: int64
68689+
type: integer
68690+
required:
68691+
- event_tracker_id
68692+
- severity
68693+
- title
68694+
- trigger_time_ms
68695+
type: object
68696+
MatchingSignalData:
68697+
description: A security signal that matches the queried event.
68698+
properties:
68699+
attributes:
68700+
$ref: "#/components/schemas/MatchingSignalAttributes"
68701+
id:
68702+
description: The ID of the matching signal.
68703+
example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA
68704+
type: string
68705+
type:
68706+
$ref: "#/components/schemas/MatchingSignalType"
68707+
required:
68708+
- id
68709+
- type
68710+
- attributes
68711+
type: object
68712+
MatchingSignalType:
68713+
default: matching_signal
68714+
description: The type of the resource. The value should always be `matching_signal`.
68715+
enum:
68716+
- matching_signal
68717+
example: matching_signal
68718+
type: string
68719+
x-enum-varnames:
68720+
- MATCHING_SIGNAL
68721+
MatchingSignalsResponse:
68722+
description: Response containing the list of security signals matching an event.
68723+
properties:
68724+
data:
68725+
description: Array of matching signals.
68726+
items:
68727+
$ref: "#/components/schemas/MatchingSignalData"
68728+
type: array
68729+
required:
68730+
- data
68731+
type: object
6867068732
MaxSessionDurationType:
6867168733
description: Data type of a maximum session duration update.
6867268734
enum: [max_session_duration]
@@ -209832,6 +209894,63 @@ paths:
209832209894
x-unstable: |-
209833209895
**Note**: This endpoint is in Preview and is subject to change.
209834209896
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
209897+
/api/v2/security_monitoring/events/{event_id}/matching_signals:
209898+
get:
209899+
description: Returns the list of security signals that match a given event on the given track.
209900+
operationId: GetMatchingSignals
209901+
parameters:
209902+
- description: The ID of the event to find matching signals for.
209903+
in: path
209904+
name: event_id
209905+
required: true
209906+
schema:
209907+
type: string
209908+
- description: The product track that the event belongs to.
209909+
in: query
209910+
name: track
209911+
required: true
209912+
schema:
209913+
type: string
209914+
responses:
209915+
"200":
209916+
content:
209917+
application/json:
209918+
examples:
209919+
default:
209920+
value:
209921+
data:
209922+
- attributes:
209923+
event_tracker_id: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA
209924+
severity: high
209925+
title: Unusual login activity detected
209926+
trigger_time_ms: 1707393746000
209927+
id: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA
209928+
type: matching_signal
209929+
schema:
209930+
$ref: "#/components/schemas/MatchingSignalsResponse"
209931+
description: OK
209932+
"400":
209933+
$ref: "#/components/responses/BadRequestResponse"
209934+
"403":
209935+
$ref: "#/components/responses/NotAuthorizedResponse"
209936+
"404":
209937+
$ref: "#/components/responses/NotFoundResponse"
209938+
"429":
209939+
$ref: "#/components/responses/TooManyRequestsResponse"
209940+
security:
209941+
- apiKeyAuth: []
209942+
appKeyAuth: []
209943+
- AuthZ:
209944+
- security_monitoring_signals_read
209945+
summary: Get signals matching an event
209946+
tags: ["Security Monitoring"]
209947+
x-permission:
209948+
operator: OR
209949+
permissions:
209950+
- security_monitoring_signals_read
209951+
x-unstable: |-
209952+
**Note**: This endpoint is in preview and is subject to change.
209953+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
209835209954
/api/v2/security_monitoring/rules:
209836209955
get:
209837209956
description: List rules.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Get signals matching an event returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.SecurityMonitoringApi;
6+
import com.datadog.api.client.v2.model.MatchingSignalsResponse;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
defaultClient.setUnstableOperationEnabled("v2.getMatchingSignals", true);
12+
SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient);
13+
14+
try {
15+
MatchingSignalsResponse result = apiInstance.getMatchingSignals("event_id", "track");
16+
System.out.println(result);
17+
} catch (ApiException e) {
18+
System.err.println("Exception when calling SecurityMonitoringApi#getMatchingSignals");
19+
System.err.println("Status code: " + e.getCode());
20+
System.err.println("Reason: " + e.getResponseBody());
21+
System.err.println("Response headers: " + e.getResponseHeaders());
22+
e.printStackTrace();
23+
}
24+
}
25+
}

src/main/java/com/datadog/api/client/ApiClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,7 @@ public class ApiClient {
10571057
put("v2.getFinding", false);
10581058
put("v2.getHistoricalJob", false);
10591059
put("v2.getIndicatorOfCompromise", false);
1060+
put("v2.getMatchingSignals", false);
10601061
put("v2.getRuleVersionHistory", false);
10611062
put("v2.getSecretsRules", false);
10621063
put("v2.getSecurityFindingsAutomationDefaultInboxRule", false);

src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
import com.datadog.api.client.v2.model.ListSecurityFindingsResponse;
7171
import com.datadog.api.client.v2.model.ListVulnerabilitiesResponse;
7272
import com.datadog.api.client.v2.model.ListVulnerableAssetsResponse;
73+
import com.datadog.api.client.v2.model.MatchingSignalsResponse;
7374
import com.datadog.api.client.v2.model.MuteFindingsRequest;
7475
import com.datadog.api.client.v2.model.MuteFindingsResponse;
7576
import com.datadog.api.client.v2.model.MuteRuleCreateRequest;
@@ -12393,6 +12394,186 @@ public SecurityMonitoringSignalSuggestedActionsResponse getInvestigationLogQueri
1239312394
new GenericType<SecurityMonitoringSignalSuggestedActionsResponse>() {});
1239412395
}
1239512396

12397+
/**
12398+
* Get signals matching an event.
12399+
*
12400+
* <p>See {@link #getMatchingSignalsWithHttpInfo}.
12401+
*
12402+
* @param eventId The ID of the event to find matching signals for. (required)
12403+
* @param track The product track that the event belongs to. (required)
12404+
* @return MatchingSignalsResponse
12405+
* @throws ApiException if fails to make API call
12406+
*/
12407+
public MatchingSignalsResponse getMatchingSignals(String eventId, String track)
12408+
throws ApiException {
12409+
return getMatchingSignalsWithHttpInfo(eventId, track).getData();
12410+
}
12411+
12412+
/**
12413+
* Get signals matching an event.
12414+
*
12415+
* <p>See {@link #getMatchingSignalsWithHttpInfoAsync}.
12416+
*
12417+
* @param eventId The ID of the event to find matching signals for. (required)
12418+
* @param track The product track that the event belongs to. (required)
12419+
* @return CompletableFuture&lt;MatchingSignalsResponse&gt;
12420+
*/
12421+
public CompletableFuture<MatchingSignalsResponse> getMatchingSignalsAsync(
12422+
String eventId, String track) {
12423+
return getMatchingSignalsWithHttpInfoAsync(eventId, track)
12424+
.thenApply(
12425+
response -> {
12426+
return response.getData();
12427+
});
12428+
}
12429+
12430+
/**
12431+
* Returns the list of security signals that match a given event on the given track.
12432+
*
12433+
* @param eventId The ID of the event to find matching signals for. (required)
12434+
* @param track The product track that the event belongs to. (required)
12435+
* @return ApiResponse&lt;MatchingSignalsResponse&gt;
12436+
* @throws ApiException if fails to make API call
12437+
* @http.response.details
12438+
* <table border="1">
12439+
* <caption>Response details</caption>
12440+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
12441+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
12442+
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
12443+
* <tr><td> 403 </td><td> Not Authorized </td><td> - </td></tr>
12444+
* <tr><td> 404 </td><td> Not Found </td><td> - </td></tr>
12445+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
12446+
* </table>
12447+
*/
12448+
public ApiResponse<MatchingSignalsResponse> getMatchingSignalsWithHttpInfo(
12449+
String eventId, String track) throws ApiException {
12450+
// Check if unstable operation is enabled
12451+
String operationId = "getMatchingSignals";
12452+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
12453+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
12454+
} else {
12455+
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
12456+
}
12457+
Object localVarPostBody = null;
12458+
12459+
// verify the required parameter 'eventId' is set
12460+
if (eventId == null) {
12461+
throw new ApiException(
12462+
400, "Missing the required parameter 'eventId' when calling getMatchingSignals");
12463+
}
12464+
12465+
// verify the required parameter 'track' is set
12466+
if (track == null) {
12467+
throw new ApiException(
12468+
400, "Missing the required parameter 'track' when calling getMatchingSignals");
12469+
}
12470+
// create path and map variables
12471+
String localVarPath =
12472+
"/api/v2/security_monitoring/events/{event_id}/matching_signals"
12473+
.replaceAll("\\{" + "event_id" + "\\}", apiClient.escapeString(eventId.toString()));
12474+
12475+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
12476+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
12477+
12478+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "track", track));
12479+
12480+
Invocation.Builder builder =
12481+
apiClient.createBuilder(
12482+
"v2.SecurityMonitoringApi.getMatchingSignals",
12483+
localVarPath,
12484+
localVarQueryParams,
12485+
localVarHeaderParams,
12486+
new HashMap<String, String>(),
12487+
new String[] {"application/json"},
12488+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
12489+
return apiClient.invokeAPI(
12490+
"GET",
12491+
builder,
12492+
localVarHeaderParams,
12493+
new String[] {},
12494+
localVarPostBody,
12495+
new HashMap<String, Object>(),
12496+
false,
12497+
new GenericType<MatchingSignalsResponse>() {});
12498+
}
12499+
12500+
/**
12501+
* Get signals matching an event.
12502+
*
12503+
* <p>See {@link #getMatchingSignalsWithHttpInfo}.
12504+
*
12505+
* @param eventId The ID of the event to find matching signals for. (required)
12506+
* @param track The product track that the event belongs to. (required)
12507+
* @return CompletableFuture&lt;ApiResponse&lt;MatchingSignalsResponse&gt;&gt;
12508+
*/
12509+
public CompletableFuture<ApiResponse<MatchingSignalsResponse>>
12510+
getMatchingSignalsWithHttpInfoAsync(String eventId, String track) {
12511+
// Check if unstable operation is enabled
12512+
String operationId = "getMatchingSignals";
12513+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
12514+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
12515+
} else {
12516+
CompletableFuture<ApiResponse<MatchingSignalsResponse>> result = new CompletableFuture<>();
12517+
result.completeExceptionally(
12518+
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
12519+
return result;
12520+
}
12521+
Object localVarPostBody = null;
12522+
12523+
// verify the required parameter 'eventId' is set
12524+
if (eventId == null) {
12525+
CompletableFuture<ApiResponse<MatchingSignalsResponse>> result = new CompletableFuture<>();
12526+
result.completeExceptionally(
12527+
new ApiException(
12528+
400, "Missing the required parameter 'eventId' when calling getMatchingSignals"));
12529+
return result;
12530+
}
12531+
12532+
// verify the required parameter 'track' is set
12533+
if (track == null) {
12534+
CompletableFuture<ApiResponse<MatchingSignalsResponse>> result = new CompletableFuture<>();
12535+
result.completeExceptionally(
12536+
new ApiException(
12537+
400, "Missing the required parameter 'track' when calling getMatchingSignals"));
12538+
return result;
12539+
}
12540+
// create path and map variables
12541+
String localVarPath =
12542+
"/api/v2/security_monitoring/events/{event_id}/matching_signals"
12543+
.replaceAll("\\{" + "event_id" + "\\}", apiClient.escapeString(eventId.toString()));
12544+
12545+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
12546+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
12547+
12548+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "track", track));
12549+
12550+
Invocation.Builder builder;
12551+
try {
12552+
builder =
12553+
apiClient.createBuilder(
12554+
"v2.SecurityMonitoringApi.getMatchingSignals",
12555+
localVarPath,
12556+
localVarQueryParams,
12557+
localVarHeaderParams,
12558+
new HashMap<String, String>(),
12559+
new String[] {"application/json"},
12560+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
12561+
} catch (ApiException ex) {
12562+
CompletableFuture<ApiResponse<MatchingSignalsResponse>> result = new CompletableFuture<>();
12563+
result.completeExceptionally(ex);
12564+
return result;
12565+
}
12566+
return apiClient.invokeAPIAsync(
12567+
"GET",
12568+
builder,
12569+
localVarHeaderParams,
12570+
new String[] {},
12571+
localVarPostBody,
12572+
new HashMap<String, Object>(),
12573+
false,
12574+
new GenericType<MatchingSignalsResponse>() {});
12575+
}
12576+
1239612577
/** Manage optional parameters to getResourceEvaluationFilters. */
1239712578
public static class GetResourceEvaluationFiltersOptionalParameters {
1239812579
private String cloudProvider;

0 commit comments

Comments
 (0)