-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate client from commit b9b42395 of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Apr 8, 2024
1 parent
2728c86
commit 2f8b85e
Showing
15 changed files
with
271 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
examples/v2/security-monitoring/CreateSecurityMonitoringSuppression_3192265332.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Create a suppression rule with an exclusion query 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.SecurityMonitoringSuppressionCreateAttributes; | ||
import com.datadog.api.client.v2.model.SecurityMonitoringSuppressionCreateData; | ||
import com.datadog.api.client.v2.model.SecurityMonitoringSuppressionCreateRequest; | ||
import com.datadog.api.client.v2.model.SecurityMonitoringSuppressionResponse; | ||
import com.datadog.api.client.v2.model.SecurityMonitoringSuppressionType; | ||
|
||
public class Example { | ||
public static void main(String[] args) { | ||
ApiClient defaultClient = ApiClient.getDefaultApiClient(); | ||
SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); | ||
|
||
SecurityMonitoringSuppressionCreateRequest body = | ||
new SecurityMonitoringSuppressionCreateRequest() | ||
.data( | ||
new SecurityMonitoringSuppressionCreateData() | ||
.attributes( | ||
new SecurityMonitoringSuppressionCreateAttributes() | ||
.description( | ||
"This rule suppresses low-severity signals in staging" | ||
+ " environments.") | ||
.enabled(true) | ||
.expirationDate(1703187336000L) | ||
.name("Example-Security-Monitoring") | ||
.ruleQuery("type:log_detection source:cloudtrail") | ||
.dataExclusionQuery("account_id:12345")) | ||
.type(SecurityMonitoringSuppressionType.SUPPRESSIONS)); | ||
|
||
try { | ||
SecurityMonitoringSuppressionResponse result = | ||
apiInstance.createSecurityMonitoringSuppression(body); | ||
System.out.println(result); | ||
} catch (ApiException e) { | ||
System.err.println( | ||
"Exception when calling SecurityMonitoringApi#createSecurityMonitoringSuppression"); | ||
System.err.println("Status code: " + e.getCode()); | ||
System.err.println("Reason: " + e.getResponseBody()); | ||
System.err.println("Response headers: " + e.getResponseHeaders()); | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...test/resources/cassettes/features/v2/Create_a_suppression_rule_returns_OK_response.freeze
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2024-01-11T10:06:23.179Z | ||
2024-04-08T09:56:58.589Z |
Oops, something went wrong.