diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml
index 0f86b610623..664055f3f4e 100644
--- a/.generator/schemas/v2/openapi.yaml
+++ b/.generator/schemas/v2/openapi.yaml
@@ -21956,6 +21956,125 @@ components:
- IDENTITY
- GZIP
- DEFLATE
+ ControlNotificationEventSetting:
+ description: The notification settings for a single event type on a control.
+ properties:
+ enabled:
+ description: Whether notifications are enabled for this event type.
+ example: true
+ type: boolean
+ event_type:
+ description: The event type the notification settings apply to, such as `new_detection`.
+ example: "new_detection"
+ type: string
+ targets:
+ $ref: "#/components/schemas/ControlNotificationTargetArray"
+ required:
+ - event_type
+ - enabled
+ - targets
+ type: object
+ ControlNotificationEventSettingsArray:
+ description: The notification settings for each supported event type on the control.
+ items:
+ $ref: "#/components/schemas/ControlNotificationEventSetting"
+ type: array
+ ControlNotificationSettingsAttributes:
+ description: The attributes of a governance control's notification settings.
+ properties:
+ event_settings:
+ $ref: "#/components/schemas/ControlNotificationEventSettingsArray"
+ required:
+ - event_settings
+ type: object
+ ControlNotificationSettingsData:
+ description: A control notification settings resource.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/ControlNotificationSettingsAttributes"
+ id:
+ description: The detection type the notification settings apply to.
+ example: "unused_api_keys"
+ type: string
+ type:
+ $ref: "#/components/schemas/ControlNotificationSettingsResourceType"
+ required:
+ - id
+ - type
+ - attributes
+ type: object
+ ControlNotificationSettingsResourceType:
+ description: Control notification settings resource type.
+ enum:
+ - control_notification_settings
+ example: "control_notification_settings"
+ type: string
+ x-enum-varnames:
+ - CONTROL_NOTIFICATION_SETTINGS
+ ControlNotificationSettingsResponse:
+ description: The notification settings for a governance control.
+ properties:
+ data:
+ $ref: "#/components/schemas/ControlNotificationSettingsData"
+ required:
+ - data
+ type: object
+ ControlNotificationSettingsUpdateAttributes:
+ description: The attributes of a governance control's notification settings that can be updated.
+ properties:
+ event_settings:
+ $ref: "#/components/schemas/ControlNotificationEventSettingsArray"
+ type: object
+ ControlNotificationSettingsUpdateData:
+ description: The data of a control notification settings update request.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/ControlNotificationSettingsUpdateAttributes"
+ type:
+ $ref: "#/components/schemas/ControlNotificationSettingsResourceType"
+ required:
+ - type
+ type: object
+ ControlNotificationSettingsUpdateRequest:
+ description: A request to update the notification settings for a governance control.
+ properties:
+ data:
+ $ref: "#/components/schemas/ControlNotificationSettingsUpdateData"
+ required:
+ - data
+ type: object
+ ControlNotificationTarget:
+ description: A destination that receives notifications for an event type.
+ properties:
+ handle:
+ description: The destination handle, such as an email address, Slack channel, or user handle.
+ example: "#governance-alerts"
+ type: string
+ type:
+ $ref: "#/components/schemas/ControlNotificationTargetType"
+ required:
+ - type
+ - handle
+ type: object
+ ControlNotificationTargetArray:
+ description: The destinations that receive notifications for an event type.
+ items:
+ $ref: "#/components/schemas/ControlNotificationTarget"
+ type: array
+ ControlNotificationTargetType:
+ description: The type of notification destination.
+ enum:
+ - email
+ - slack
+ - at_mention
+ - case
+ example: "slack"
+ type: string
+ x-enum-varnames:
+ - EMAIL
+ - SLACK
+ - AT_MENTION
+ - CASE
ConvertJobResultsToSignalsAttributes:
description: Attributes for converting historical job results to signals.
properties:
@@ -43372,91 +43491,68 @@ components:
- id
- type
type: object
- GovernanceBestPracticeDefinition:
- description: |-
- The best practice associated with an insight. Populated with the first active best practice
- matched to the insight; `null` when no best practice is attached.
+ GovernanceConfigAttributes:
+ description: The attributes of a Governance Console configuration.
properties:
- category:
+ assignment_notifications_enabled:
+ description: Whether notifications are sent to users when detections are assigned to them.
+ example: true
+ type: boolean
+ enabled:
+ description: Whether the Governance Console is enabled for the organization.
+ example: true
+ type: boolean
+ usage_attribution_configured:
+ description: Whether usage attribution is configured for the organization.
+ example: true
+ type: boolean
+ xorg_insights_enabled:
description: |-
- The value driver the best practice is grouped under, such as `access_governance`,
- `security`, `compliance`, or `operational_hygiene`.
- example: "access_governance"
- type: string
- deep_link:
- description: A relative link to the configuration page where the best practice can be acted upon.
- example: "/organization-settings/users?status=inactive"
- type: string
- description:
- description: The full rationale and guidance for the best practice.
- example: "Review and deactivate users who have not logged in within the last 90 days."
- type: string
- detection_type:
- description: An optional association to a control's detection type. `null` when not associated with a control.
- example:
- nullable: true
- type: string
+ Whether the organization has opted in to sharing governance data with a managing org
+ for cross-org insights.
+ example: true
+ type: boolean
+ required:
+ - enabled
+ - assignment_notifications_enabled
+ - usage_attribution_configured
+ - xorg_insights_enabled
+ type: object
+ GovernanceConfigData:
+ description: A Governance Console configuration resource.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/GovernanceConfigAttributes"
id:
- description: The unique identifier of the best practice.
- example: "bp_monitor_inactive_users"
- type: string
- impact:
- description: The expected impact of following the best practice.
- example: "Reduces unauthorized access risk."
- type: string
- impact_hint:
- description: |-
- A priority hint for ordering best practices by expected impact. Lower values indicate
- higher priority.
- example: 1
- format: int64
- type: integer
- permissions:
- description: The permissions required for the user to act on the best practice.
- example:
- - "user_access_manage"
- items:
- description: A permission required to act on the best practice.
- type: string
- type: array
- status:
- description: Whether the best practice is currently `active` or `deprecated`.
- example: "active"
- type: string
- summary:
- description: A one-line explanation of why this best practice matters.
- example: "Inactive users with access increase your security surface area."
- type: string
- title:
- description: A short, human-readable name for the best practice.
- example: "Monitor inactive users"
- type: string
- trigger_condition:
description: |-
- The condition that surfaces the best practice. For an `insight` trigger, the insight
- slug; for a `static` trigger, a descriptive condition key.
- example: "active_users"
- type: string
- trigger_type:
- description: |-
- How the best practice is surfaced. `insight` ties it to an insight; `static` surfaces it
- unless its condition is met.
- example: "insight"
+ The unique identifier of the organization the Governance Console configuration applies
+ to. May be the nil UUID (`00000000-0000-0000-0000-000000000000`) when the configuration
+ is not tied to a specific organization record.
+ example: "00000000-0000-0000-0000-000000000000"
type: string
+ type:
+ $ref: "#/components/schemas/GovernanceConsoleConfigResourceType"
required:
- id
- - title
- - summary
- - description
- - category
- - impact
- - trigger_type
- - trigger_condition
- - deep_link
- - permissions
- - impact_hint
- - status
+ - type
+ - attributes
+ type: object
+ GovernanceConfigResponse:
+ description: The Governance Console configuration for an organization.
+ properties:
+ data:
+ $ref: "#/components/schemas/GovernanceConfigData"
+ required:
+ - data
type: object
+ GovernanceConsoleConfigResourceType:
+ description: Governance console config resource type.
+ enum:
+ - governance_console_config
+ example: "governance_console_config"
+ type: string
+ x-enum-varnames:
+ - GOVERNANCE_CONSOLE_CONFIG
GovernanceControlAttributes:
description: The attributes of a governance control.
properties:
@@ -43489,17 +43585,6 @@ components:
detection_parameters:
$ref: "#/components/schemas/GovernanceControlParametersMap"
nullable: true
- detection_type:
- description: The detection type that uniquely identifies the control.
- example: "unused_api_keys"
- type: string
- feature_flags:
- description: The feature flags that gate the control.
- example: []
- items:
- description: A feature flag that gates the control.
- type: string
- type: array
insights:
description: The insight slugs associated with the control.
example: []
@@ -43531,21 +43616,6 @@ components:
description: Human-readable name of the control.
example: "Unused API Keys"
type: string
- next_steps:
- description: Guidance on the next steps to remediate detections for the control.
- example: "Review and revoke API keys that are no longer in use to maintain a secure authentication posture."
- type: string
- notification_frequency:
- description: The configured notification frequency for the control. Empty when not configured.
- example: ""
- type: string
- notification_parameters:
- $ref: "#/components/schemas/GovernanceControlParametersMap"
- nullable: true
- notification_type:
- description: The configured notification type for the control. Empty when not configured.
- example: ""
- type: string
priority:
description: The priority of the control, such as `High`.
example: "High"
@@ -43554,10 +43624,6 @@ components:
description: The product the control belongs to.
example: "api_keys"
type: string
- release_status:
- description: The release status of the control, such as `prod` or `beta`.
- example: "prod"
- type: string
resource_type:
description: The type of resource the control evaluates.
example: "api_key"
@@ -43568,44 +43634,24 @@ components:
type: string
supported_detection_parameters:
$ref: "#/components/schemas/GovernanceControlParameterDefinitionArray"
- supported_notification_parameters:
- $ref: "#/components/schemas/GovernanceControlParameterDefinitionArray"
- task:
- description: A short description of the remediation task for the control.
- example: "Review and revoke unused API keys."
- type: string
type:
description: The control type, such as `Proactive` or `Detection`.
example: "Proactive"
type: string
- usage_concern:
- description: The usage concern the control addresses, such as `Security` or `Cost Optimization`.
- example: "Security"
- type: string
required:
- name
- description
- - detection_type
- supported_detection_parameters
- - supported_notification_parameters
- resource_type
- resource_type_display_name
- product
- category
- insights
- mitigations
- - task
- - next_steps
- - release_status
- - feature_flags
- type
- priority
- - usage_concern
- detection_parameters
- detection_frequency
- - notification_type
- - notification_parameters
- - notification_frequency
- mitigation_type
- mitigation_parameters
- created_at
@@ -43620,8 +43666,8 @@ components:
attributes:
$ref: "#/components/schemas/GovernanceControlAttributes"
id:
- description: The unique identifier of the control.
- example: "0d4e6f8a-1b2c-3d4e-5f6a-7b8c9d0e1f2a"
+ description: The detection type that uniquely identifies the control.
+ example: "unused_api_keys"
type: string
type:
$ref: "#/components/schemas/GovernanceControlResourceType"
@@ -43630,13 +43676,217 @@ components:
- type
- attributes
type: object
+ GovernanceControlDetectionAssignmentSource:
+ description: How the detection's current assignment was determined. Possible values are `auto_resolved`, `manual`, `reassigned`, and `cleared`.
+ enum:
+ - auto_resolved
+ - manual
+ - reassigned
+ - cleared
+ example: "manual"
+ type: string
+ x-enum-varnames:
+ - AUTO_RESOLVED
+ - MANUAL
+ - REASSIGNED
+ - CLEARED
+ GovernanceControlDetectionAttributes:
+ description: The attributes of a governance control detection.
+ properties:
+ assigned_team:
+ description: The identifier of the team the detection is assigned to, if any.
+ example: "platform-security"
+ type: string
+ assigned_to:
+ description: The identifier of the user the detection is assigned to, if any.
+ example: "11111111-2222-3333-4444-555555555555"
+ type: string
+ assignment_source:
+ $ref: "#/components/schemas/GovernanceControlDetectionAssignmentSource"
+ control_id:
+ deprecated: true
+ description: |-
+ DEPRECATED: mirrors `detection_type` for backward compatibility; use `detection_type`
+ instead.
+ example: "unused_api_keys"
+ type: string
+ created_at:
+ description: The date and time when the detection was created.
+ example: "2024-03-01T12:00:00Z"
+ format: date-time
+ type: string
+ detection_type:
+ description: The type of detection, which determines what condition was detected.
+ example: "unused_api_keys"
+ type: string
+ display_name:
+ description: The human-readable name of the detected resource.
+ example: "CI Deploy Key"
+ type: string
+ exception_at:
+ description: The date and time when the detection was marked as an exception, if applicable.
+ example: "2024-03-05T09:00:00Z"
+ format: date-time
+ type: string
+ exception_by:
+ description: The identifier of the user who marked the detection as an exception, if applicable.
+ example: "11111111-2222-3333-4444-555555555555"
+ type: string
+ metadata:
+ description: Free-form metadata associated with the detection.
+ example:
+ region: "us-east-1"
+ mitigate_after:
+ description: The date and time after which the detection is scheduled to be mitigated, if applicable.
+ example: "2024-03-15T00:00:00Z"
+ format: date-time
+ type: string
+ mitigated_at:
+ description: The date and time when the detection was mitigated, if applicable.
+ example: "2024-03-10T15:30:00Z"
+ format: date-time
+ type: string
+ priority:
+ description: The priority of the detection, if set.
+ example: 1
+ format: int64
+ type: integer
+ resource_id:
+ description: The identifier of the resource the detection applies to.
+ example: "api-key-12345"
+ type: string
+ resource_type:
+ description: The type of resource the detection applies to, for example `api_key` or `dashboard`.
+ example: "api_key"
+ type: string
+ state:
+ $ref: "#/components/schemas/GovernanceControlDetectionState"
+ required:
+ - state
+ - control_id
+ - resource_id
+ - detection_type
+ - resource_type
+ - display_name
+ - created_at
+ - assignment_source
+ - priority
+ type: object
+ GovernanceControlDetectionData:
+ description: A governance control detection resource.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/GovernanceControlDetectionAttributes"
+ id:
+ description: The unique identifier of the detection.
+ example: "3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d"
+ type: string
+ type:
+ $ref: "#/components/schemas/GovernanceControlDetectionResourceType"
+ required:
+ - id
+ - type
+ - attributes
+ type: object
+ GovernanceControlDetectionResourceType:
+ description: Governance control detection resource type.
+ enum:
+ - governance_control_detection
+ example: "governance_control_detection"
+ type: string
+ x-enum-varnames:
+ - GOVERNANCE_CONTROL_DETECTION
+ GovernanceControlDetectionResponse:
+ description: A single governance control detection.
+ properties:
+ data:
+ $ref: "#/components/schemas/GovernanceControlDetectionData"
+ required:
+ - data
+ type: object
+ GovernanceControlDetectionState:
+ description: The current state of the detection. Possible values are `active`, `exception`, `mitigated`, `inactive`, `obsolete`, `resolved_externally`, and `mitigation_in_progress`.
+ enum:
+ - active
+ - exception
+ - mitigated
+ - inactive
+ - obsolete
+ - resolved_externally
+ - mitigation_in_progress
+ example: "active"
+ type: string
+ x-enum-varnames:
+ - ACTIVE
+ - EXCEPTION
+ - MITIGATED
+ - INACTIVE
+ - OBSOLETE
+ - RESOLVED_EXTERNALLY
+ - MITIGATION_IN_PROGRESS
+ GovernanceControlDetectionUpdateAttributes:
+ description: The attributes of a governance control detection that can be updated. Only the attributes present in the request are modified.
+ properties:
+ assigned_team:
+ description: The handle of the team the detection is assigned to. Set to an empty string to clear the assignment.
+ example: "platform-security"
+ type: string
+ assigned_to:
+ description: The UUID of the user the detection is assigned to. Set to an empty string to clear the assignment.
+ example: "11111111-2222-3333-4444-555555555555"
+ type: string
+ mitigate_after:
+ description: The timestamp after which the detection becomes eligible for mitigation. Used to defer mitigation to a later time.
+ example: "2024-03-15T00:00:00Z"
+ format: date-time
+ type: string
+ state:
+ $ref: "#/components/schemas/GovernanceControlDetectionUpdateState"
+ type: object
+ GovernanceControlDetectionUpdateData:
+ description: The data of a governance control detection update request.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/GovernanceControlDetectionUpdateAttributes"
+ type:
+ $ref: "#/components/schemas/GovernanceControlDetectionResourceType"
+ required:
+ - type
+ type: object
+ GovernanceControlDetectionUpdateRequest:
+ description: A request to update a governance control detection.
+ properties:
+ data:
+ $ref: "#/components/schemas/GovernanceControlDetectionUpdateData"
+ required:
+ - data
+ type: object
+ GovernanceControlDetectionUpdateState:
+ description: The new state to set for the detection. Set to `exception` to acknowledge the detection and exclude it from active counts, or `active` to reopen it.
+ enum:
+ - exception
+ - active
+ example: "exception"
+ type: string
+ x-enum-varnames:
+ - EXCEPTION
+ - ACTIVE
+ GovernanceControlDetectionsDataArray:
+ description: An array of governance control detection resources.
+ items:
+ $ref: "#/components/schemas/GovernanceControlDetectionData"
+ type: array
+ GovernanceControlDetectionsResponse:
+ description: A list of governance control detections.
+ properties:
+ data:
+ $ref: "#/components/schemas/GovernanceControlDetectionsDataArray"
+ required:
+ - data
+ type: object
GovernanceControlMitigationDefinition:
description: The definition of a mitigation available for a control.
properties:
- action_verb:
- description: The verb describing the mitigation action, such as `revoke` or `delete`.
- example: "revoke"
- type: string
description:
description: A human-readable description of the mitigation.
example: "Automatically identifies and revokes inactive API keys to improve security and reduce potential attack surface."
@@ -43650,21 +43900,10 @@ components:
description: An execution mode the mitigation supports.
type: string
type: array
- feature_flags:
- description: The feature flags that gate the mitigation.
- example: []
- items:
- description: A feature flag that gates the mitigation.
- type: string
- type: array
id:
description: The unique identifier of the mitigation.
example: "revoke_api_key"
type: string
- manual_mitigation_warning:
- description: A warning shown to the user before applying the mitigation manually.
- example: "These API keys will be revoked immediately upon confirmation. To revoke future API keys, you must go through this flow again."
- type: string
permissions:
description: The permissions required to apply the mitigation.
example:
@@ -43674,10 +43913,6 @@ components:
description: A permission required to apply the mitigation.
type: string
type: array
- requires_ai:
- description: Whether the mitigation requires AI to be enabled.
- example: false
- type: boolean
supported_parameters:
$ref: "#/components/schemas/GovernanceControlParameterDefinitionArray"
title:
@@ -43688,12 +43923,9 @@ components:
- id
- title
- description
- - action_verb
- supported_parameters
- permissions
- - manual_mitigation_warning
- - feature_flags
- - requires_ai
+ - execution_modes
type: object
GovernanceControlMitigationDefinitionArray:
description: The mitigations available for a control.
@@ -43714,10 +43946,6 @@ components:
description: The human-readable name of the parameter.
example: "Unused API Key Threshold"
type: string
- hidden:
- description: Whether the parameter is hidden from the UI.
- example: false
- type: boolean
name:
description: The machine-readable name of the parameter.
example: "api_key_threshold"
@@ -43738,7 +43966,6 @@ components:
- description
- type
- required
- - hidden
- supported_values
- default_value
type: object
@@ -43804,31 +44031,12 @@ components:
description: The mitigation type to configure for the control.
example: "revoke_api_key"
type: string
- name:
- description: A new human-readable name for the control.
- example: "Unused API Keys"
- type: string
- notification_frequency:
- description: The notification frequency to configure for the control.
- example: "daily"
- type: string
- notification_parameters:
- $ref: "#/components/schemas/GovernanceControlParametersMap"
- nullable: true
- notification_type:
- description: The notification type to configure for the control.
- example: "slack"
- type: string
type: object
GovernanceControlUpdateData:
description: The data of a governance control update request.
properties:
attributes:
$ref: "#/components/schemas/GovernanceControlUpdateAttributes"
- id:
- description: The unique identifier of the control.
- example: "0d4e6f8a-1b2c-3d4e-5f6a-7b8c9d0e1f2a"
- type: string
type:
$ref: "#/components/schemas/GovernanceControlResourceType"
required:
@@ -43856,18 +44064,14 @@ components:
- data
type: object
GovernanceInsightAttributes:
- description: The attributes of a governance insight.
+ description: |-
+ The attributes of a governance insight. Exactly one of `metric_query`, `event_query`,
+ `usage_query`, `audit_query`, or `percentage_query` is populated, depending on the data
+ source the insight is computed from; the rest are `null`.
properties:
audit_query:
$ref: "#/components/schemas/GovernanceInsightAuditQuery"
nullable: true
- best_practice:
- $ref: "#/components/schemas/GovernanceBestPracticeDefinition"
- nullable: true
- deep_link:
- description: A relative link to the product surface where the insight can be acted upon.
- example: ""
- type: string
description:
description: A human-readable description of what the insight measures.
example: "Number of users who have used the Dashboard in the last 30 days"
@@ -43882,14 +44086,6 @@ components:
metric_query:
$ref: "#/components/schemas/GovernanceInsightMetricQuery"
nullable: true
- old_value:
- description: |-
- The value of the insight over the previous comparison window. `null` when values were
- not requested or could not be computed.
- example: 3274
- format: double
- nullable: true
- type: number
percentage_query:
$ref: "#/components/schemas/GovernanceInsightPercentageQuery"
nullable: true
@@ -43900,17 +44096,6 @@ components:
query_config:
$ref: "#/components/schemas/GovernanceInsightQueryConfig"
nullable: true
- sort_order:
- description: The relative order in which the insight should be displayed.
- example: 1
- format: int64
- type: integer
- state:
- description: |-
- The state of the insight. A `critical` insight receives extra UI treatment to draw
- attention to it.
- example: "critical"
- type: string
sub_product:
description: The sub-product the insight belongs to, if any.
example: "Indexes"
@@ -43926,29 +44111,13 @@ components:
usage_query:
$ref: "#/components/schemas/GovernanceInsightUsageQuery"
nullable: true
- value:
- description: The current value of the insight. `null` when values were not requested or could not be computed.
- example: 3601
- format: double
- nullable: true
- type: number
required:
- display_name
- product
- - best_practice
- sub_product
- unit_name
- description
- time_range
- - state
- - deep_link
- - value
- - old_value
- - metric_query
- - event_query
- - usage_query
- - audit_query
- - percentage_query
type: object
GovernanceInsightAuditCompute:
description: The aggregation applied to an audit log query.
@@ -44018,6 +44187,18 @@ components:
- type
- attributes
type: object
+ GovernanceInsightDirectionality:
+ description: Whether an increase in the insight's value is good, bad, or neutral.
+ enum:
+ - neutral
+ - increase_better
+ - decrease_better
+ example: "neutral"
+ type: string
+ x-enum-varnames:
+ - NEUTRAL
+ - INCREASE_BETTER
+ - DECREASE_BETTER
GovernanceInsightEventCompute:
description: The aggregation applied to an event query.
properties:
@@ -44095,7 +44276,7 @@ components:
example: "line"
type: string
comparison_shift:
- description: The window used for the previous value comparison, for example `week` or `month`.
+ description: The window used for the previous value comparison; for example, `week` or `month`.
example: "month"
type: string
default_value:
@@ -44104,11 +44285,7 @@ components:
format: int64
type: integer
directionality:
- description: |-
- Whether an increase in the value is good, bad, or neutral. One of `neutral`,
- `increase_better`, or `decrease_better`.
- example: "neutral"
- type: string
+ $ref: "#/components/schemas/GovernanceInsightDirectionality"
effective_time_window_days:
description: The number of days the insight value is computed over.
example: 30
@@ -44154,6 +44331,355 @@ components:
required:
- data
type: object
+ GovernanceLimitAttributes:
+ description: The attributes of a usage limit.
+ properties:
+ description:
+ description: A description of what the limit measures.
+ example: "The number of log events indexed in the last 30 days."
+ type: string
+ display_name:
+ description: The human-readable name of the limit.
+ example: "Indexed Logs"
+ type: string
+ limit_type:
+ description: The type of limit, such as a rate limit or a usage limit.
+ example: "usage"
+ type: string
+ product:
+ description: The Datadog product the limit belongs to.
+ example: "logs"
+ type: string
+ query:
+ $ref: "#/components/schemas/GovernanceLimitQuery"
+ query_config:
+ $ref: "#/components/schemas/GovernanceLimitQueryConfig"
+ time_range:
+ description: The time range over which usage against the limit is measured.
+ example: "month"
+ type: string
+ times_hit_limit:
+ description: The number of times usage has reached the limit within the measured time range.
+ example: 2
+ format: double
+ type: number
+ unit_name:
+ description: The unit in which the limit and its usage are measured.
+ example: "events"
+ type: string
+ usage_status:
+ description: The current usage status of the limit relative to its threshold.
+ example: "approaching"
+ type: string
+ required:
+ - display_name
+ - description
+ - product
+ - limit_type
+ - unit_name
+ - time_range
+ - query
+ - times_hit_limit
+ - usage_status
+ - query_config
+ type: object
+ GovernanceLimitData:
+ description: A usage limit resource.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/GovernanceLimitAttributes"
+ id:
+ description: The unique identifier of the limit.
+ example: "logs_indexed_events"
+ type: string
+ type:
+ $ref: "#/components/schemas/GovernanceLimitResourceType"
+ required:
+ - id
+ - type
+ - attributes
+ type: object
+ GovernanceLimitQuery:
+ description: A metric query used to compute usage against a limit.
+ properties:
+ query:
+ description: The metric query expression used to compute the limit value.
+ example: "sum:datadog.estimated_usage.logs.ingested_events{*}"
+ type: string
+ reducer:
+ description: How the query results are aggregated into a single value (for example, sum, max, or avg).
+ example: "sum"
+ type: string
+ source:
+ description: The data source used to evaluate the metric query (for example, the metrics or events backend).
+ example: "metrics"
+ type: string
+ required:
+ - source
+ - query
+ - reducer
+ type: object
+ GovernanceLimitQueryConfig:
+ description: The query execution context used to visualize a limit and its usage.
+ properties:
+ chart_type:
+ description: The chart type used to visualize the limit and its usage.
+ example: "line"
+ type: string
+ comparison_shift:
+ description: The time shift applied to compare current usage against a prior period.
+ example: "month"
+ type: string
+ default_value:
+ description: The default value used for the limit when no explicit value is configured.
+ example: 0
+ format: int64
+ type: integer
+ directionality:
+ description: The direction in which usage approaches the limit, indicating whether higher or lower values are closer to the limit.
+ example: "increase_better"
+ type: string
+ effective_time_window_days:
+ description: The number of days of data the limit query evaluates over.
+ example: 30
+ format: int64
+ type: integer
+ type: object
+ GovernanceLimitResourceType:
+ description: Limit resource type.
+ enum:
+ - limit
+ example: "limit"
+ type: string
+ x-enum-varnames:
+ - LIMIT
+ GovernanceLimitsDataArray:
+ description: An array of usage limit resources.
+ items:
+ $ref: "#/components/schemas/GovernanceLimitData"
+ type: array
+ GovernanceLimitsResponse:
+ description: A list of usage limits.
+ properties:
+ data:
+ $ref: "#/components/schemas/GovernanceLimitsDataArray"
+ required:
+ - data
+ type: object
+ GovernanceMitigationRequest:
+ description: A request to mitigate a set of governance detections.
+ properties:
+ data:
+ $ref: "#/components/schemas/GovernanceMitigationRequestData"
+ required:
+ - data
+ type: object
+ GovernanceMitigationRequestAttributes:
+ description: The attributes of a governance mitigation request.
+ properties:
+ detection_ids:
+ description: The identifiers of the detections to mitigate in this request.
+ example:
+ - "3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d"
+ items:
+ description: The identifier of a detection to mitigate in this request.
+ type: string
+ type: array
+ detection_type:
+ description: The detection type whose detections should be mitigated.
+ example: "unused_api_keys"
+ type: string
+ mitigation_parameters:
+ $ref: "#/components/schemas/GovernanceControlParametersMap"
+ nullable: true
+ mitigation_type:
+ description: The mitigation to apply to the selected detections. Defaults to the control's configured mitigation when omitted.
+ example: "revoke_api_key"
+ type: string
+ type: object
+ GovernanceMitigationRequestData:
+ description: The data of a governance mitigation request.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/GovernanceMitigationRequestAttributes"
+ type:
+ $ref: "#/components/schemas/GovernanceControlDetectionResourceType"
+ required:
+ - type
+ type: object
+ GovernanceNotificationSettingsAttributes:
+ description: The attributes of the organization-wide governance notification settings.
+ properties:
+ assignment_notifications_enabled:
+ description: Whether notifications are sent to users when detections are assigned to them.
+ example: true
+ type: boolean
+ required:
+ - assignment_notifications_enabled
+ type: object
+ GovernanceNotificationSettingsData:
+ description: A governance notification settings resource.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/GovernanceNotificationSettingsAttributes"
+ id:
+ description: The unique identifier of the organization the notification settings apply to.
+ example: "11111111-2222-3333-4444-555555555555"
+ type: string
+ type:
+ $ref: "#/components/schemas/GovernanceNotificationSettingsResourceType"
+ required:
+ - id
+ - type
+ - attributes
+ type: object
+ GovernanceNotificationSettingsResourceType:
+ description: Governance notification settings resource type.
+ enum:
+ - governance_notification_settings
+ example: "governance_notification_settings"
+ type: string
+ x-enum-varnames:
+ - GOVERNANCE_NOTIFICATION_SETTINGS
+ GovernanceNotificationSettingsResponse:
+ description: The organization-wide governance notification settings.
+ properties:
+ data:
+ $ref: "#/components/schemas/GovernanceNotificationSettingsData"
+ required:
+ - data
+ type: object
+ GovernanceNotificationSettingsUpdateAttributes:
+ description: The attributes of the governance notification settings that can be updated. Only the attributes present in the request are modified.
+ properties:
+ assignment_notifications_enabled:
+ description: Whether notifications are sent to users when detections are assigned to them.
+ example: true
+ type: boolean
+ type: object
+ GovernanceNotificationSettingsUpdateData:
+ description: The data of a governance notification settings update request.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/GovernanceNotificationSettingsUpdateAttributes"
+ type:
+ $ref: "#/components/schemas/GovernanceNotificationSettingsResourceType"
+ required:
+ - type
+ type: object
+ GovernanceNotificationSettingsUpdateRequest:
+ description: A request to update the organization-wide governance notification settings.
+ properties:
+ data:
+ $ref: "#/components/schemas/GovernanceNotificationSettingsUpdateData"
+ required:
+ - data
+ type: object
+ GovernanceResourceLimitAttributes:
+ description: The attributes of a governance resource limit.
+ properties:
+ current_limit:
+ description: The current limit configured for the resource.
+ example: 10000
+ format: double
+ type: number
+ current_value:
+ description: The current value of the resource.
+ example: 8200
+ format: double
+ type: number
+ default_current_value:
+ description: The default current value used when the resource value cannot be computed from the query.
+ example: 0
+ format: double
+ type: number
+ default_limit_value:
+ description: The default limit value used when the limit cannot be computed from the query.
+ example: 0
+ format: double
+ type: number
+ description:
+ description: A description of what the resource limit measures.
+ example: "The number of custom metrics in use against your contracted limit."
+ type: string
+ display_name:
+ description: The human-readable name of the resource limit.
+ example: "Custom Metrics"
+ type: string
+ limit_query:
+ $ref: "#/components/schemas/GovernanceLimitQuery"
+ product:
+ description: The Datadog product the resource limit belongs to.
+ example: "metrics"
+ type: string
+ query:
+ $ref: "#/components/schemas/GovernanceLimitQuery"
+ query_config:
+ $ref: "#/components/schemas/GovernanceLimitQueryConfig"
+ time_range:
+ description: The time range over which the resource value is measured.
+ example: "month"
+ type: string
+ unit_name:
+ description: The unit in which the resource value and limit are measured.
+ example: "metrics"
+ type: string
+ usage_status:
+ description: The current usage status of the resource relative to its limit.
+ example: "approaching"
+ type: string
+ required:
+ - display_name
+ - description
+ - product
+ - unit_name
+ - time_range
+ - current_value
+ - current_limit
+ - default_current_value
+ - default_limit_value
+ - query
+ - limit_query
+ - query_config
+ - usage_status
+ type: object
+ GovernanceResourceLimitData:
+ description: A governance resource limit resource.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/GovernanceResourceLimitAttributes"
+ id:
+ description: The unique identifier of the resource limit.
+ example: "custom_metrics"
+ type: string
+ type:
+ $ref: "#/components/schemas/GovernanceResourceLimitResourceType"
+ required:
+ - id
+ - type
+ - attributes
+ type: object
+ GovernanceResourceLimitResourceType:
+ description: Resource limit resource type.
+ enum:
+ - resource-limit
+ example: "resource-limit"
+ type: string
+ x-enum-varnames:
+ - RESOURCE_LIMIT
+ GovernanceResourceLimitsDataArray:
+ description: An array of governance resource limit resources.
+ items:
+ $ref: "#/components/schemas/GovernanceResourceLimitData"
+ type: array
+ GovernanceResourceLimitsResponse:
+ description: A list of governance resource limits.
+ properties:
+ data:
+ $ref: "#/components/schemas/GovernanceResourceLimitsDataArray"
+ required:
+ - data
+ type: object
GreyNoiseAPIKey:
description: The definition of the `GreyNoiseAPIKey` object.
properties:
@@ -143508,6 +144034,61 @@ paths:
operator: OR
permissions:
- user_access_read
+ /api/v2/governance/config:
+ get:
+ description: |-
+ Retrieve the Governance Console configuration for the organization, including whether the
+ Console is enabled, whether assignment notifications are enabled, and whether usage
+ attribution is configured.
+ operationId: GetGovernanceConfig
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ assignment_notifications_enabled: true
+ enabled: true
+ usage_attribution_configured: true
+ xorg_insights_enabled: true
+ id: "00000000-0000-0000-0000-000000000000"
+ type: "governance_console_config"
+ schema:
+ $ref: "#/components/schemas/GovernanceConfigResponse"
+ description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: Get the Governance Console configuration
+ tags:
+ - Governance Console
+ x-unstable: |-
+ **Note**: This endpoint is in preview and is subject to change.
+ If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/governance/control:
get:
description: |-
@@ -143532,60 +144113,37 @@ paths:
detection_frequency: "daily"
detection_parameters:
api_key_threshold: 30
- detection_type: "unused_api_keys"
- feature_flags: []
insights: []
last_detection_at: "2024-03-01T12:00:00Z"
mitigated_detections_count: 3
mitigation_parameters: {}
mitigation_type: ""
mitigations:
- - action_verb: "revoke"
- description: "Automatically identifies and revokes inactive API keys to improve security and reduce potential attack surface."
+ - description: "Automatically identifies and revokes inactive API keys to improve security and reduce potential attack surface."
execution_modes:
- "manual"
- "automatic"
- feature_flags: []
id: "revoke_api_key"
- manual_mitigation_warning: "These API keys will be revoked immediately upon confirmation. To revoke future API keys, you must go through this flow again."
permissions:
- "api_keys_write"
- "api_keys_delete"
- requires_ai: false
supported_parameters: []
title: "Revoke Unused API Keys"
name: "Unused API Keys"
- next_steps: "Review and revoke API keys that are no longer in use to maintain a secure authentication posture."
- notification_frequency: ""
- notification_parameters: {}
- notification_type: ""
priority: "High"
product: "api_keys"
- release_status: "prod"
resource_type: "api_key"
resource_type_display_name: "API Key"
supported_detection_parameters:
- default_value: 30
description: "Number of days of inactivity before an API key is considered unused."
display_name: "Unused API Key Threshold"
- hidden: false
name: "api_key_threshold"
required: false
supported_values: []
type: "integer"
- supported_notification_parameters:
- - default_value: false
- description: "Enables the Governance Console to automatically assign ownership of detections based off of tagging and other internal heuristics."
- display_name: "Automatic Ownership Assignment"
- hidden: false
- name: "governance_auto_assignment"
- required: false
- supported_values: []
- type: "boolean"
- task: "Review and revoke unused API keys."
type: "Proactive"
- usage_concern: "Security"
- id: "0d4e6f8a-1b2c-3d4e-5f6a-7b8c9d0e1f2a"
+ id: "unused_api_keys"
type: "governance_control"
schema:
$ref: "#/components/schemas/GovernanceControlsResponse"
@@ -143610,26 +144168,858 @@ paths:
description: Forbidden
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- summary: List governance controls
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: List controls
+ tags:
+ - Governance Console
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
+ x-unstable: |-
+ **Note**: This endpoint is in preview and is subject to change.
+ If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
+ /api/v2/governance/control/{detection_type}:
+ get:
+ description: |-
+ Retrieve a single governance control by its detection type, including the organization's current
+ detection, notification, and mitigation configuration and detection counts.
+ operationId: GetGovernanceControl
+ parameters:
+ - description: The detection type that identifies the control, for example `unused_api_keys`.
+ example: "unused_api_keys"
+ in: path
+ name: detection_type
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ active_detections_count: 12
+ category: "security"
+ created_at: "2024-01-15T09:30:00Z"
+ created_by: "11111111-2222-3333-4444-555555555555"
+ description: "Identifies API keys that have not been used within your specified time threshold, helping reduce security risks from dormant credentials."
+ detection_frequency: "daily"
+ detection_parameters:
+ api_key_threshold: 30
+ insights: []
+ last_detection_at: "2024-03-01T12:00:00Z"
+ mitigated_detections_count: 3
+ mitigation_parameters: {}
+ mitigation_type: "revoke_api_key"
+ mitigations: []
+ name: "Unused API Keys"
+ priority: "High"
+ product: "api_keys"
+ resource_type: "api_key"
+ resource_type_display_name: "API Key"
+ supported_detection_parameters:
+ - default_value: 30
+ description: "Number of days of inactivity before an API key is considered unused."
+ display_name: "Unused API Key Threshold"
+ name: "api_key_threshold"
+ required: false
+ supported_values: []
+ type: "integer"
+ type: "Proactive"
+ id: "unused_api_keys"
+ type: "governance_control"
+ schema:
+ $ref: "#/components/schemas/GovernanceControlResponse"
+ description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Not Found
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: Get a control
+ tags:
+ - Governance Console
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
+ x-unstable: |-
+ **Note**: This endpoint is in preview and is subject to change.
+ If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
+ patch:
+ description: |-
+ Update the detection, notification, and mitigation configuration of a governance control. Only
+ the attributes present in the request are modified. Changing the mitigation type or its
+ parameters may require additional permissions.
+ operationId: UpdateGovernanceControl
+ parameters:
+ - description: The detection type that identifies the control, for example `unused_api_keys`.
+ example: "unused_api_keys"
+ in: path
+ name: detection_type
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ detection_parameters:
+ api_key_threshold: 60
+ mitigation_type: "revoke_api_key"
+ type: "governance_control"
+ schema:
+ $ref: "#/components/schemas/GovernanceControlUpdateRequest"
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ active_detections_count: 12
+ category: "security"
+ created_at: "2024-01-15T09:30:00Z"
+ created_by: "11111111-2222-3333-4444-555555555555"
+ description: "Identifies API keys that have not been used within your specified time threshold, helping reduce security risks from dormant credentials."
+ detection_frequency: "daily"
+ detection_parameters:
+ api_key_threshold: 60
+ insights: []
+ last_detection_at: "2024-03-01T12:00:00Z"
+ mitigated_detections_count: 3
+ mitigation_parameters: {}
+ mitigation_type: "revoke_api_key"
+ mitigations: []
+ name: "Unused API Keys"
+ priority: "High"
+ product: "api_keys"
+ resource_type: "api_key"
+ resource_type_display_name: "API Key"
+ supported_detection_parameters: []
+ type: "Proactive"
+ id: "unused_api_keys"
+ type: "governance_control"
+ schema:
+ $ref: "#/components/schemas/GovernanceControlResponse"
+ description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Not Found
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: Update a control
+ tags:
+ - Governance Console
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
+ - governance_console_write
+ x-unstable: |-
+ **Note**: This endpoint is in preview and is subject to change.
+ If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
+ /api/v2/governance/control/{detection_type}/detections:
+ get:
+ description: |-
+ Retrieve the detections produced by the governance control with the given detection type.
+ Results can be filtered by state and free-text query, sorted, and paginated.
+ operationId: ListGovernanceControlDetections
+ parameters:
+ - description: The detection type that identifies the control; for example, `unused_api_keys`.
+ example: "unused_api_keys"
+ in: path
+ name: detection_type
+ required: true
+ schema:
+ type: string
+ - description: Restrict the results to detections in the given state.
+ example: "active"
+ in: query
+ name: filter[state]
+ required: false
+ schema:
+ type: string
+ - description: Restrict the results to detections matching the given free-text query.
+ example: "production"
+ in: query
+ name: filter[query]
+ required: false
+ schema:
+ type: string
+ - description: |-
+ A comma-separated list of attributes to sort detections by. Prefix an attribute with
+ `-` for descending order.
+
+ The attributes available for sorting are `id`, `created_at`, `assigned_to`,
+ `detection_type`, `display_name`, `exception_at`, `mitigate_after`, `mitigated_at`,
+ `priority`, `resource_id`, and `state`. Defaults to `created_at,-id`.
+ example: "-created_at,-id"
+ in: query
+ name: sort
+ required: false
+ schema:
+ type: string
+ - description: "The zero-based index of the page to return; the first page is 0."
+ example: 0
+ in: query
+ name: page[number]
+ required: false
+ schema:
+ default: 0
+ format: int64
+ type: integer
+ - description: The number of detections to return per page.
+ example: 50
+ in: query
+ name: page[size]
+ required: false
+ schema:
+ format: int64
+ type: integer
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ - attributes:
+ assigned_team: "platform-security"
+ assigned_to: "11111111-2222-3333-4444-555555555555"
+ assignment_source: "manual"
+ control_id: "unused_api_keys"
+ created_at: "2024-03-01T12:00:00Z"
+ detection_type: "unused_api_keys"
+ display_name: "CI Deploy Key"
+ metadata:
+ region: "us-east-1"
+ priority: 1
+ resource_id: "api-key-12345"
+ resource_type: "api_key"
+ state: "active"
+ id: "3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d"
+ type: "governance_control_detection"
+ schema:
+ $ref: "#/components/schemas/GovernanceControlDetectionsResponse"
+ description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: List control detections
+ tags:
+ - Governance Console
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
+ x-unstable: |-
+ **Note**: This endpoint is in preview and is subject to change.
+ If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
+ /api/v2/governance/control/{detection_type}/notification_settings:
+ get:
+ description: |-
+ Retrieve the notification settings for the governance control with the given detection type,
+ including, for each supported event type, whether notifications are enabled and which
+ destinations receive them.
+ operationId: GetGovernanceControlNotificationSettings
+ parameters:
+ - description: The detection type that identifies the control; for example, `unused_api_keys`.
+ example: "unused_api_keys"
+ in: path
+ name: detection_type
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ event_settings:
+ - enabled: true
+ event_type: "new_detection"
+ targets:
+ - handle: "#governance-alerts"
+ type: "slack"
+ id: "unused_api_keys"
+ type: "control_notification_settings"
+ schema:
+ $ref: "#/components/schemas/ControlNotificationSettingsResponse"
+ description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: Get control notification settings
+ tags:
+ - Governance Console
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
+ x-unstable: |-
+ **Note**: This endpoint is in preview and is subject to change.
+ If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
+ put:
+ description: |-
+ Replace the notification settings for the governance control with the given detection type,
+ setting, for each supported event type, whether notifications are enabled and which
+ destinations receive them.
+ operationId: UpdateGovernanceControlNotificationSettings
+ parameters:
+ - description: The detection type that identifies the control; for example, `unused_api_keys`.
+ example: "unused_api_keys"
+ in: path
+ name: detection_type
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ event_settings:
+ - enabled: true
+ event_type: "new_detection"
+ targets:
+ - handle: "#governance-alerts"
+ type: "slack"
+ type: "control_notification_settings"
+ schema:
+ $ref: "#/components/schemas/ControlNotificationSettingsUpdateRequest"
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ event_settings:
+ - enabled: true
+ event_type: "new_detection"
+ targets:
+ - handle: "#governance-alerts"
+ type: "slack"
+ id: "unused_api_keys"
+ type: "control_notification_settings"
+ schema:
+ $ref: "#/components/schemas/ControlNotificationSettingsResponse"
+ description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: Update control notification settings
+ tags:
+ - Governance Console
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
+ - governance_console_write
+ x-unstable: |-
+ **Note**: This endpoint is in preview and is subject to change.
+ If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
+ /api/v2/governance/detections/mitigate:
+ post:
+ description: |-
+ Apply a mitigation to a set of governance detections of a given detection type. When the
+ mitigation type is omitted, the control's configured mitigation is used. The request is
+ accepted for asynchronous processing.
+ operationId: MitigateGovernanceDetections
+ requestBody:
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ detection_ids:
+ - "3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d"
+ detection_type: "unused_api_keys"
+ mitigation_parameters: {}
+ mitigation_type: "revoke_api_key"
+ type: "governance_control_detection"
+ schema:
+ $ref: "#/components/schemas/GovernanceMitigationRequest"
+ required: true
+ responses:
+ "202":
+ description: Accepted
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: Mitigate detections
+ tags:
+ - Governance Console
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
+ x-unstable: |-
+ **Note**: This endpoint is in preview and is subject to change.
+ If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
+ /api/v2/governance/detections/{detection_id}:
+ get:
+ description: Retrieve a single governance detection by its unique identifier.
+ operationId: GetGovernanceDetection
+ parameters:
+ - description: The unique identifier of the detection.
+ example: "3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d"
+ in: path
+ name: detection_id
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ assigned_team: "platform-security"
+ assigned_to: "11111111-2222-3333-4444-555555555555"
+ assignment_source: "manual"
+ control_id: "unused_api_keys"
+ created_at: "2024-03-01T12:00:00Z"
+ detection_type: "unused_api_keys"
+ display_name: "CI Deploy Key"
+ metadata:
+ region: "us-east-1"
+ priority: 1
+ resource_id: "api-key-12345"
+ resource_type: "api_key"
+ state: "active"
+ id: "3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d"
+ type: "governance_control_detection"
+ schema:
+ $ref: "#/components/schemas/GovernanceControlDetectionResponse"
+ description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Not Found
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: Get a detection
+ tags:
+ - Governance Console
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
+ x-unstable: |-
+ **Note**: This endpoint is in preview and is subject to change.
+ If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
+ patch:
+ description: |-
+ Update a governance detection by its unique identifier. Only the attributes present in the
+ request are modified, allowing a detection to be acknowledged as an exception, reopened,
+ reassigned, or deferred for mitigation.
+ operationId: UpdateGovernanceDetection
+ parameters:
+ - description: The unique identifier of the detection.
+ example: "3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d"
+ in: path
+ name: detection_id
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ assigned_to: "11111111-2222-3333-4444-555555555555"
+ state: "exception"
+ type: "governance_control_detection"
+ schema:
+ $ref: "#/components/schemas/GovernanceControlDetectionUpdateRequest"
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ assigned_team: "platform-security"
+ assigned_to: "11111111-2222-3333-4444-555555555555"
+ assignment_source: "manual"
+ control_id: "unused_api_keys"
+ created_at: "2024-03-01T12:00:00Z"
+ detection_type: "unused_api_keys"
+ display_name: "CI Deploy Key"
+ metadata:
+ region: "us-east-1"
+ priority: 1
+ resource_id: "api-key-12345"
+ resource_type: "api_key"
+ state: "active"
+ id: "3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d"
+ type: "governance_control_detection"
+ schema:
+ $ref: "#/components/schemas/GovernanceControlDetectionResponse"
+ description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Not Found
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: Update a detection
+ tags:
+ - Governance Console
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
+ x-unstable: |-
+ **Note**: This endpoint is in preview and is subject to change.
+ If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
+ /api/v2/governance/insights:
+ get:
+ description: |-
+ Retrieve the list of governance insights available to the organization. Each insight
+ reports the query used to compute it, so that the value can be computed client-side.
+ Insights can be filtered by product.
+ operationId: ListGovernanceInsights
+ parameters:
+ - description: |-
+ Restrict the results to insights belonging to the given products. May be repeated to
+ filter by multiple products. Matching is case-insensitive.
+ example:
+ - "Usage"
+ - "Logs Settings"
+ in: query
+ name: filter[product]
+ required: false
+ schema:
+ items:
+ type: string
+ type: array
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ - attributes:
+ audit_query:
+ description: "Number of custom metrics submitted by the organization."
+ display_name: "Custom Metrics"
+ event_query:
+ metric_query:
+ query: "sum:datadog.estimated_usage.metrics.custom{*}"
+ reducer: "sum"
+ source: "metrics"
+ percentage_query:
+ product: "Usage"
+ query_config:
+ chart_type: "line"
+ comparison_shift: "month"
+ directionality: "decrease_better"
+ effective_time_window_days: 30
+ sub_product: ""
+ time_range: "month"
+ unit_name: "custom metrics"
+ usage_query:
+ id: "498ee21f-8037-48b8-a961-a488692902f4"
+ type: "insight"
+ - attributes:
+ audit_query:
+ compute:
+ aggregation: "cardinality"
+ interval: 86400000
+ metric: "@usr.id"
+ indexes:
+ - "main"
+ query: "@evt.name:Dashboard"
+ source: "audit"
+ description: "Number of users who have used the Dashboard in the last 30 days"
+ display_name: "Active Users"
+ event_query:
+ metric_query:
+ percentage_query:
+ product: "Usage"
+ query_config:
+ chart_type: "line"
+ comparison_shift: "month"
+ directionality: "neutral"
+ effective_time_window_days: 30
+ sub_product: ""
+ time_range: "month"
+ unit_name: "active users"
+ usage_query:
+ id: "a3248d1b-5578-4345-a34e-fe9657300f22"
+ type: "insight"
+ schema:
+ $ref: "#/components/schemas/GovernanceInsightsResponse"
+ description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - events_read
+ - metrics_read
+ summary: List insights
tags:
- - Governance Controls
+ - Governance Console
+ "x-permission":
+ operator: OR
+ permissions:
+ - metrics_read
+ - events_read
+ - audit_logs_read
+ - governance_console_read
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
- /api/v2/governance/control/{detection_type}:
+ /api/v2/governance/limits:
get:
description: |-
- Retrieve a single governance control by its detection type, including the organization's current
- detection, notification, and mitigation configuration and detection counts.
- operationId: GetGovernanceControl
- parameters:
- - description: The detection type that identifies the control, for example `unused_api_keys`.
- example: "unused_api_keys"
- in: path
- name: detection_type
- required: true
- schema:
- type: string
+ Retrieve the list of usage limits tracked for the organization in the Governance Console.
+ Each limit reports the query used to compute current usage, the unit and time range it is
+ measured over, and its current usage status.
+ operationId: ListGovernanceLimits
responses:
"200":
content:
@@ -143638,50 +145028,29 @@ paths:
default:
value:
data:
- attributes:
- active_detections_count: 12
- category: "security"
- created_at: "2024-01-15T09:30:00Z"
- created_by: "11111111-2222-3333-4444-555555555555"
- description: "Identifies API keys that have not been used within your specified time threshold, helping reduce security risks from dormant credentials."
- detection_frequency: "daily"
- detection_parameters:
- api_key_threshold: 30
- detection_type: "unused_api_keys"
- feature_flags: []
- insights: []
- last_detection_at: "2024-03-01T12:00:00Z"
- mitigated_detections_count: 3
- mitigation_parameters: {}
- mitigation_type: "revoke_api_key"
- mitigations: []
- name: "Unused API Keys"
- next_steps: "Review and revoke API keys that are no longer in use to maintain a secure authentication posture."
- notification_frequency: ""
- notification_parameters: {}
- notification_type: ""
- priority: "High"
- product: "api_keys"
- release_status: "prod"
- resource_type: "api_key"
- resource_type_display_name: "API Key"
- supported_detection_parameters:
- - default_value: 30
- description: "Number of days of inactivity before an API key is considered unused."
- display_name: "Unused API Key Threshold"
- hidden: false
- name: "api_key_threshold"
- required: false
- supported_values: []
- type: "integer"
- supported_notification_parameters: []
- task: "Review and revoke unused API keys."
- type: "Proactive"
- usage_concern: "Security"
- id: "0d4e6f8a-1b2c-3d4e-5f6a-7b8c9d0e1f2a"
- type: "governance_control"
+ - attributes:
+ description: "The number of log events indexed in the last 30 days."
+ display_name: "Indexed Logs"
+ limit_type: "usage"
+ product: "logs"
+ query:
+ query: "sum:datadog.estimated_usage.logs.ingested_events{*}"
+ reducer: "sum"
+ source: "metrics"
+ query_config:
+ chart_type: "line"
+ comparison_shift: "month"
+ default_value: 0
+ directionality: "increase_better"
+ effective_time_window_days: 30
+ time_range: "month"
+ times_hit_limit: 2
+ unit_name: "events"
+ usage_status: "approaching"
+ id: "logs_indexed_events"
+ type: "limit"
schema:
- $ref: "#/components/schemas/GovernanceControlResponse"
+ $ref: "#/components/schemas/GovernanceLimitsResponse"
description: OK
"400":
content:
@@ -143701,34 +145070,82 @@ paths:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Forbidden
- "404":
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: List usage limits
+ tags:
+ - Governance Console
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
+ x-unstable: |-
+ **Note**: This endpoint is in preview and is subject to change.
+ If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
+ /api/v2/governance/notification_settings:
+ get:
+ description: |-
+ Retrieve the organization-wide governance notification settings, including whether users are
+ notified when detections are assigned to them.
+ operationId: GetGovernanceNotificationSettings
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ assignment_notifications_enabled: true
+ id: "11111111-2222-3333-4444-555555555555"
+ type: "governance_notification_settings"
+ schema:
+ $ref: "#/components/schemas/GovernanceNotificationSettingsResponse"
+ description: OK
+ "400":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
- description: Not Found
+ description: Bad Request
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unauthorized
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- summary: Get a governance control
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: Get notification settings
tags:
- - Governance Controls
+ - Governance Console
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
patch:
description: |-
- Update the detection, notification, and mitigation configuration of a governance control. Only
- the attributes present in the request are modified. Changing the mitigation type or its
- parameters may require additional permissions.
- operationId: UpdateGovernanceControl
- parameters:
- - description: The detection type that identifies the control, for example `unused_api_keys`.
- example: "unused_api_keys"
- in: path
- name: detection_type
- required: true
- schema:
- type: string
+ Update the organization-wide governance notification settings. Only the attributes present in
+ the request are modified.
+ operationId: UpdateGovernanceNotificationSettings
requestBody:
content:
application/json:
@@ -143737,12 +145154,10 @@ paths:
value:
data:
attributes:
- detection_parameters:
- api_key_threshold: 60
- mitigation_type: "revoke_api_key"
- type: "governance_control"
+ assignment_notifications_enabled: true
+ type: "governance_notification_settings"
schema:
- $ref: "#/components/schemas/GovernanceControlUpdateRequest"
+ $ref: "#/components/schemas/GovernanceNotificationSettingsUpdateRequest"
required: true
responses:
"200":
@@ -143753,41 +145168,11 @@ paths:
value:
data:
attributes:
- active_detections_count: 12
- category: "security"
- created_at: "2024-01-15T09:30:00Z"
- created_by: "11111111-2222-3333-4444-555555555555"
- description: "Identifies API keys that have not been used within your specified time threshold, helping reduce security risks from dormant credentials."
- detection_frequency: "daily"
- detection_parameters:
- api_key_threshold: 60
- detection_type: "unused_api_keys"
- feature_flags: []
- insights: []
- last_detection_at: "2024-03-01T12:00:00Z"
- mitigated_detections_count: 3
- mitigation_parameters: {}
- mitigation_type: "revoke_api_key"
- mitigations: []
- name: "Unused API Keys"
- next_steps: "Review and revoke API keys that are no longer in use to maintain a secure authentication posture."
- notification_frequency: ""
- notification_parameters: {}
- notification_type: ""
- priority: "High"
- product: "api_keys"
- release_status: "prod"
- resource_type: "api_key"
- resource_type_display_name: "API Key"
- supported_detection_parameters: []
- supported_notification_parameters: []
- task: "Review and revoke unused API keys."
- type: "Proactive"
- usage_concern: "Security"
- id: "0d4e6f8a-1b2c-3d4e-5f6a-7b8c9d0e1f2a"
- type: "governance_control"
+ assignment_notifications_enabled: true
+ id: "11111111-2222-3333-4444-555555555555"
+ type: "governance_notification_settings"
schema:
- $ref: "#/components/schemas/GovernanceControlResponse"
+ $ref: "#/components/schemas/GovernanceNotificationSettingsResponse"
description: OK
"400":
content:
@@ -143807,60 +145192,30 @@ paths:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Forbidden
- "404":
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/JSONAPIErrorResponse"
- description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- summary: Update a governance control
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: Update notification settings
tags:
- - Governance Controls
+ - Governance Console
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
+ - governance_console_write
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
- /api/v2/governance/insights:
+ /api/v2/governance/resource-limits:
get:
description: |-
- Retrieve the list of governance insights available to the organization. By default, only
- insight metadata is returned; pass `withValues=true` to also compute and include each
- insight's current and previous values. Insights can be filtered by product.
- operationId: ListGovernanceInsights
- parameters:
- - description: |-
- Whether to compute and include the current and previous value of each insight.
- Defaults to `false`, in which case only insight metadata is returned.
- example: true
- in: query
- name: withValues
- required: false
- schema:
- type: boolean
- - description: |-
- The UUID of the organization to compute insights for. Defaults to the organization of
- the authenticated user. Used to retrieve insights for a child organization from a
- parent organization.
- example: "11111111-2222-3333-4444-555555555555"
- in: query
- name: orgUuid
- required: false
- schema:
- type: string
- - description: |-
- Restrict the results to insights belonging to the given products. May be repeated to
- filter by multiple products. Matching is case-insensitive.
- example:
- - "Usage"
- - "Logs Settings"
- in: query
- name: filter[product]
- required: false
- schema:
- items:
- type: string
- type: array
+ Retrieve the list of resource limits tracked for the organization in the Governance Console.
+ Each resource limit reports its current value and configured limit, the queries used to
+ compute them, and its current usage status.
+ operationId: ListGovernanceResourceLimits
responses:
"200":
content:
@@ -143870,59 +145225,34 @@ paths:
value:
data:
- attributes:
- audit_query:
- best_practice:
- deep_link: ""
- description: ""
- display_name: "Active Dashboards"
- event_query:
- metric_query:
- old_value: 3274
- percentage_query:
- product: "Usage"
- state: ""
- sub_product: ""
- time_range: ""
- unit_name: "active dashboards"
- usage_query:
- value: 3601
- id: "498ee21f-8037-48b8-a961-a488692902f4"
- type: "insight"
- - attributes:
- audit_query:
- best_practice:
- category: "access_governance"
- deep_link: "/organization-settings/users?status=inactive"
- description: "Review and deactivate users who have not logged in within the last 90 days."
- detection_type:
- id: "bp_monitor_inactive_users"
- impact: "Reduces unauthorized access risk."
- impact_hint: 1
- permissions:
- - "user_access_manage"
- status: "active"
- summary: "Inactive users with access increase your security surface area."
- title: "Monitor inactive users"
- trigger_condition: "active_users"
- trigger_type: "insight"
- deep_link: ""
- description: "Number of users who have used the Dashboard in the last 30 days"
- display_name: "Active Users"
- event_query:
- metric_query:
- old_value: 1173
- percentage_query:
- product: "Usage"
- state: ""
- sub_product: ""
+ current_limit: 10000
+ current_value: 8200
+ default_current_value: 0
+ default_limit_value: 0
+ description: "The number of custom metrics in use against your contracted limit."
+ display_name: "Custom Metrics"
+ limit_query:
+ query: "sum:datadog.contract.metrics.custom{*}"
+ reducer: "max"
+ source: "metrics"
+ product: "metrics"
+ query:
+ query: "sum:datadog.estimated_usage.metrics.custom{*}"
+ reducer: "sum"
+ source: "metrics"
+ query_config:
+ chart_type: "line"
+ comparison_shift: "month"
+ default_value: 0
+ directionality: "decrease_better"
+ effective_time_window_days: 30
time_range: "month"
- unit_name: "active users"
- usage_query:
- value: 1291
- id: "a3248d1b-5578-4345-a34e-fe9657300f22"
- type: "insight"
+ unit_name: "metrics"
+ usage_status: "approaching"
+ id: "custom_metrics"
+ type: "resource-limit"
schema:
- $ref: "#/components/schemas/GovernanceInsightsResponse"
+ $ref: "#/components/schemas/GovernanceResourceLimitsResponse"
description: OK
"400":
content:
@@ -143944,9 +145274,17 @@ paths:
description: Forbidden
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
- summary: List governance insights
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ: []
+ summary: List resource limits
tags:
- - Governance Insights
+ - Governance Console
+ "x-permission":
+ operator: AND
+ permissions:
+ - governance_console_read
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
@@ -203606,9 +204944,17 @@ paths:
description: Forbidden
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
summary: List tag policies
tags:
- Tag Policies
+ "x-permission":
+ operator: OR
+ permissions:
+ - telemetry_rules_read
+ - metrics_read
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
@@ -203697,9 +205043,16 @@ paths:
description: Conflict
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
summary: Create a tag policy
tags:
- Tag Policies
+ "x-permission":
+ operator: AND
+ permissions:
+ - telemetry_rules_create
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
@@ -203754,9 +205107,16 @@ paths:
description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
summary: Delete a tag policy
tags:
- Tag Policies
+ "x-permission":
+ operator: AND
+ permissions:
+ - telemetry_rules_create
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
@@ -203866,9 +205226,17 @@ paths:
description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
summary: Get a tag policy
tags:
- Tag Policies
+ "x-permission":
+ operator: OR
+ permissions:
+ - telemetry_rules_read
+ - metrics_read
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
@@ -203957,9 +205325,16 @@ paths:
description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
summary: Update a tag policy
tags:
- Tag Policies
+ "x-permission":
+ operator: AND
+ permissions:
+ - telemetry_rules_create
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
@@ -204039,9 +205414,17 @@ paths:
description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
summary: Get a tag policy compliance score
tags:
- Tag Policies
+ "x-permission":
+ operator: OR
+ permissions:
+ - telemetry_rules_read
+ - metrics_read
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
@@ -210140,17 +211523,20 @@ tags:
url: https://docs.datadoghq.com/integrations/google-hangouts-chat/
name: Google Chat Integration
- description: |-
- 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.
- name: Governance Controls
- - description: |-
- Governance Insights surface key usage, configuration, and best-practice signals for an
- organization within the Governance Console. Each insight reports a current value (and,
- optionally, a previous value for comparison) along with the query used to compute it, so
- that the Console can render trends and highlight areas that need attention.
- name: Governance Insights
+ The Governance Console finds issues that build up across a Datadog organization over time,
+ such as API keys nobody uses, users who no longer need access, or custom metrics that are
+ never queried, and tracks them through to a fix.
+
+ These endpoints allow you to:
+
+ - Read insights: measures of how your organization uses Datadog, each with the query behind it.
+ - Configure controls: the rules deciding how one kind of issue is found and what is done about it.
+ - Act on detections: the issues a control found. Assign, defer, accept as an exception, or fix.
+ - Manage settings: organization-wide configuration, usage and resource limits, and notifications.
+
+ See the [Governance Console page](https://docs.datadoghq.com/account_management/governance_console/)
+ for more information.
+ name: Governance Console
- description: |-
Configure High Availability Multi-Region (HAMR) connections between Datadog organizations.
HAMR provides disaster recovery capabilities by maintaining synchronized data between primary
diff --git a/examples/v2/governance-console/GetGovernanceConfig.java b/examples/v2/governance-console/GetGovernanceConfig.java
new file mode 100644
index 00000000000..5aa0840ffa1
--- /dev/null
+++ b/examples/v2/governance-console/GetGovernanceConfig.java
@@ -0,0 +1,25 @@
+// Get the Governance Console configuration returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.GovernanceConsoleApi;
+import com.datadog.api.client.v2.model.GovernanceConfigResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.getGovernanceConfig", true);
+ GovernanceConsoleApi apiInstance = new GovernanceConsoleApi(defaultClient);
+
+ try {
+ GovernanceConfigResponse result = apiInstance.getGovernanceConfig();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling GovernanceConsoleApi#getGovernanceConfig");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/governance-controls/GetGovernanceControl.java b/examples/v2/governance-console/GetGovernanceControl.java
similarity index 72%
rename from examples/v2/governance-controls/GetGovernanceControl.java
rename to examples/v2/governance-console/GetGovernanceControl.java
index fbed4ad7fe5..824b7813df6 100644
--- a/examples/v2/governance-controls/GetGovernanceControl.java
+++ b/examples/v2/governance-console/GetGovernanceControl.java
@@ -1,21 +1,21 @@
-// Get a governance control returns "OK" response
+// Get a control returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
-import com.datadog.api.client.v2.api.GovernanceControlsApi;
+import com.datadog.api.client.v2.api.GovernanceConsoleApi;
import com.datadog.api.client.v2.model.GovernanceControlResponse;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.getGovernanceControl", true);
- GovernanceControlsApi apiInstance = new GovernanceControlsApi(defaultClient);
+ GovernanceConsoleApi apiInstance = new GovernanceConsoleApi(defaultClient);
try {
GovernanceControlResponse result = apiInstance.getGovernanceControl("unused_api_keys");
System.out.println(result);
} catch (ApiException e) {
- System.err.println("Exception when calling GovernanceControlsApi#getGovernanceControl");
+ System.err.println("Exception when calling GovernanceConsoleApi#getGovernanceControl");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
diff --git a/examples/v2/governance-console/GetGovernanceControlNotificationSettings.java b/examples/v2/governance-console/GetGovernanceControlNotificationSettings.java
new file mode 100644
index 00000000000..8a7c1ddcb86
--- /dev/null
+++ b/examples/v2/governance-console/GetGovernanceControlNotificationSettings.java
@@ -0,0 +1,27 @@
+// Get control notification settings returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.GovernanceConsoleApi;
+import com.datadog.api.client.v2.model.ControlNotificationSettingsResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.getGovernanceControlNotificationSettings", true);
+ GovernanceConsoleApi apiInstance = new GovernanceConsoleApi(defaultClient);
+
+ try {
+ ControlNotificationSettingsResponse result =
+ apiInstance.getGovernanceControlNotificationSettings("unused_api_keys");
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling GovernanceConsoleApi#getGovernanceControlNotificationSettings");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/governance-console/GetGovernanceDetection.java b/examples/v2/governance-console/GetGovernanceDetection.java
new file mode 100644
index 00000000000..d44458b5e4f
--- /dev/null
+++ b/examples/v2/governance-console/GetGovernanceDetection.java
@@ -0,0 +1,26 @@
+// Get a detection returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.GovernanceConsoleApi;
+import com.datadog.api.client.v2.model.GovernanceControlDetectionResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.getGovernanceDetection", true);
+ GovernanceConsoleApi apiInstance = new GovernanceConsoleApi(defaultClient);
+
+ try {
+ GovernanceControlDetectionResponse result =
+ apiInstance.getGovernanceDetection("3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d");
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling GovernanceConsoleApi#getGovernanceDetection");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/governance-console/GetGovernanceNotificationSettings.java b/examples/v2/governance-console/GetGovernanceNotificationSettings.java
new file mode 100644
index 00000000000..66233b0d4f6
--- /dev/null
+++ b/examples/v2/governance-console/GetGovernanceNotificationSettings.java
@@ -0,0 +1,27 @@
+// Get notification settings returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.GovernanceConsoleApi;
+import com.datadog.api.client.v2.model.GovernanceNotificationSettingsResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.getGovernanceNotificationSettings", true);
+ GovernanceConsoleApi apiInstance = new GovernanceConsoleApi(defaultClient);
+
+ try {
+ GovernanceNotificationSettingsResponse result =
+ apiInstance.getGovernanceNotificationSettings();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling GovernanceConsoleApi#getGovernanceNotificationSettings");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/governance-console/ListGovernanceControlDetections.java b/examples/v2/governance-console/ListGovernanceControlDetections.java
new file mode 100644
index 00000000000..772fadbf966
--- /dev/null
+++ b/examples/v2/governance-console/ListGovernanceControlDetections.java
@@ -0,0 +1,27 @@
+// List control detections returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.GovernanceConsoleApi;
+import com.datadog.api.client.v2.model.GovernanceControlDetectionsResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.listGovernanceControlDetections", true);
+ GovernanceConsoleApi apiInstance = new GovernanceConsoleApi(defaultClient);
+
+ try {
+ GovernanceControlDetectionsResponse result =
+ apiInstance.listGovernanceControlDetections("unused_api_keys");
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling GovernanceConsoleApi#listGovernanceControlDetections");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/governance-controls/ListGovernanceControls.java b/examples/v2/governance-console/ListGovernanceControls.java
similarity index 72%
rename from examples/v2/governance-controls/ListGovernanceControls.java
rename to examples/v2/governance-console/ListGovernanceControls.java
index e966ca3520f..4940d4d3ca8 100644
--- a/examples/v2/governance-controls/ListGovernanceControls.java
+++ b/examples/v2/governance-console/ListGovernanceControls.java
@@ -1,21 +1,21 @@
-// List governance controls returns "OK" response
+// List controls returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
-import com.datadog.api.client.v2.api.GovernanceControlsApi;
+import com.datadog.api.client.v2.api.GovernanceConsoleApi;
import com.datadog.api.client.v2.model.GovernanceControlsResponse;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.listGovernanceControls", true);
- GovernanceControlsApi apiInstance = new GovernanceControlsApi(defaultClient);
+ GovernanceConsoleApi apiInstance = new GovernanceConsoleApi(defaultClient);
try {
GovernanceControlsResponse result = apiInstance.listGovernanceControls();
System.out.println(result);
} catch (ApiException e) {
- System.err.println("Exception when calling GovernanceControlsApi#listGovernanceControls");
+ System.err.println("Exception when calling GovernanceConsoleApi#listGovernanceControls");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
diff --git a/examples/v2/governance-insights/ListGovernanceInsights.java b/examples/v2/governance-console/ListGovernanceInsights.java
similarity index 72%
rename from examples/v2/governance-insights/ListGovernanceInsights.java
rename to examples/v2/governance-console/ListGovernanceInsights.java
index 3ec8610de6a..3daf2ef65e1 100644
--- a/examples/v2/governance-insights/ListGovernanceInsights.java
+++ b/examples/v2/governance-console/ListGovernanceInsights.java
@@ -1,21 +1,21 @@
-// List governance insights returns "OK" response
+// List insights returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
-import com.datadog.api.client.v2.api.GovernanceInsightsApi;
+import com.datadog.api.client.v2.api.GovernanceConsoleApi;
import com.datadog.api.client.v2.model.GovernanceInsightsResponse;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.listGovernanceInsights", true);
- GovernanceInsightsApi apiInstance = new GovernanceInsightsApi(defaultClient);
+ GovernanceConsoleApi apiInstance = new GovernanceConsoleApi(defaultClient);
try {
GovernanceInsightsResponse result = apiInstance.listGovernanceInsights();
System.out.println(result);
} catch (ApiException e) {
- System.err.println("Exception when calling GovernanceInsightsApi#listGovernanceInsights");
+ System.err.println("Exception when calling GovernanceConsoleApi#listGovernanceInsights");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
diff --git a/examples/v2/governance-console/ListGovernanceLimits.java b/examples/v2/governance-console/ListGovernanceLimits.java
new file mode 100644
index 00000000000..f9385fb966b
--- /dev/null
+++ b/examples/v2/governance-console/ListGovernanceLimits.java
@@ -0,0 +1,25 @@
+// List usage limits returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.GovernanceConsoleApi;
+import com.datadog.api.client.v2.model.GovernanceLimitsResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.listGovernanceLimits", true);
+ GovernanceConsoleApi apiInstance = new GovernanceConsoleApi(defaultClient);
+
+ try {
+ GovernanceLimitsResponse result = apiInstance.listGovernanceLimits();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling GovernanceConsoleApi#listGovernanceLimits");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/governance-console/ListGovernanceResourceLimits.java b/examples/v2/governance-console/ListGovernanceResourceLimits.java
new file mode 100644
index 00000000000..32e7e50ff06
--- /dev/null
+++ b/examples/v2/governance-console/ListGovernanceResourceLimits.java
@@ -0,0 +1,26 @@
+// List resource limits returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.GovernanceConsoleApi;
+import com.datadog.api.client.v2.model.GovernanceResourceLimitsResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.listGovernanceResourceLimits", true);
+ GovernanceConsoleApi apiInstance = new GovernanceConsoleApi(defaultClient);
+
+ try {
+ GovernanceResourceLimitsResponse result = apiInstance.listGovernanceResourceLimits();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling GovernanceConsoleApi#listGovernanceResourceLimits");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/governance-console/MitigateGovernanceDetections.java b/examples/v2/governance-console/MitigateGovernanceDetections.java
new file mode 100644
index 00000000000..38e2105492f
--- /dev/null
+++ b/examples/v2/governance-console/MitigateGovernanceDetections.java
@@ -0,0 +1,41 @@
+// Mitigate detections returns "Accepted" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.GovernanceConsoleApi;
+import com.datadog.api.client.v2.model.GovernanceControlDetectionResourceType;
+import com.datadog.api.client.v2.model.GovernanceMitigationRequest;
+import com.datadog.api.client.v2.model.GovernanceMitigationRequestAttributes;
+import com.datadog.api.client.v2.model.GovernanceMitigationRequestData;
+import java.util.Collections;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.mitigateGovernanceDetections", true);
+ GovernanceConsoleApi apiInstance = new GovernanceConsoleApi(defaultClient);
+
+ GovernanceMitigationRequest body =
+ new GovernanceMitigationRequest()
+ .data(
+ new GovernanceMitigationRequestData()
+ .attributes(
+ new GovernanceMitigationRequestAttributes()
+ .detectionIds(
+ Collections.singletonList("3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d"))
+ .detectionType("unused_api_keys")
+ .mitigationType("revoke_api_key"))
+ .type(GovernanceControlDetectionResourceType.GOVERNANCE_CONTROL_DETECTION));
+
+ try {
+ apiInstance.mitigateGovernanceDetections(body);
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling GovernanceConsoleApi#mitigateGovernanceDetections");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/governance-controls/UpdateGovernanceControl.java b/examples/v2/governance-console/UpdateGovernanceControl.java
similarity index 71%
rename from examples/v2/governance-controls/UpdateGovernanceControl.java
rename to examples/v2/governance-console/UpdateGovernanceControl.java
index 42aefaaa80f..e40c742efe9 100644
--- a/examples/v2/governance-controls/UpdateGovernanceControl.java
+++ b/examples/v2/governance-console/UpdateGovernanceControl.java
@@ -1,8 +1,8 @@
-// Update a governance control returns "OK" response
+// Update a control returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
-import com.datadog.api.client.v2.api.GovernanceControlsApi;
+import com.datadog.api.client.v2.api.GovernanceConsoleApi;
import com.datadog.api.client.v2.model.GovernanceControlResourceType;
import com.datadog.api.client.v2.model.GovernanceControlResponse;
import com.datadog.api.client.v2.model.GovernanceControlUpdateAttributes;
@@ -13,7 +13,7 @@ public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.updateGovernanceControl", true);
- GovernanceControlsApi apiInstance = new GovernanceControlsApi(defaultClient);
+ GovernanceConsoleApi apiInstance = new GovernanceConsoleApi(defaultClient);
GovernanceControlUpdateRequest body =
new GovernanceControlUpdateRequest()
@@ -22,11 +22,7 @@ public static void main(String[] args) {
.attributes(
new GovernanceControlUpdateAttributes()
.detectionFrequency("daily")
- .mitigationType("revoke_api_key")
- .name("Unused API Keys")
- .notificationFrequency("daily")
- .notificationType("slack"))
- .id("0d4e6f8a-1b2c-3d4e-5f6a-7b8c9d0e1f2a")
+ .mitigationType("revoke_api_key"))
.type(GovernanceControlResourceType.GOVERNANCE_CONTROL));
try {
@@ -34,7 +30,7 @@ public static void main(String[] args) {
apiInstance.updateGovernanceControl("unused_api_keys", body);
System.out.println(result);
} catch (ApiException e) {
- System.err.println("Exception when calling GovernanceControlsApi#updateGovernanceControl");
+ System.err.println("Exception when calling GovernanceConsoleApi#updateGovernanceControl");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
diff --git a/examples/v2/governance-console/UpdateGovernanceControlNotificationSettings.java b/examples/v2/governance-console/UpdateGovernanceControlNotificationSettings.java
new file mode 100644
index 00000000000..4a9c26b774b
--- /dev/null
+++ b/examples/v2/governance-console/UpdateGovernanceControlNotificationSettings.java
@@ -0,0 +1,55 @@
+// Update control notification settings returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.GovernanceConsoleApi;
+import com.datadog.api.client.v2.model.ControlNotificationEventSetting;
+import com.datadog.api.client.v2.model.ControlNotificationSettingsResourceType;
+import com.datadog.api.client.v2.model.ControlNotificationSettingsResponse;
+import com.datadog.api.client.v2.model.ControlNotificationSettingsUpdateAttributes;
+import com.datadog.api.client.v2.model.ControlNotificationSettingsUpdateData;
+import com.datadog.api.client.v2.model.ControlNotificationSettingsUpdateRequest;
+import com.datadog.api.client.v2.model.ControlNotificationTarget;
+import com.datadog.api.client.v2.model.ControlNotificationTargetType;
+import java.util.Collections;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled(
+ "v2.updateGovernanceControlNotificationSettings", true);
+ GovernanceConsoleApi apiInstance = new GovernanceConsoleApi(defaultClient);
+
+ ControlNotificationSettingsUpdateRequest body =
+ new ControlNotificationSettingsUpdateRequest()
+ .data(
+ new ControlNotificationSettingsUpdateData()
+ .attributes(
+ new ControlNotificationSettingsUpdateAttributes()
+ .eventSettings(
+ Collections.singletonList(
+ new ControlNotificationEventSetting()
+ .enabled(true)
+ .eventType("new_detection")
+ .targets(
+ Collections.singletonList(
+ new ControlNotificationTarget()
+ .handle("#governance-alerts")
+ .type(ControlNotificationTargetType.SLACK))))))
+ .type(ControlNotificationSettingsResourceType.CONTROL_NOTIFICATION_SETTINGS));
+
+ try {
+ ControlNotificationSettingsResponse result =
+ apiInstance.updateGovernanceControlNotificationSettings("unused_api_keys", body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling"
+ + " GovernanceConsoleApi#updateGovernanceControlNotificationSettings");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/governance-console/UpdateGovernanceDetection.java b/examples/v2/governance-console/UpdateGovernanceDetection.java
new file mode 100644
index 00000000000..caac66d2988
--- /dev/null
+++ b/examples/v2/governance-console/UpdateGovernanceDetection.java
@@ -0,0 +1,44 @@
+// Update a detection returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.GovernanceConsoleApi;
+import com.datadog.api.client.v2.model.GovernanceControlDetectionResourceType;
+import com.datadog.api.client.v2.model.GovernanceControlDetectionResponse;
+import com.datadog.api.client.v2.model.GovernanceControlDetectionUpdateAttributes;
+import com.datadog.api.client.v2.model.GovernanceControlDetectionUpdateData;
+import com.datadog.api.client.v2.model.GovernanceControlDetectionUpdateRequest;
+import com.datadog.api.client.v2.model.GovernanceControlDetectionUpdateState;
+import java.time.OffsetDateTime;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.updateGovernanceDetection", true);
+ GovernanceConsoleApi apiInstance = new GovernanceConsoleApi(defaultClient);
+
+ GovernanceControlDetectionUpdateRequest body =
+ new GovernanceControlDetectionUpdateRequest()
+ .data(
+ new GovernanceControlDetectionUpdateData()
+ .attributes(
+ new GovernanceControlDetectionUpdateAttributes()
+ .assignedTeam("platform-security")
+ .assignedTo("11111111-2222-3333-4444-555555555555")
+ .mitigateAfter(OffsetDateTime.parse("2024-03-15T00:00:00Z"))
+ .state(GovernanceControlDetectionUpdateState.EXCEPTION))
+ .type(GovernanceControlDetectionResourceType.GOVERNANCE_CONTROL_DETECTION));
+
+ try {
+ GovernanceControlDetectionResponse result =
+ apiInstance.updateGovernanceDetection("3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d", body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling GovernanceConsoleApi#updateGovernanceDetection");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/governance-console/UpdateGovernanceNotificationSettings.java b/examples/v2/governance-console/UpdateGovernanceNotificationSettings.java
new file mode 100644
index 00000000000..91eebe0b9b5
--- /dev/null
+++ b/examples/v2/governance-console/UpdateGovernanceNotificationSettings.java
@@ -0,0 +1,42 @@
+// Update notification settings returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.GovernanceConsoleApi;
+import com.datadog.api.client.v2.model.GovernanceNotificationSettingsResourceType;
+import com.datadog.api.client.v2.model.GovernanceNotificationSettingsResponse;
+import com.datadog.api.client.v2.model.GovernanceNotificationSettingsUpdateAttributes;
+import com.datadog.api.client.v2.model.GovernanceNotificationSettingsUpdateData;
+import com.datadog.api.client.v2.model.GovernanceNotificationSettingsUpdateRequest;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.updateGovernanceNotificationSettings", true);
+ GovernanceConsoleApi apiInstance = new GovernanceConsoleApi(defaultClient);
+
+ GovernanceNotificationSettingsUpdateRequest body =
+ new GovernanceNotificationSettingsUpdateRequest()
+ .data(
+ new GovernanceNotificationSettingsUpdateData()
+ .attributes(
+ new GovernanceNotificationSettingsUpdateAttributes()
+ .assignmentNotificationsEnabled(true))
+ .type(
+ GovernanceNotificationSettingsResourceType
+ .GOVERNANCE_NOTIFICATION_SETTINGS));
+
+ try {
+ GovernanceNotificationSettingsResponse result =
+ apiInstance.updateGovernanceNotificationSettings(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling GovernanceConsoleApi#updateGovernanceNotificationSettings");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java
index 97c93bba1d2..3ee7bb5b8f0 100644
--- a/src/main/java/com/datadog/api/client/ApiClient.java
+++ b/src/main/java/com/datadog/api/client/ApiClient.java
@@ -1030,10 +1030,21 @@ public class ApiClient {
put("v2.upsertAndPublishFormVersion", false);
put("v2.upsertFormVersion", false);
put("v2.updateOrgSamlConfigurations", false);
+ put("v2.getGovernanceConfig", false);
put("v2.getGovernanceControl", false);
+ put("v2.getGovernanceControlNotificationSettings", false);
+ put("v2.getGovernanceDetection", false);
+ put("v2.getGovernanceNotificationSettings", false);
+ put("v2.listGovernanceControlDetections", false);
put("v2.listGovernanceControls", false);
- put("v2.updateGovernanceControl", false);
put("v2.listGovernanceInsights", false);
+ put("v2.listGovernanceLimits", false);
+ put("v2.listGovernanceResourceLimits", false);
+ put("v2.mitigateGovernanceDetections", false);
+ put("v2.updateGovernanceControl", false);
+ put("v2.updateGovernanceControlNotificationSettings", false);
+ put("v2.updateGovernanceDetection", false);
+ put("v2.updateGovernanceNotificationSettings", false);
put("v2.createHamrOrgConnection", false);
put("v2.getHamrOrgConnection", false);
put("v2.deleteEntityIntegrationConfig", false);
diff --git a/src/main/java/com/datadog/api/client/v2/api/GovernanceConsoleApi.java b/src/main/java/com/datadog/api/client/v2/api/GovernanceConsoleApi.java
new file mode 100644
index 00000000000..ffb86f94908
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/api/GovernanceConsoleApi.java
@@ -0,0 +1,2607 @@
+package com.datadog.api.client.v2.api;
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.ApiResponse;
+import com.datadog.api.client.Pair;
+import com.datadog.api.client.v2.model.ControlNotificationSettingsResponse;
+import com.datadog.api.client.v2.model.ControlNotificationSettingsUpdateRequest;
+import com.datadog.api.client.v2.model.GovernanceConfigResponse;
+import com.datadog.api.client.v2.model.GovernanceControlDetectionResponse;
+import com.datadog.api.client.v2.model.GovernanceControlDetectionUpdateRequest;
+import com.datadog.api.client.v2.model.GovernanceControlDetectionsResponse;
+import com.datadog.api.client.v2.model.GovernanceControlResponse;
+import com.datadog.api.client.v2.model.GovernanceControlUpdateRequest;
+import com.datadog.api.client.v2.model.GovernanceControlsResponse;
+import com.datadog.api.client.v2.model.GovernanceInsightsResponse;
+import com.datadog.api.client.v2.model.GovernanceLimitsResponse;
+import com.datadog.api.client.v2.model.GovernanceMitigationRequest;
+import com.datadog.api.client.v2.model.GovernanceNotificationSettingsResponse;
+import com.datadog.api.client.v2.model.GovernanceNotificationSettingsUpdateRequest;
+import com.datadog.api.client.v2.model.GovernanceResourceLimitsResponse;
+import jakarta.ws.rs.client.Invocation;
+import jakarta.ws.rs.core.GenericType;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class GovernanceConsoleApi {
+ private ApiClient apiClient;
+
+ public GovernanceConsoleApi() {
+ this(ApiClient.getDefaultApiClient());
+ }
+
+ public GovernanceConsoleApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Get the API client.
+ *
+ * @return API client
+ */
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ /**
+ * Set the API client.
+ *
+ * @param apiClient an instance of API client
+ */
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Get the Governance Console configuration.
+ *
+ *
See {@link #getGovernanceConfigWithHttpInfo}.
+ *
+ * @return GovernanceConfigResponse
+ * @throws ApiException if fails to make API call
+ */
+ public GovernanceConfigResponse getGovernanceConfig() throws ApiException {
+ return getGovernanceConfigWithHttpInfo().getData();
+ }
+
+ /**
+ * Get the Governance Console configuration.
+ *
+ *
See {@link #getGovernanceConfigWithHttpInfoAsync}.
+ *
+ * @return CompletableFuture<GovernanceConfigResponse>
+ */
+ public CompletableFuture getGovernanceConfigAsync() {
+ return getGovernanceConfigWithHttpInfoAsync()
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Retrieve the Governance Console configuration for the organization, including whether the
+ * Console is enabled, whether assignment notifications are enabled, and whether usage attribution
+ * is configured.
+ *
+ * @return ApiResponse<GovernanceConfigResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 401 | Unauthorized | - |
+ * | 403 | Forbidden | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse getGovernanceConfigWithHttpInfo()
+ throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "getGovernanceConfig";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+ // create path and map variables
+ String localVarPath = "/api/v2/governance/config";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.getGovernanceConfig",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Get the Governance Console configuration.
+ *
+ * See {@link #getGovernanceConfigWithHttpInfo}.
+ *
+ * @return CompletableFuture<ApiResponse<GovernanceConfigResponse>>
+ */
+ public CompletableFuture>
+ getGovernanceConfigWithHttpInfoAsync() {
+ // Check if unstable operation is enabled
+ String operationId = "getGovernanceConfig";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+ // create path and map variables
+ String localVarPath = "/api/v2/governance/config";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.getGovernanceConfig",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Get a control.
+ *
+ * See {@link #getGovernanceControlWithHttpInfo}.
+ *
+ * @param detectionType The detection type that identifies the control, for example
+ * unused_api_keys. (required)
+ * @return GovernanceControlResponse
+ * @throws ApiException if fails to make API call
+ */
+ public GovernanceControlResponse getGovernanceControl(String detectionType) throws ApiException {
+ return getGovernanceControlWithHttpInfo(detectionType).getData();
+ }
+
+ /**
+ * Get a control.
+ *
+ *
See {@link #getGovernanceControlWithHttpInfoAsync}.
+ *
+ * @param detectionType The detection type that identifies the control, for example
+ * unused_api_keys. (required)
+ * @return CompletableFuture<GovernanceControlResponse>
+ */
+ public CompletableFuture getGovernanceControlAsync(
+ String detectionType) {
+ return getGovernanceControlWithHttpInfoAsync(detectionType)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Retrieve a single governance control by its detection type, including the organization's
+ * current detection, notification, and mitigation configuration and detection counts.
+ *
+ * @param detectionType The detection type that identifies the control, for example
+ * unused_api_keys. (required)
+ * @return ApiResponse<GovernanceControlResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 401 | Unauthorized | - |
+ * | 403 | Forbidden | - |
+ * | 404 | Not Found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse getGovernanceControlWithHttpInfo(
+ String detectionType) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "getGovernanceControl";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'detectionType' is set
+ if (detectionType == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'detectionType' when calling getGovernanceControl");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/governance/control/{detection_type}"
+ .replaceAll(
+ "\\{" + "detection_type" + "\\}", apiClient.escapeString(detectionType.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.getGovernanceControl",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Get a control.
+ *
+ * See {@link #getGovernanceControlWithHttpInfo}.
+ *
+ * @param detectionType The detection type that identifies the control, for example
+ * unused_api_keys. (required)
+ * @return CompletableFuture<ApiResponse<GovernanceControlResponse>>
+ */
+ public CompletableFuture>
+ getGovernanceControlWithHttpInfoAsync(String detectionType) {
+ // Check if unstable operation is enabled
+ String operationId = "getGovernanceControl";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'detectionType' is set
+ if (detectionType == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'detectionType' when calling getGovernanceControl"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/governance/control/{detection_type}"
+ .replaceAll(
+ "\\{" + "detection_type" + "\\}", apiClient.escapeString(detectionType.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.getGovernanceControl",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Get control notification settings.
+ *
+ * See {@link #getGovernanceControlNotificationSettingsWithHttpInfo}.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @return ControlNotificationSettingsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public ControlNotificationSettingsResponse getGovernanceControlNotificationSettings(
+ String detectionType) throws ApiException {
+ return getGovernanceControlNotificationSettingsWithHttpInfo(detectionType).getData();
+ }
+
+ /**
+ * Get control notification settings.
+ *
+ *
See {@link #getGovernanceControlNotificationSettingsWithHttpInfoAsync}.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @return CompletableFuture<ControlNotificationSettingsResponse>
+ */
+ public CompletableFuture
+ getGovernanceControlNotificationSettingsAsync(String detectionType) {
+ return getGovernanceControlNotificationSettingsWithHttpInfoAsync(detectionType)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Retrieve the notification settings for the governance control with the given detection type,
+ * including, for each supported event type, whether notifications are enabled and which
+ * destinations receive them.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @return ApiResponse<ControlNotificationSettingsResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 401 | Unauthorized | - |
+ * | 403 | Forbidden | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse
+ getGovernanceControlNotificationSettingsWithHttpInfo(String detectionType)
+ throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "getGovernanceControlNotificationSettings";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'detectionType' is set
+ if (detectionType == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'detectionType' when calling"
+ + " getGovernanceControlNotificationSettings");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/governance/control/{detection_type}/notification_settings"
+ .replaceAll(
+ "\\{" + "detection_type" + "\\}", apiClient.escapeString(detectionType.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.getGovernanceControlNotificationSettings",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Get control notification settings.
+ *
+ * See {@link #getGovernanceControlNotificationSettingsWithHttpInfo}.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @return CompletableFuture<ApiResponse<ControlNotificationSettingsResponse>>
+ */
+ public CompletableFuture>
+ getGovernanceControlNotificationSettingsWithHttpInfoAsync(String detectionType) {
+ // Check if unstable operation is enabled
+ String operationId = "getGovernanceControlNotificationSettings";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'detectionType' is set
+ if (detectionType == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'detectionType' when calling"
+ + " getGovernanceControlNotificationSettings"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/governance/control/{detection_type}/notification_settings"
+ .replaceAll(
+ "\\{" + "detection_type" + "\\}", apiClient.escapeString(detectionType.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.getGovernanceControlNotificationSettings",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Get a detection.
+ *
+ * See {@link #getGovernanceDetectionWithHttpInfo}.
+ *
+ * @param detectionId The unique identifier of the detection. (required)
+ * @return GovernanceControlDetectionResponse
+ * @throws ApiException if fails to make API call
+ */
+ public GovernanceControlDetectionResponse getGovernanceDetection(String detectionId)
+ throws ApiException {
+ return getGovernanceDetectionWithHttpInfo(detectionId).getData();
+ }
+
+ /**
+ * Get a detection.
+ *
+ *
See {@link #getGovernanceDetectionWithHttpInfoAsync}.
+ *
+ * @param detectionId The unique identifier of the detection. (required)
+ * @return CompletableFuture<GovernanceControlDetectionResponse>
+ */
+ public CompletableFuture getGovernanceDetectionAsync(
+ String detectionId) {
+ return getGovernanceDetectionWithHttpInfoAsync(detectionId)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Retrieve a single governance detection by its unique identifier.
+ *
+ * @param detectionId The unique identifier of the detection. (required)
+ * @return ApiResponse<GovernanceControlDetectionResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 401 | Unauthorized | - |
+ * | 403 | Forbidden | - |
+ * | 404 | Not Found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse getGovernanceDetectionWithHttpInfo(
+ String detectionId) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "getGovernanceDetection";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'detectionId' is set
+ if (detectionId == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'detectionId' when calling getGovernanceDetection");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/governance/detections/{detection_id}"
+ .replaceAll(
+ "\\{" + "detection_id" + "\\}", apiClient.escapeString(detectionId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.getGovernanceDetection",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Get a detection.
+ *
+ * See {@link #getGovernanceDetectionWithHttpInfo}.
+ *
+ * @param detectionId The unique identifier of the detection. (required)
+ * @return CompletableFuture<ApiResponse<GovernanceControlDetectionResponse>>
+ */
+ public CompletableFuture>
+ getGovernanceDetectionWithHttpInfoAsync(String detectionId) {
+ // Check if unstable operation is enabled
+ String operationId = "getGovernanceDetection";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'detectionId' is set
+ if (detectionId == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'detectionId' when calling getGovernanceDetection"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/governance/detections/{detection_id}"
+ .replaceAll(
+ "\\{" + "detection_id" + "\\}", apiClient.escapeString(detectionId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.getGovernanceDetection",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Get notification settings.
+ *
+ * See {@link #getGovernanceNotificationSettingsWithHttpInfo}.
+ *
+ * @return GovernanceNotificationSettingsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public GovernanceNotificationSettingsResponse getGovernanceNotificationSettings()
+ throws ApiException {
+ return getGovernanceNotificationSettingsWithHttpInfo().getData();
+ }
+
+ /**
+ * Get notification settings.
+ *
+ *
See {@link #getGovernanceNotificationSettingsWithHttpInfoAsync}.
+ *
+ * @return CompletableFuture<GovernanceNotificationSettingsResponse>
+ */
+ public CompletableFuture
+ getGovernanceNotificationSettingsAsync() {
+ return getGovernanceNotificationSettingsWithHttpInfoAsync()
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Retrieve the organization-wide governance notification settings, including whether users are
+ * notified when detections are assigned to them.
+ *
+ * @return ApiResponse<GovernanceNotificationSettingsResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 401 | Unauthorized | - |
+ * | 403 | Forbidden | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse
+ getGovernanceNotificationSettingsWithHttpInfo() throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "getGovernanceNotificationSettings";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+ // create path and map variables
+ String localVarPath = "/api/v2/governance/notification_settings";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.getGovernanceNotificationSettings",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Get notification settings.
+ *
+ * See {@link #getGovernanceNotificationSettingsWithHttpInfo}.
+ *
+ * @return CompletableFuture<ApiResponse<GovernanceNotificationSettingsResponse>>
+ */
+ public CompletableFuture>
+ getGovernanceNotificationSettingsWithHttpInfoAsync() {
+ // Check if unstable operation is enabled
+ String operationId = "getGovernanceNotificationSettings";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+ // create path and map variables
+ String localVarPath = "/api/v2/governance/notification_settings";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.getGovernanceNotificationSettings",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /** Manage optional parameters to listGovernanceControlDetections. */
+ public static class ListGovernanceControlDetectionsOptionalParameters {
+ private String filterState;
+ private String filterQuery;
+ private String sort;
+ private Long pageNumber;
+ private Long pageSize;
+
+ /**
+ * Set filterState.
+ *
+ * @param filterState Restrict the results to detections in the given state. (optional)
+ * @return ListGovernanceControlDetectionsOptionalParameters
+ */
+ public ListGovernanceControlDetectionsOptionalParameters filterState(String filterState) {
+ this.filterState = filterState;
+ return this;
+ }
+
+ /**
+ * Set filterQuery.
+ *
+ * @param filterQuery Restrict the results to detections matching the given free-text query.
+ * (optional)
+ * @return ListGovernanceControlDetectionsOptionalParameters
+ */
+ public ListGovernanceControlDetectionsOptionalParameters filterQuery(String filterQuery) {
+ this.filterQuery = filterQuery;
+ return this;
+ }
+
+ /**
+ * Set sort.
+ *
+ * @param sort A comma-separated list of attributes to sort detections by. Prefix an attribute
+ * with - for descending order. The attributes available for sorting are
+ * id, created_at, assigned_to, detection_type
+ * , display_name, exception_at, mitigate_after,
+ * mitigated_at, priority, resource_id, and
+ * state. Defaults to created_at,-id. (optional)
+ * @return ListGovernanceControlDetectionsOptionalParameters
+ */
+ public ListGovernanceControlDetectionsOptionalParameters sort(String sort) {
+ this.sort = sort;
+ return this;
+ }
+
+ /**
+ * Set pageNumber.
+ *
+ * @param pageNumber The zero-based index of the page to return; the first page is 0. (optional,
+ * default to 0)
+ * @return ListGovernanceControlDetectionsOptionalParameters
+ */
+ public ListGovernanceControlDetectionsOptionalParameters pageNumber(Long pageNumber) {
+ this.pageNumber = pageNumber;
+ return this;
+ }
+
+ /**
+ * Set pageSize.
+ *
+ * @param pageSize The number of detections to return per page. (optional)
+ * @return ListGovernanceControlDetectionsOptionalParameters
+ */
+ public ListGovernanceControlDetectionsOptionalParameters pageSize(Long pageSize) {
+ this.pageSize = pageSize;
+ return this;
+ }
+ }
+
+ /**
+ * List control detections.
+ *
+ * See {@link #listGovernanceControlDetectionsWithHttpInfo}.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @return GovernanceControlDetectionsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public GovernanceControlDetectionsResponse listGovernanceControlDetections(String detectionType)
+ throws ApiException {
+ return listGovernanceControlDetectionsWithHttpInfo(
+ detectionType, new ListGovernanceControlDetectionsOptionalParameters())
+ .getData();
+ }
+
+ /**
+ * List control detections.
+ *
+ *
See {@link #listGovernanceControlDetectionsWithHttpInfoAsync}.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @return CompletableFuture<GovernanceControlDetectionsResponse>
+ */
+ public CompletableFuture
+ listGovernanceControlDetectionsAsync(String detectionType) {
+ return listGovernanceControlDetectionsWithHttpInfoAsync(
+ detectionType, new ListGovernanceControlDetectionsOptionalParameters())
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * List control detections.
+ *
+ * See {@link #listGovernanceControlDetectionsWithHttpInfo}.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @param parameters Optional parameters for the request.
+ * @return GovernanceControlDetectionsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public GovernanceControlDetectionsResponse listGovernanceControlDetections(
+ String detectionType, ListGovernanceControlDetectionsOptionalParameters parameters)
+ throws ApiException {
+ return listGovernanceControlDetectionsWithHttpInfo(detectionType, parameters).getData();
+ }
+
+ /**
+ * List control detections.
+ *
+ *
See {@link #listGovernanceControlDetectionsWithHttpInfoAsync}.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<GovernanceControlDetectionsResponse>
+ */
+ public CompletableFuture
+ listGovernanceControlDetectionsAsync(
+ String detectionType, ListGovernanceControlDetectionsOptionalParameters parameters) {
+ return listGovernanceControlDetectionsWithHttpInfoAsync(detectionType, parameters)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Retrieve the detections produced by the governance control with the given detection type.
+ * Results can be filtered by state and free-text query, sorted, and paginated.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @param parameters Optional parameters for the request.
+ * @return ApiResponse<GovernanceControlDetectionsResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 401 | Unauthorized | - |
+ * | 403 | Forbidden | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse
+ listGovernanceControlDetectionsWithHttpInfo(
+ String detectionType, ListGovernanceControlDetectionsOptionalParameters parameters)
+ throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "listGovernanceControlDetections";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'detectionType' is set
+ if (detectionType == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'detectionType' when calling"
+ + " listGovernanceControlDetections");
+ }
+ String filterState = parameters.filterState;
+ String filterQuery = parameters.filterQuery;
+ String sort = parameters.sort;
+ Long pageNumber = parameters.pageNumber;
+ Long pageSize = parameters.pageSize;
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/governance/control/{detection_type}/detections"
+ .replaceAll(
+ "\\{" + "detection_type" + "\\}", apiClient.escapeString(detectionType.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[state]", filterState));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize));
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.listGovernanceControlDetections",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * List control detections.
+ *
+ * See {@link #listGovernanceControlDetectionsWithHttpInfo}.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<ApiResponse<GovernanceControlDetectionsResponse>>
+ */
+ public CompletableFuture>
+ listGovernanceControlDetectionsWithHttpInfoAsync(
+ String detectionType, ListGovernanceControlDetectionsOptionalParameters parameters) {
+ // Check if unstable operation is enabled
+ String operationId = "listGovernanceControlDetections";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'detectionType' is set
+ if (detectionType == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'detectionType' when calling"
+ + " listGovernanceControlDetections"));
+ return result;
+ }
+ String filterState = parameters.filterState;
+ String filterQuery = parameters.filterQuery;
+ String sort = parameters.sort;
+ Long pageNumber = parameters.pageNumber;
+ Long pageSize = parameters.pageSize;
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/governance/control/{detection_type}/detections"
+ .replaceAll(
+ "\\{" + "detection_type" + "\\}", apiClient.escapeString(detectionType.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[state]", filterState));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize));
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.listGovernanceControlDetections",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * List controls.
+ *
+ * See {@link #listGovernanceControlsWithHttpInfo}.
+ *
+ * @return GovernanceControlsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public GovernanceControlsResponse listGovernanceControls() throws ApiException {
+ return listGovernanceControlsWithHttpInfo().getData();
+ }
+
+ /**
+ * List controls.
+ *
+ *
See {@link #listGovernanceControlsWithHttpInfoAsync}.
+ *
+ * @return CompletableFuture<GovernanceControlsResponse>
+ */
+ public CompletableFuture listGovernanceControlsAsync() {
+ return listGovernanceControlsWithHttpInfoAsync()
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Retrieve the list of governance controls configured for the organization. Each control pairs a
+ * detection definition with the organization's current detection, notification, and mitigation
+ * configuration, along with counts of active and mitigated detections.
+ *
+ * @return ApiResponse<GovernanceControlsResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 401 | Unauthorized | - |
+ * | 403 | Forbidden | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse listGovernanceControlsWithHttpInfo()
+ throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "listGovernanceControls";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+ // create path and map variables
+ String localVarPath = "/api/v2/governance/control";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.listGovernanceControls",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * List controls.
+ *
+ * See {@link #listGovernanceControlsWithHttpInfo}.
+ *
+ * @return CompletableFuture<ApiResponse<GovernanceControlsResponse>>
+ */
+ public CompletableFuture>
+ listGovernanceControlsWithHttpInfoAsync() {
+ // Check if unstable operation is enabled
+ String operationId = "listGovernanceControls";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+ // create path and map variables
+ String localVarPath = "/api/v2/governance/control";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.listGovernanceControls",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /** Manage optional parameters to listGovernanceInsights. */
+ public static class ListGovernanceInsightsOptionalParameters {
+ private List filterProduct;
+
+ /**
+ * Set filterProduct.
+ *
+ * @param filterProduct Restrict the results to insights belonging to the given products. May be
+ * repeated to filter by multiple products. Matching is case-insensitive. (optional)
+ * @return ListGovernanceInsightsOptionalParameters
+ */
+ public ListGovernanceInsightsOptionalParameters filterProduct(List filterProduct) {
+ this.filterProduct = filterProduct;
+ return this;
+ }
+ }
+
+ /**
+ * List insights.
+ *
+ * See {@link #listGovernanceInsightsWithHttpInfo}.
+ *
+ * @return GovernanceInsightsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public GovernanceInsightsResponse listGovernanceInsights() throws ApiException {
+ return listGovernanceInsightsWithHttpInfo(new ListGovernanceInsightsOptionalParameters())
+ .getData();
+ }
+
+ /**
+ * List insights.
+ *
+ *
See {@link #listGovernanceInsightsWithHttpInfoAsync}.
+ *
+ * @return CompletableFuture<GovernanceInsightsResponse>
+ */
+ public CompletableFuture listGovernanceInsightsAsync() {
+ return listGovernanceInsightsWithHttpInfoAsync(new ListGovernanceInsightsOptionalParameters())
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * List insights.
+ *
+ * See {@link #listGovernanceInsightsWithHttpInfo}.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return GovernanceInsightsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public GovernanceInsightsResponse listGovernanceInsights(
+ ListGovernanceInsightsOptionalParameters parameters) throws ApiException {
+ return listGovernanceInsightsWithHttpInfo(parameters).getData();
+ }
+
+ /**
+ * List insights.
+ *
+ *
See {@link #listGovernanceInsightsWithHttpInfoAsync}.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<GovernanceInsightsResponse>
+ */
+ public CompletableFuture listGovernanceInsightsAsync(
+ ListGovernanceInsightsOptionalParameters parameters) {
+ return listGovernanceInsightsWithHttpInfoAsync(parameters)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Retrieve the list of governance insights available to the organization. Each insight reports
+ * the query used to compute it, so that the value can be computed client-side. Insights can be
+ * filtered by product.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return ApiResponse<GovernanceInsightsResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 401 | Unauthorized | - |
+ * | 403 | Forbidden | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse listGovernanceInsightsWithHttpInfo(
+ ListGovernanceInsightsOptionalParameters parameters) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "listGovernanceInsights";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+ List filterProduct = parameters.filterProduct;
+ // create path and map variables
+ String localVarPath = "/api/v2/governance/insights";
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("multi", "filter[product]", filterProduct));
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.listGovernanceInsights",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * List insights.
+ *
+ * See {@link #listGovernanceInsightsWithHttpInfo}.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<ApiResponse<GovernanceInsightsResponse>>
+ */
+ public CompletableFuture>
+ listGovernanceInsightsWithHttpInfoAsync(ListGovernanceInsightsOptionalParameters parameters) {
+ // Check if unstable operation is enabled
+ String operationId = "listGovernanceInsights";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+ List filterProduct = parameters.filterProduct;
+ // create path and map variables
+ String localVarPath = "/api/v2/governance/insights";
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("multi", "filter[product]", filterProduct));
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.listGovernanceInsights",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * List usage limits.
+ *
+ * See {@link #listGovernanceLimitsWithHttpInfo}.
+ *
+ * @return GovernanceLimitsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public GovernanceLimitsResponse listGovernanceLimits() throws ApiException {
+ return listGovernanceLimitsWithHttpInfo().getData();
+ }
+
+ /**
+ * List usage limits.
+ *
+ *
See {@link #listGovernanceLimitsWithHttpInfoAsync}.
+ *
+ * @return CompletableFuture<GovernanceLimitsResponse>
+ */
+ public CompletableFuture listGovernanceLimitsAsync() {
+ return listGovernanceLimitsWithHttpInfoAsync()
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Retrieve the list of usage limits tracked for the organization in the Governance Console. Each
+ * limit reports the query used to compute current usage, the unit and time range it is measured
+ * over, and its current usage status.
+ *
+ * @return ApiResponse<GovernanceLimitsResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 401 | Unauthorized | - |
+ * | 403 | Forbidden | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse listGovernanceLimitsWithHttpInfo()
+ throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "listGovernanceLimits";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+ // create path and map variables
+ String localVarPath = "/api/v2/governance/limits";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.listGovernanceLimits",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * List usage limits.
+ *
+ * See {@link #listGovernanceLimitsWithHttpInfo}.
+ *
+ * @return CompletableFuture<ApiResponse<GovernanceLimitsResponse>>
+ */
+ public CompletableFuture>
+ listGovernanceLimitsWithHttpInfoAsync() {
+ // Check if unstable operation is enabled
+ String operationId = "listGovernanceLimits";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+ // create path and map variables
+ String localVarPath = "/api/v2/governance/limits";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.listGovernanceLimits",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * List resource limits.
+ *
+ * See {@link #listGovernanceResourceLimitsWithHttpInfo}.
+ *
+ * @return GovernanceResourceLimitsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public GovernanceResourceLimitsResponse listGovernanceResourceLimits() throws ApiException {
+ return listGovernanceResourceLimitsWithHttpInfo().getData();
+ }
+
+ /**
+ * List resource limits.
+ *
+ *
See {@link #listGovernanceResourceLimitsWithHttpInfoAsync}.
+ *
+ * @return CompletableFuture<GovernanceResourceLimitsResponse>
+ */
+ public CompletableFuture listGovernanceResourceLimitsAsync() {
+ return listGovernanceResourceLimitsWithHttpInfoAsync()
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Retrieve the list of resource limits tracked for the organization in the Governance Console.
+ * Each resource limit reports its current value and configured limit, the queries used to compute
+ * them, and its current usage status.
+ *
+ * @return ApiResponse<GovernanceResourceLimitsResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 401 | Unauthorized | - |
+ * | 403 | Forbidden | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse listGovernanceResourceLimitsWithHttpInfo()
+ throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "listGovernanceResourceLimits";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+ // create path and map variables
+ String localVarPath = "/api/v2/governance/resource-limits";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.listGovernanceResourceLimits",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * List resource limits.
+ *
+ * See {@link #listGovernanceResourceLimitsWithHttpInfo}.
+ *
+ * @return CompletableFuture<ApiResponse<GovernanceResourceLimitsResponse>>
+ */
+ public CompletableFuture>
+ listGovernanceResourceLimitsWithHttpInfoAsync() {
+ // Check if unstable operation is enabled
+ String operationId = "listGovernanceResourceLimits";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+ // create path and map variables
+ String localVarPath = "/api/v2/governance/resource-limits";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.listGovernanceResourceLimits",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Mitigate detections.
+ *
+ * See {@link #mitigateGovernanceDetectionsWithHttpInfo}.
+ *
+ * @param body (required)
+ * @throws ApiException if fails to make API call
+ */
+ public void mitigateGovernanceDetections(GovernanceMitigationRequest body) throws ApiException {
+ mitigateGovernanceDetectionsWithHttpInfo(body);
+ }
+
+ /**
+ * Mitigate detections.
+ *
+ *
See {@link #mitigateGovernanceDetectionsWithHttpInfoAsync}.
+ *
+ * @param body (required)
+ * @return CompletableFuture
+ */
+ public CompletableFuture mitigateGovernanceDetectionsAsync(
+ GovernanceMitigationRequest body) {
+ return mitigateGovernanceDetectionsWithHttpInfoAsync(body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Apply a mitigation to a set of governance detections of a given detection type. When the
+ * mitigation type is omitted, the control's configured mitigation is used. The request is
+ * accepted for asynchronous processing.
+ *
+ * @param body (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 202 | Accepted | - |
+ * | 400 | Bad Request | - |
+ * | 401 | Unauthorized | - |
+ * | 403 | Forbidden | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse mitigateGovernanceDetectionsWithHttpInfo(
+ GovernanceMitigationRequest body) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "mitigateGovernanceDetections";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'body' when calling mitigateGovernanceDetections");
+ }
+ // create path and map variables
+ String localVarPath = "/api/v2/governance/detections/mitigate";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.mitigateGovernanceDetections",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Mitigate detections.
+ *
+ * See {@link #mitigateGovernanceDetectionsWithHttpInfo}.
+ *
+ * @param body (required)
+ * @return CompletableFuture<ApiResponse<Void>>
+ */
+ public CompletableFuture> mitigateGovernanceDetectionsWithHttpInfoAsync(
+ GovernanceMitigationRequest body) {
+ // Check if unstable operation is enabled
+ String operationId = "mitigateGovernanceDetections";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'body' when calling mitigateGovernanceDetections"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath = "/api/v2/governance/detections/mitigate";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.mitigateGovernanceDetections",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Update a control.
+ *
+ * See {@link #updateGovernanceControlWithHttpInfo}.
+ *
+ * @param detectionType The detection type that identifies the control, for example
+ * unused_api_keys. (required)
+ * @param body (required)
+ * @return GovernanceControlResponse
+ * @throws ApiException if fails to make API call
+ */
+ public GovernanceControlResponse updateGovernanceControl(
+ String detectionType, GovernanceControlUpdateRequest body) throws ApiException {
+ return updateGovernanceControlWithHttpInfo(detectionType, body).getData();
+ }
+
+ /**
+ * Update a control.
+ *
+ *
See {@link #updateGovernanceControlWithHttpInfoAsync}.
+ *
+ * @param detectionType The detection type that identifies the control, for example
+ * unused_api_keys. (required)
+ * @param body (required)
+ * @return CompletableFuture<GovernanceControlResponse>
+ */
+ public CompletableFuture updateGovernanceControlAsync(
+ String detectionType, GovernanceControlUpdateRequest body) {
+ return updateGovernanceControlWithHttpInfoAsync(detectionType, body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Update the detection, notification, and mitigation configuration of a governance control. Only
+ * the attributes present in the request are modified. Changing the mitigation type or its
+ * parameters may require additional permissions.
+ *
+ * @param detectionType The detection type that identifies the control, for example
+ * unused_api_keys. (required)
+ * @param body (required)
+ * @return ApiResponse<GovernanceControlResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 401 | Unauthorized | - |
+ * | 403 | Forbidden | - |
+ * | 404 | Not Found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse updateGovernanceControlWithHttpInfo(
+ String detectionType, GovernanceControlUpdateRequest body) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "updateGovernanceControl";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'detectionType' is set
+ if (detectionType == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'detectionType' when calling updateGovernanceControl");
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'body' when calling updateGovernanceControl");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/governance/control/{detection_type}"
+ .replaceAll(
+ "\\{" + "detection_type" + "\\}", apiClient.escapeString(detectionType.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.updateGovernanceControl",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "PATCH",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Update a control.
+ *
+ * See {@link #updateGovernanceControlWithHttpInfo}.
+ *
+ * @param detectionType The detection type that identifies the control, for example
+ * unused_api_keys. (required)
+ * @param body (required)
+ * @return CompletableFuture<ApiResponse<GovernanceControlResponse>>
+ */
+ public CompletableFuture>
+ updateGovernanceControlWithHttpInfoAsync(
+ String detectionType, GovernanceControlUpdateRequest body) {
+ // Check if unstable operation is enabled
+ String operationId = "updateGovernanceControl";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'detectionType' is set
+ if (detectionType == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'detectionType' when calling"
+ + " updateGovernanceControl"));
+ return result;
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'body' when calling updateGovernanceControl"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/governance/control/{detection_type}"
+ .replaceAll(
+ "\\{" + "detection_type" + "\\}", apiClient.escapeString(detectionType.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.updateGovernanceControl",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "PATCH",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Update control notification settings.
+ *
+ * See {@link #updateGovernanceControlNotificationSettingsWithHttpInfo}.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @param body (required)
+ * @return ControlNotificationSettingsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public ControlNotificationSettingsResponse updateGovernanceControlNotificationSettings(
+ String detectionType, ControlNotificationSettingsUpdateRequest body) throws ApiException {
+ return updateGovernanceControlNotificationSettingsWithHttpInfo(detectionType, body).getData();
+ }
+
+ /**
+ * Update control notification settings.
+ *
+ *
See {@link #updateGovernanceControlNotificationSettingsWithHttpInfoAsync}.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @param body (required)
+ * @return CompletableFuture<ControlNotificationSettingsResponse>
+ */
+ public CompletableFuture
+ updateGovernanceControlNotificationSettingsAsync(
+ String detectionType, ControlNotificationSettingsUpdateRequest body) {
+ return updateGovernanceControlNotificationSettingsWithHttpInfoAsync(detectionType, body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Replace the notification settings for the governance control with the given detection type,
+ * setting, for each supported event type, whether notifications are enabled and which
+ * destinations receive them.
+ *
+ * @param detectionType The detection type that identifies the control; for example,
+ * unused_api_keys. (required)
+ * @param body (required)
+ * @return ApiResponse<ControlNotificationSettingsResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 401 | Unauthorized | - |
+ * | 403 | Forbidden | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse
+ updateGovernanceControlNotificationSettingsWithHttpInfo(
+ String detectionType, ControlNotificationSettingsUpdateRequest body) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "updateGovernanceControlNotificationSettings";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'detectionType' is set
+ if (detectionType == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'detectionType' when calling"
+ + " updateGovernanceControlNotificationSettings");
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'body' when calling"
+ + " updateGovernanceControlNotificationSettings");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/governance/control/{detection_type}/notification_settings"
+ .replaceAll(
+ "\\{" + "detection_type" + "\\}", apiClient.escapeString(detectionType.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.GovernanceConsoleApi.updateGovernanceControlNotificationSettings",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "PUT",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType