-
Notifications
You must be signed in to change notification settings - Fork 20
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 b2c9888c of spec repo
- Loading branch information
ci.datadog-api-spec
committed
May 28, 2024
1 parent
e9abad2
commit a16c930
Showing
15 changed files
with
876 additions
and
4 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
1 change: 1 addition & 0 deletions
1
cassettes/features/v2/security_monitoring/Test-a-rule-returns-OK-response.frozen
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 @@ | ||
2024-05-28T11:40:33.484Z |
29 changes: 29 additions & 0 deletions
29
cassettes/features/v2/security_monitoring/Test-a-rule-returns-OK-response.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
examples/v2/security-monitoring/TestExistingSecurityMonitoringRule.rb
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,21 @@ | ||
# Test an existing rule returns "OK" response | ||
|
||
require "datadog_api_client" | ||
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new | ||
|
||
body = DatadogAPIClient::V2::SecurityMonitoringRuleTestRequest.new({ | ||
rule_query_payloads: [ | ||
DatadogAPIClient::V2::SecurityMonitoringRuleQueryPayload.new({ | ||
expected_result: true, | ||
index: 0, | ||
payload: DatadogAPIClient::V2::SecurityMonitoringRuleQueryPayloadData.new({ | ||
ddsource: "nginx", | ||
ddtags: "env:staging,version:5.1", | ||
hostname: "i-012345678", | ||
message: "2019-11-19T14:37:58,995 INFO [process.name][20081] Hello World", | ||
service: "payment", | ||
}), | ||
}), | ||
], | ||
}) | ||
p api_instance.test_existing_security_monitoring_rule("rule_id", body) |
58 changes: 58 additions & 0 deletions
58
examples/v2/security-monitoring/TestSecurityMonitoringRule.rb
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,58 @@ | ||
# Test a rule returns "OK" response | ||
|
||
require "datadog_api_client" | ||
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new | ||
|
||
body = DatadogAPIClient::V2::SecurityMonitoringRuleTestRequest.new({ | ||
rule: DatadogAPIClient::V2::SecurityMonitoringStandardRuleCreatePayload.new({ | ||
cases: [ | ||
DatadogAPIClient::V2::SecurityMonitoringRuleCaseCreate.new({ | ||
name: "", | ||
status: DatadogAPIClient::V2::SecurityMonitoringRuleSeverity::INFO, | ||
notifications: [], | ||
condition: "a > 0", | ||
}), | ||
], | ||
has_extended_title: true, | ||
is_enabled: true, | ||
message: "My security monitoring rule message.", | ||
name: "My security monitoring rule.", | ||
options: DatadogAPIClient::V2::SecurityMonitoringRuleOptions.new({ | ||
decrease_criticality_based_on_env: false, | ||
detection_method: DatadogAPIClient::V2::SecurityMonitoringRuleDetectionMethod::THRESHOLD, | ||
evaluation_window: DatadogAPIClient::V2::SecurityMonitoringRuleEvaluationWindow::ZERO_MINUTES, | ||
keep_alive: DatadogAPIClient::V2::SecurityMonitoringRuleKeepAlive::ZERO_MINUTES, | ||
max_signal_duration: DatadogAPIClient::V2::SecurityMonitoringRuleMaxSignalDuration::ZERO_MINUTES, | ||
}), | ||
queries: [ | ||
DatadogAPIClient::V2::SecurityMonitoringStandardRuleQuery.new({ | ||
query: "source:source_here", | ||
group_by_fields: [ | ||
"@userIdentity.assumed_role", | ||
], | ||
distinct_fields: [], | ||
aggregation: DatadogAPIClient::V2::SecurityMonitoringRuleQueryAggregation::COUNT, | ||
name: "", | ||
}), | ||
], | ||
tags: [ | ||
"env:prod", | ||
"team:security", | ||
], | ||
type: DatadogAPIClient::V2::SecurityMonitoringRuleTypeCreate::LOG_DETECTION, | ||
}), | ||
rule_query_payloads: [ | ||
DatadogAPIClient::V2::SecurityMonitoringRuleQueryPayload.new({ | ||
expected_result: true, | ||
index: 0, | ||
payload: DatadogAPIClient::V2::SecurityMonitoringRuleQueryPayloadData.new({ | ||
ddsource: "source_here", | ||
ddtags: "env:staging,version:5.1", | ||
hostname: "i-012345678", | ||
message: "2019-11-19T14:37:58,995 INFO [process.name][20081] Hello World", | ||
service: "payment", | ||
}), | ||
}), | ||
], | ||
}) | ||
p api_instance.test_security_monitoring_rule(body) |
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
Oops, something went wrong.