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
1,680 changes: 1,679 additions & 1 deletion .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions examples/v2/governance-controls/CreateGovernanceMitigation.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Mitigate governance detections returns "Accepted" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.create_governance_mitigation".to_sym] = true
end
api_instance = DatadogAPIClient::V2::GovernanceControlsAPI.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.create_governance_mitigation(body)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get a governance control detection returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_governance_control_detection".to_sym] = true
end
api_instance = DatadogAPIClient::V2::GovernanceControlsAPI.new
p api_instance.get_governance_control_detection("detection_type", "detection_id")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get governance 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::GovernanceControlsAPI.new
p api_instance.get_governance_control_notification_settings("detection_type")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List governance 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::GovernanceControlsAPI.new
p api_instance.list_governance_control_detections("detection_type")
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Update a governance control detection returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.update_governance_control_detection".to_sym] = true
end
api_instance = DatadogAPIClient::V2::GovernanceControlsAPI.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_control_detection("detection_type", "detection_id", body)
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Update governance 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::GovernanceControlsAPI.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)
8 changes: 8 additions & 0 deletions examples/v2/governance-settings/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::GovernanceSettingsAPI.new
p api_instance.get_governance_config()
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get governance 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::GovernanceSettingsAPI.new
p api_instance.get_governance_notification_settings()
8 changes: 8 additions & 0 deletions examples/v2/governance-settings/ListGovernanceLimits.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List governance 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::GovernanceSettingsAPI.new
p api_instance.list_governance_limits()
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List governance 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::GovernanceSettingsAPI.new
p api_instance.list_governance_resource_limits()
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Update governance 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::GovernanceSettingsAPI.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: 30 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3376,13 +3376,43 @@
"saml_config_uuid" => "String",
"body" => "SAMLConfigurationUpdateRequest",
},
"v2.UpdateGovernanceNotificationSettings" => {
"body" => "GovernanceNotificationSettingsUpdateRequest",
},
"v2.GetGovernanceControl" => {
"detection_type" => "String",
},
"v2.UpdateGovernanceControl" => {
"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.GetGovernanceControlDetection" => {
"detection_type" => "String",
"detection_id" => "String",
},
"v2.UpdateGovernanceControlDetection" => {
"detection_type" => "String",
"detection_id" => "String",
"body" => "GovernanceControlDetectionUpdateRequest",
},
"v2.GetGovernanceControlNotificationSettings" => {
"detection_type" => "String",
},
"v2.UpdateGovernanceControlNotificationSettings" => {
"detection_type" => "String",
"body" => "ControlNotificationSettingsUpdateRequest",
},
"v2.CreateGovernanceMitigation" => {
"body" => "GovernanceMitigationRequest",
},
"v2.ListGovernanceInsights" => {
"with_values" => "Boolean",
"org_uuid" => "String",
Expand Down
123 changes: 123 additions & 0 deletions features/v2/governance_controls.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,33 @@ Feature: Governance Controls
And a valid "appKeyAuth" key in the system
And an instance of "GovernanceControls" API

@generated @skip @team:DataDog/aaa-governance-console
Scenario: Get a governance control detection returns "Bad Request" response
Given operation "GetGovernanceControlDetection" enabled
And new "GetGovernanceControlDetection" request
And request contains "detection_type" parameter from "REPLACE.ME"
And request contains "detection_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/aaa-governance-console
Scenario: Get a governance control detection returns "Not Found" response
Given operation "GetGovernanceControlDetection" enabled
And new "GetGovernanceControlDetection" request
And request contains "detection_type" parameter from "REPLACE.ME"
And request contains "detection_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/aaa-governance-console
Scenario: Get a governance control detection returns "OK" response
Given operation "GetGovernanceControlDetection" enabled
And new "GetGovernanceControlDetection" request
And request contains "detection_type" parameter from "REPLACE.ME"
And request contains "detection_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/aaa-governance-console
Scenario: Get a governance control returns "Bad Request" response
Given operation "GetGovernanceControl" enabled
Expand All @@ -35,6 +62,38 @@ Feature: Governance Controls
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/aaa-governance-console
Scenario: Get governance control notification settings returns "Bad Request" response
Given operation "GetGovernanceControlNotificationSettings" enabled
And new "GetGovernanceControlNotificationSettings" request
And request contains "detection_type" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/aaa-governance-console
Scenario: Get governance control notification settings returns "OK" response
Given operation "GetGovernanceControlNotificationSettings" enabled
And new "GetGovernanceControlNotificationSettings" request
And request contains "detection_type" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/aaa-governance-console
Scenario: List governance control detections returns "Bad Request" response
Given operation "ListGovernanceControlDetections" enabled
And new "ListGovernanceControlDetections" request
And request contains "detection_type" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/aaa-governance-console
Scenario: List governance control detections returns "OK" response
Given operation "ListGovernanceControlDetections" enabled
And new "ListGovernanceControlDetections" request
And request contains "detection_type" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/aaa-governance-console
Scenario: List governance controls returns "Bad Request" response
Given operation "ListGovernanceControls" enabled
Expand All @@ -49,6 +108,52 @@ Feature: Governance Controls
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/aaa-governance-console
Scenario: Mitigate governance detections returns "Accepted" response
Given operation "CreateGovernanceMitigation" enabled
And new "CreateGovernanceMitigation" request
And body with value {"data": {"attributes": {"detection_ids": ["3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d"], "detection_type": "unused_api_keys", "mitigation_type": "revoke_api_key"}, "type": "governance_control_detection"}}
When the request is sent
Then the response status is 202 Accepted

@generated @skip @team:DataDog/aaa-governance-console
Scenario: Mitigate governance detections returns "Bad Request" response
Given operation "CreateGovernanceMitigation" enabled
And new "CreateGovernanceMitigation" request
And body with value {"data": {"attributes": {"detection_ids": ["3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d"], "detection_type": "unused_api_keys", "mitigation_type": "revoke_api_key"}, "type": "governance_control_detection"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/aaa-governance-console
Scenario: Update a governance control detection returns "Bad Request" response
Given operation "UpdateGovernanceControlDetection" enabled
And new "UpdateGovernanceControlDetection" request
And request contains "detection_type" parameter from "REPLACE.ME"
And request contains "detection_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"assigned_team": "platform-security", "assigned_to": "11111111-2222-3333-4444-555555555555", "mitigate_after": "2024-03-15T00:00:00Z", "state": "exception"}, "type": "governance_control_detection"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/aaa-governance-console
Scenario: Update a governance control detection returns "Not Found" response
Given operation "UpdateGovernanceControlDetection" enabled
And new "UpdateGovernanceControlDetection" request
And request contains "detection_type" parameter from "REPLACE.ME"
And request contains "detection_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"assigned_team": "platform-security", "assigned_to": "11111111-2222-3333-4444-555555555555", "mitigate_after": "2024-03-15T00:00:00Z", "state": "exception"}, "type": "governance_control_detection"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/aaa-governance-console
Scenario: Update a governance control detection returns "OK" response
Given operation "UpdateGovernanceControlDetection" enabled
And new "UpdateGovernanceControlDetection" request
And request contains "detection_type" parameter from "REPLACE.ME"
And request contains "detection_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"assigned_team": "platform-security", "assigned_to": "11111111-2222-3333-4444-555555555555", "mitigate_after": "2024-03-15T00:00:00Z", "state": "exception"}, "type": "governance_control_detection"}}
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/aaa-governance-console
Scenario: Update a governance control returns "Bad Request" response
Given operation "UpdateGovernanceControl" enabled
Expand All @@ -75,3 +180,21 @@ Feature: Governance Controls
And body with value {"data": {"attributes": {"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": "governance_control"}}
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/aaa-governance-console
Scenario: Update governance control notification settings returns "Bad Request" response
Given operation "UpdateGovernanceControlNotificationSettings" enabled
And new "UpdateGovernanceControlNotificationSettings" request
And request contains "detection_type" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"event_settings": [{"enabled": true, "event_type": "new_detection", "targets": [{"handle": "#governance-alerts", "type": "slack"}]}]}, "type": "control_notification_settings"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/aaa-governance-console
Scenario: Update governance control notification settings returns "OK" response
Given operation "UpdateGovernanceControlNotificationSettings" enabled
And new "UpdateGovernanceControlNotificationSettings" request
And request contains "detection_type" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"event_settings": [{"enabled": true, "event_type": "new_detection", "targets": [{"handle": "#governance-alerts", "type": "slack"}]}]}, "type": "control_notification_settings"}}
When the request is sent
Then the response status is 200 OK
Loading
Loading