Skip to content

Commit 53716c8

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 9f62108 of spec repo
1 parent c21384e commit 53716c8

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
@@ -68731,6 +68731,68 @@ components:
6873168731
type: string
6873268732
x-enum-varnames:
6873368733
- MANAGED_ORGS
68734+
MatchingSignalAttributes:
68735+
description: Attributes of a matching security signal.
68736+
properties:
68737+
event_tracker_id:
68738+
description: The tracker ID linking the signal back to the originating event. Distinct from `id`, which identifies the matching signal itself.
68739+
example: AAAAAWgOAX0mtsWfeQAAAABzX1RyYWNrZXJfMTIzNDU2Nzg5MA
68740+
type: string
68741+
severity:
68742+
description: The severity of the signal.
68743+
example: high
68744+
type: string
68745+
title:
68746+
description: The title of the signal.
68747+
example: Unusual login activity detected
68748+
type: string
68749+
trigger_time_ms:
68750+
description: The Unix timestamp (in milliseconds) at which the signal was triggered.
68751+
example: 1707393746000
68752+
format: int64
68753+
type: integer
68754+
required:
68755+
- event_tracker_id
68756+
- severity
68757+
- title
68758+
- trigger_time_ms
68759+
type: object
68760+
MatchingSignalData:
68761+
description: A security signal that matches the queried event.
68762+
properties:
68763+
attributes:
68764+
$ref: "#/components/schemas/MatchingSignalAttributes"
68765+
id:
68766+
description: The ID of the matching signal.
68767+
example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA
68768+
type: string
68769+
type:
68770+
$ref: "#/components/schemas/MatchingSignalType"
68771+
required:
68772+
- id
68773+
- type
68774+
- attributes
68775+
type: object
68776+
MatchingSignalType:
68777+
default: matching_signal
68778+
description: The type of the resource. The value should always be `matching_signal`.
68779+
enum:
68780+
- matching_signal
68781+
example: matching_signal
68782+
type: string
68783+
x-enum-varnames:
68784+
- MATCHING_SIGNAL
68785+
MatchingSignalsResponse:
68786+
description: Response containing the list of security signals matching an event.
68787+
properties:
68788+
data:
68789+
description: Array of matching signals.
68790+
items:
68791+
$ref: "#/components/schemas/MatchingSignalData"
68792+
type: array
68793+
required:
68794+
- data
68795+
type: object
6873468796
MaxSessionDurationType:
6873568797
description: Data type of a maximum session duration update.
6873668798
enum: [max_session_duration]
@@ -210024,6 +210086,63 @@ paths:
210024210086
x-unstable: |-
210025210087
**Note**: This endpoint is in Preview and is subject to change.
210026210088
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
210089+
/api/v2/security_monitoring/events/{event_id}/matching_signals:
210090+
get:
210091+
description: Returns the list of security signals that match a given event on the given track.
210092+
operationId: GetMatchingSignals
210093+
parameters:
210094+
- description: The ID of the event to find matching signals for.
210095+
in: path
210096+
name: event_id
210097+
required: true
210098+
schema:
210099+
type: string
210100+
- description: The product track that the event belongs to.
210101+
in: query
210102+
name: track
210103+
required: true
210104+
schema:
210105+
type: string
210106+
responses:
210107+
"200":
210108+
content:
210109+
application/json:
210110+
examples:
210111+
default:
210112+
value:
210113+
data:
210114+
- attributes:
210115+
event_tracker_id: AAAAAWgOAX0mtsWfeQAAAABzX1RyYWNrZXJfMTIzNDU2Nzg5MA
210116+
severity: high
210117+
title: Unusual login activity detected
210118+
trigger_time_ms: 1707393746000
210119+
id: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA
210120+
type: matching_signal
210121+
schema:
210122+
$ref: "#/components/schemas/MatchingSignalsResponse"
210123+
description: OK
210124+
"400":
210125+
$ref: "#/components/responses/BadRequestResponse"
210126+
"403":
210127+
$ref: "#/components/responses/NotAuthorizedResponse"
210128+
"404":
210129+
$ref: "#/components/responses/NotFoundResponse"
210130+
"429":
210131+
$ref: "#/components/responses/TooManyRequestsResponse"
210132+
security:
210133+
- apiKeyAuth: []
210134+
appKeyAuth: []
210135+
- AuthZ:
210136+
- security_monitoring_signals_read
210137+
summary: Get signals matching an event
210138+
tags: ["Security Monitoring"]
210139+
x-permission:
210140+
operator: OR
210141+
permissions:
210142+
- security_monitoring_signals_read
210143+
x-unstable: |-
210144+
**Note**: This endpoint is in preview and is subject to change.
210145+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
210027210146
/api/v2/security_monitoring/rules:
210028210147
get:
210029210148
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)