Skip to content

Commit

Permalink
Regenerate client from commit 6e838a18 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Feb 7, 2025
1 parent 42f6bd8 commit 3eb0895
Show file tree
Hide file tree
Showing 18 changed files with 957 additions and 41 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-02-06 17:59:36.285895",
"spec_repo_commit": "b89b292b"
"regenerated": "2025-02-07 12:32:00.355763",
"spec_repo_commit": "6e838a18"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-02-06 17:59:36.301562",
"spec_repo_commit": "b89b292b"
"regenerated": "2025-02-07 12:32:00.370791",
"spec_repo_commit": "6e838a18"
}
}
}
94 changes: 93 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ components:
schema:
type: string
ConfluentAccountID:
description: Confluent Account id.
description: Confluent Account ID.
in: path
name: account_id
required: true
Expand Down Expand Up @@ -15657,6 +15657,15 @@ components:
example: 1729843470000
format: int64
type: integer
groupSignalsBy:
description: Additional grouping to perform on top of the existing groups
in the query section. Must be a subset of the existing groups.
example:
- service
items:
description: Field to group by.
type: string
type: array
index:
description: Index used to load the data.
example: cloud_siem
Expand Down Expand Up @@ -24242,6 +24251,11 @@ components:
SecurityMonitoringRuleCase:
description: Case when signal is generated.
properties:
actions:
description: Action to perform for each rule case.
items:
$ref: '#/components/schemas/SecurityMonitoringRuleCaseAction'
type: array
condition:
description: 'A rule case contains logical operations (`>`,`>=`, `&&`, `||`)
to determine if a signal should be generated
Expand All @@ -24260,9 +24274,42 @@ components:
status:
$ref: '#/components/schemas/SecurityMonitoringRuleSeverity'
type: object
SecurityMonitoringRuleCaseAction:
description: Action to perform when a signal is triggered. Only available for
Application Security rule type.
properties:
options:
$ref: '#/components/schemas/SecurityMonitoringRuleCaseActionOptions'
type:
$ref: '#/components/schemas/SecurityMonitoringRuleCaseActionType'
type: object
SecurityMonitoringRuleCaseActionOptions:
description: Options for the rule action
properties:
duration:
description: Duration of the action in seconds. 0 indicates no expiration.
example: 0
format: int64
minimum: 0
type: integer
type: object
SecurityMonitoringRuleCaseActionType:
description: The action type.
enum:
- block_ip
- block_user
type: string
x-enum-varnames:
- BLOCK_IP
- BLOCK_USER
SecurityMonitoringRuleCaseCreate:
description: Case when signal is generated.
properties:
actions:
description: Action to perform for each rule case.
items:
$ref: '#/components/schemas/SecurityMonitoringRuleCaseAction'
type: array
condition:
description: 'A case contains logical operations (`>`,`>=`, `&&`, `||`)
to determine if a signal should be generated
Expand Down Expand Up @@ -24724,6 +24771,15 @@ components:
items:
$ref: '#/components/schemas/SecurityMonitoringFilter'
type: array
groupSignalsBy:
description: Additional grouping to perform on top of the existing groups
in the query section. Must be a subset of the existing groups.
example:
- service
items:
description: Field to group by.
type: string
type: array
hasExtendedTitle:
description: Whether the notifications include the triggering group-by values
in their title.
Expand Down Expand Up @@ -25429,6 +25485,15 @@ components:
items:
$ref: '#/components/schemas/SecurityMonitoringFilter'
type: array
groupSignalsBy:
description: Additional grouping to perform on top of the existing groups
in the query section. Must be a subset of the existing groups.
example:
- service
items:
description: Field to group by.
type: string
type: array
hasExtendedTitle:
description: Whether the notifications include the triggering group-by values
in their title.
Expand Down Expand Up @@ -25501,6 +25566,15 @@ components:
items:
$ref: '#/components/schemas/SecurityMonitoringFilter'
type: array
groupSignalsBy:
description: Additional grouping to perform on top of the existing groups
in the query section. Must be a subset of the existing groups.
example:
- service
items:
description: Field to group by.
type: string
type: array
hasExtendedTitle:
description: Whether the notifications include the triggering group-by values
in their title.
Expand Down Expand Up @@ -25642,6 +25716,15 @@ components:
items:
$ref: '#/components/schemas/SecurityMonitoringFilter'
type: array
groupSignalsBy:
description: Additional grouping to perform on top of the existing groups
in the query section. Must be a subset of the existing groups.
example:
- service
items:
description: Field to group by.
type: string
type: array
hasExtendedTitle:
description: Whether the notifications include the triggering group-by values
in their title.
Expand Down Expand Up @@ -25719,6 +25802,15 @@ components:
items:
$ref: '#/components/schemas/SecurityMonitoringFilter'
type: array
groupSignalsBy:
description: Additional grouping to perform on top of the existing groups
in the query section. Must be a subset of the existing groups.
example:
- service
items:
description: Field to group by.
type: string
type: array
hasExtendedTitle:
description: Whether the notifications include the triggering group-by values
in their title.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// Create a detection rule with type 'application_security 'returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.SecurityMonitoringApi;
import com.datadog.api.client.v2.model.SecurityMonitoringRuleCaseAction;
import com.datadog.api.client.v2.model.SecurityMonitoringRuleCaseActionOptions;
import com.datadog.api.client.v2.model.SecurityMonitoringRuleCaseActionType;
import com.datadog.api.client.v2.model.SecurityMonitoringRuleCaseCreate;
import com.datadog.api.client.v2.model.SecurityMonitoringRuleCreatePayload;
import com.datadog.api.client.v2.model.SecurityMonitoringRuleDetectionMethod;
import com.datadog.api.client.v2.model.SecurityMonitoringRuleEvaluationWindow;
import com.datadog.api.client.v2.model.SecurityMonitoringRuleKeepAlive;
import com.datadog.api.client.v2.model.SecurityMonitoringRuleMaxSignalDuration;
import com.datadog.api.client.v2.model.SecurityMonitoringRuleOptions;
import com.datadog.api.client.v2.model.SecurityMonitoringRuleQueryAggregation;
import com.datadog.api.client.v2.model.SecurityMonitoringRuleResponse;
import com.datadog.api.client.v2.model.SecurityMonitoringRuleSeverity;
import com.datadog.api.client.v2.model.SecurityMonitoringRuleTypeCreate;
import com.datadog.api.client.v2.model.SecurityMonitoringStandardRuleCreatePayload;
import com.datadog.api.client.v2.model.SecurityMonitoringStandardRuleQuery;
import java.util.Arrays;
import java.util.Collections;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient);

