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
717 changes: 717 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions examples/v2/governance-controls/GetGovernanceControl.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get a governance 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
p api_instance.get_governance_control("detection_type")
8 changes: 8 additions & 0 deletions examples/v2/governance-controls/ListGovernanceControls.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List governance 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
p api_instance.list_governance_controls()
22 changes: 22 additions & 0 deletions examples/v2/governance-controls/UpdateGovernanceControl.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Update a governance 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

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,
}),
})
p api_instance.update_governance_control("detection_type", body)
7 changes: 7 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3353,6 +3353,13 @@
"saml_config_uuid" => "String",
"body" => "SAMLConfigurationUpdateRequest",
},
"v2.GetGovernanceControl" => {
"detection_type" => "String",
},
"v2.UpdateGovernanceControl" => {
"detection_type" => "String",
"body" => "GovernanceControlUpdateRequest",
},
"v2.ListGovernanceInsights" => {
"with_values" => "Boolean",
"org_uuid" => "String",
Expand Down
77 changes: 77 additions & 0 deletions features/v2/governance_controls.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
@endpoint(governance-controls) @endpoint(governance-controls-v2)
Feature: Governance Controls
Governance Controls pair a detection definition with an organization's
detection, notification, and mitigation configuration within the
Governance Console. Each control reports how a class of governance issue
(such as unused API keys or unqueried metrics) is detected and remediated,
along with counts of active and mitigated detections.

Background:
Given a valid "apiKeyAuth" key in the system
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 returns "Bad Request" response
Given operation "GetGovernanceControl" enabled
And new "GetGovernanceControl" 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 a governance control returns "Not Found" response
Given operation "GetGovernanceControl" enabled
And new "GetGovernanceControl" request
And request contains "detection_type" 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 returns "OK" response
Given operation "GetGovernanceControl" enabled
And new "GetGovernanceControl" 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
And new "ListGovernanceControls" request
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/aaa-governance-console
Scenario: List governance controls returns "OK" response
Given operation "ListGovernanceControls" enabled
And new "ListGovernanceControls" request
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
And new "UpdateGovernanceControl" request
And request contains "detection_type" parameter from "REPLACE.ME"
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 400 Bad Request

@generated @skip @team:DataDog/aaa-governance-console
Scenario: Update a governance control returns "Not Found" response
Given operation "UpdateGovernanceControl" enabled
And new "UpdateGovernanceControl" request
And request contains "detection_type" parameter from "REPLACE.ME"
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 404 Not Found

@generated @skip @team:DataDog/aaa-governance-console
Scenario: Update a governance control returns "OK" response
Given operation "UpdateGovernanceControl" enabled
And new "UpdateGovernanceControl" request
And request contains "detection_type" parameter from "REPLACE.ME"
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
18 changes: 18 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2762,6 +2762,24 @@
"type": "safe"
}
},
"ListGovernanceControls": {
"tag": "Governance Controls",
"undo": {
"type": "safe"
}
},
"GetGovernanceControl": {
"tag": "Governance Controls",
"undo": {
"type": "safe"
}
},
"UpdateGovernanceControl": {
"tag": "Governance Controls",
"undo": {
"type": "idempotent"
}
},
"ListGovernanceInsights": {
"tag": "Governance Insights",
"undo": {
Expand Down
3 changes: 3 additions & 0 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,9 @@ def initialize
"v2.upsert_and_publish_form_version": false,
"v2.upsert_form_version": false,
"v2.update_org_saml_configurations": false,
"v2.get_governance_control": false,
"v2.list_governance_controls": false,
"v2.update_governance_control": false,
"v2.list_governance_insights": false,
"v2.create_hamr_org_connection": false,
"v2.get_hamr_org_connection": false,
Expand Down
12 changes: 12 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3540,6 +3540,17 @@ def overrides
"v2.google_meet_configuration_reference" => "GoogleMeetConfigurationReference",
"v2.google_meet_configuration_reference_data" => "GoogleMeetConfigurationReferenceData",
"v2.governance_best_practice_definition" => "GovernanceBestPracticeDefinition",
"v2.governance_control_attributes" => "GovernanceControlAttributes",
"v2.governance_control_data" => "GovernanceControlData",
"v2.governance_control_mitigation_definition" => "GovernanceControlMitigationDefinition",
"v2.governance_control_parameter_definition" => "GovernanceControlParameterDefinition",
"v2.governance_control_resource_type" => "GovernanceControlResourceType",
"v2.governance_control_response" => "GovernanceControlResponse",
"v2.governance_controls_response" => "GovernanceControlsResponse",
"v2.governance_control_supported_value" => "GovernanceControlSupportedValue",
"v2.governance_control_update_attributes" => "GovernanceControlUpdateAttributes",
"v2.governance_control_update_data" => "GovernanceControlUpdateData",
"v2.governance_control_update_request" => "GovernanceControlUpdateRequest",
"v2.governance_insight_attributes" => "GovernanceInsightAttributes",
"v2.governance_insight_audit_compute" => "GovernanceInsightAuditCompute",
"v2.governance_insight_audit_query" => "GovernanceInsightAuditQuery",
Expand Down Expand Up @@ -7868,6 +7879,7 @@ def overrides
"v2.forms_api" => "FormsAPI",
"v2.gcp_integration_api" => "GCPIntegrationAPI",
"v2.google_chat_integration_api" => "GoogleChatIntegrationAPI",
"v2.governance_controls_api" => "GovernanceControlsAPI",
"v2.governance_insights_api" => "GovernanceInsightsAPI",
"v2.high_availability_multi_region_api" => "HighAvailabilityMultiRegionAPI",
"v2.incidents_api" => "IncidentsAPI",
Expand Down
Loading
Loading