Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,334 changes: 1,860 additions & 474 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions examples/v2/governance-console/GetGovernanceConfig.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get the Governance Console configuration returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_governance_config".to_sym] = true
end
api_instance = DatadogAPIClient::V2::GovernanceConsoleAPI.new
p api_instance.get_governance_config()
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Get a governance control returns "OK" response
# Get a control returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_governance_control".to_sym] = true
end
api_instance = DatadogAPIClient::V2::GovernanceControlsAPI.new
api_instance = DatadogAPIClient::V2::GovernanceConsoleAPI.new
p api_instance.get_governance_control("detection_type")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get control notification settings returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_governance_control_notification_settings".to_sym] = true
end
api_instance = DatadogAPIClient::V2::GovernanceConsoleAPI.new
p api_instance.get_governance_control_notification_settings("detection_type")
8 changes: 8 additions & 0 deletions examples/v2/governance-console/GetGovernanceDetection.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get a detection returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_governance_detection".to_sym] = true
end
api_instance = DatadogAPIClient::V2::GovernanceConsoleAPI.new
p api_instance.get_governance_detection("detection_id")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get notification settings returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_governance_notification_settings".to_sym] = true
end
api_instance = DatadogAPIClient::V2::GovernanceConsoleAPI.new
p api_instance.get_governance_notification_settings()
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List control detections returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_governance_control_detections".to_sym] = true
end
api_instance = DatadogAPIClient::V2::GovernanceConsoleAPI.new
p api_instance.list_governance_control_detections("detection_type")
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# List governance controls returns "OK" response
# List controls returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_governance_controls".to_sym] = true
end
api_instance = DatadogAPIClient::V2::GovernanceControlsAPI.new
api_instance = DatadogAPIClient::V2::GovernanceConsoleAPI.new
p api_instance.list_governance_controls()
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# List governance insights returns "OK" response
# List insights returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_governance_insights".to_sym] = true
end
api_instance = DatadogAPIClient::V2::GovernanceInsightsAPI.new
api_instance = DatadogAPIClient::V2::GovernanceConsoleAPI.new
p api_instance.list_governance_insights()
8 changes: 8 additions & 0 deletions examples/v2/governance-console/ListGovernanceLimits.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List usage limits returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_governance_limits".to_sym] = true
end
api_instance = DatadogAPIClient::V2::GovernanceConsoleAPI.new
p api_instance.list_governance_limits()
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List resource limits returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_governance_resource_limits".to_sym] = true
end
api_instance = DatadogAPIClient::V2::GovernanceConsoleAPI.new
p api_instance.list_governance_resource_limits()
21 changes: 21 additions & 0 deletions examples/v2/governance-console/MitigateGovernanceDetections.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Mitigate detections returns "Accepted" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.mitigate_governance_detections".to_sym] = true
end
api_instance = DatadogAPIClient::V2::GovernanceConsoleAPI.new

body = DatadogAPIClient::V2::GovernanceMitigationRequest.new({
data: DatadogAPIClient::V2::GovernanceMitigationRequestData.new({
attributes: DatadogAPIClient::V2::GovernanceMitigationRequestAttributes.new({
detection_ids: [
"3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d",
],
detection_type: "unused_api_keys",
mitigation_type: "revoke_api_key",
}),
type: DatadogAPIClient::V2::GovernanceControlDetectionResourceType::GOVERNANCE_CONTROL_DETECTION,
}),
})
p api_instance.mitigate_governance_detections(body)
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
# Update a governance control returns "OK" response
# Update a control returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.update_governance_control".to_sym] = true
end
api_instance = DatadogAPIClient::V2::GovernanceControlsAPI.new
api_instance = DatadogAPIClient::V2::GovernanceConsoleAPI.new

body = DatadogAPIClient::V2::GovernanceControlUpdateRequest.new({
data: DatadogAPIClient::V2::GovernanceControlUpdateData.new({
attributes: DatadogAPIClient::V2::GovernanceControlUpdateAttributes.new({
detection_frequency: "daily",
mitigation_type: "revoke_api_key",
name: "Unused API Keys",
notification_frequency: "daily",
notification_type: "slack",
}),
id: "0d4e6f8a-1b2c-3d4e-5f6a-7b8c9d0e1f2a",
type: DatadogAPIClient::V2::GovernanceControlResourceType::GOVERNANCE_CONTROL,
}),
})
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Update control notification settings returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.update_governance_control_notification_settings".to_sym] = true
end
api_instance = DatadogAPIClient::V2::GovernanceConsoleAPI.new