SecurityMonitoringRuleCreatePayload body =
new SecurityMonitoringRuleCreatePayload(
new SecurityMonitoringStandardRuleCreatePayload()
.type(SecurityMonitoringRuleTypeCreate.APPLICATION_SECURITY)
.name("Example-Security-Monitoring_appsec_rule")
.queries(
Collections.singletonList(
new SecurityMonitoringStandardRuleQuery()
.query("@appsec.security_activity:business_logic.users.login.failure")
.aggregation(SecurityMonitoringRuleQueryAggregation.COUNT)
.groupByFields(Arrays.asList("service", "@http.client_ip"))))
.cases(
Collections.singletonList(
new SecurityMonitoringRuleCaseCreate()
.name("")
.status(SecurityMonitoringRuleSeverity.INFO)
.condition("a > 100000")
.actions(
Collections.singletonList(
new SecurityMonitoringRuleCaseAction()
.type(SecurityMonitoringRuleCaseActionType.BLOCK_IP)
.options(
new SecurityMonitoringRuleCaseActionOptions()
.duration(900L))))))
.options(
new SecurityMonitoringRuleOptions()
.keepAlive(SecurityMonitoringRuleKeepAlive.ONE_HOUR)
.maxSignalDuration(SecurityMonitoringRuleMaxSignalDuration.ONE_DAY)
.evaluationWindow(SecurityMonitoringRuleEvaluationWindow.FIFTEEN_MINUTES)
.detectionMethod(SecurityMonitoringRuleDetectionMethod.THRESHOLD))
.isEnabled(true)
.message("Test rule")
.groupSignalsBy(Collections.singletonList("service")));

try {
SecurityMonitoringRuleResponse result = apiInstance.createSecurityMonitoringRule(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling SecurityMonitoringApi#createSecurityMonitoringRule");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Loading

0 comments on commit 3eb0895

Please sign in to comment.