body = DatadogAPIClient::V2::ControlNotificationSettingsUpdateRequest.new({
data: DatadogAPIClient::V2::ControlNotificationSettingsUpdateData.new({
attributes: DatadogAPIClient::V2::ControlNotificationSettingsUpdateAttributes.new({
event_settings: [
DatadogAPIClient::V2::ControlNotificationEventSetting.new({
enabled: true,
event_type: "new_detection",
targets: [
DatadogAPIClient::V2::ControlNotificationTarget.new({
handle: "#governance-alerts",
type: DatadogAPIClient::V2::ControlNotificationTargetType::SLACK,
}),
],
}),
],
}),
type: DatadogAPIClient::V2::ControlNotificationSettingsResourceType::CONTROL_NOTIFICATION_SETTINGS,
}),
})
p api_instance.update_governance_control_notification_settings("detection_type", body)
20 changes: 20 additions & 0 deletions examples/v2/governance-console/UpdateGovernanceDetection.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Update a detection returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.update_governance_detection".to_sym] = true
end
api_instance = DatadogAPIClient::V2::GovernanceConsoleAPI.new

body = DatadogAPIClient::V2::GovernanceControlDetectionUpdateRequest.new({
data: DatadogAPIClient::V2::GovernanceControlDetectionUpdateData.new({
attributes: DatadogAPIClient::V2::GovernanceControlDetectionUpdateAttributes.new({
assigned_team: "platform-security",
assigned_to: "11111111-2222-3333-4444-555555555555",
mitigate_after: "2024-03-15T00:00:00Z",
state: DatadogAPIClient::V2::GovernanceControlDetectionUpdateState::EXCEPTION,
}),
type: DatadogAPIClient::V2::GovernanceControlDetectionResourceType::GOVERNANCE_CONTROL_DETECTION,
}),
})
p api_instance.update_governance_detection("detection_id", body)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Update notification settings returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.update_governance_notification_settings".to_sym] = true
end
api_instance = DatadogAPIClient::V2::GovernanceConsoleAPI.new

body = DatadogAPIClient::V2::GovernanceNotificationSettingsUpdateRequest.new({
data: DatadogAPIClient::V2::GovernanceNotificationSettingsUpdateData.new({
attributes: DatadogAPIClient::V2::GovernanceNotificationSettingsUpdateAttributes.new({
assignment_notifications_enabled: true,
}),
type: DatadogAPIClient::V2::GovernanceNotificationSettingsResourceType::GOVERNANCE_NOTIFICATION_SETTINGS,
}),
})
p api_instance.update_governance_notification_settings(body)
30 changes: 28 additions & 2 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3461,11 +3461,37 @@
"detection_type" => "String",
"body" => "GovernanceControlUpdateRequest",
},
"v2.ListGovernanceControlDetections" => {
"detection_type" => "String",
"filter_state" => "String",
"filter_query" => "String",
"sort" => "String",
"page_number" => "Integer",
"page_size" => "Integer",
},
"v2.GetGovernanceControlNotificationSettings" => {
"detection_type" => "String",
},
"v2.UpdateGovernanceControlNotificationSettings" => {
"detection_type" => "String",
"body" => "ControlNotificationSettingsUpdateRequest",
},
"v2.MitigateGovernanceDetections" => {
"body" => "GovernanceMitigationRequest",
},
"v2.GetGovernanceDetection" => {
"detection_id" => "String",
},
"v2.UpdateGovernanceDetection" => {
"detection_id" => "String",
"body" => "GovernanceControlDetectionUpdateRequest",
},
"v2.ListGovernanceInsights" => {
"with_values" => "Boolean",
"org_uuid" => "String",
"filter_product" => "Array<String>",
},
"v2.UpdateGovernanceNotificationSettings" => {
"body" => "GovernanceNotificationSettingsUpdateRequest",
},
"v2.CreateHamrOrgConnection" => {
"body" => "HamrOrgConnectionRequest",
},
Expand Down
Loading
Loading