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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
519 changes: 519 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions docs/datadog_api_client.v2.api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,13 @@ datadog\_api\_client.v2.api.google\_chat\_integration\_api module
:members:
:show-inheritance:

datadog\_api\_client.v2.api.governance\_insights\_api module
------------------------------------------------------------

.. automodule:: datadog_api_client.v2.api.governance_insights_api
:members:
:show-inheritance:

datadog\_api\_client.v2.api.high\_availability\_multi\_region\_api module
-------------------------------------------------------------------------

Expand Down
91 changes: 91 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16706,6 +16706,97 @@ datadog\_api\_client.v2.model.google\_meet\_configuration\_reference\_data modul
:members:
:show-inheritance:

datadog\_api\_client.v2.model.governance\_best\_practice\_definition module
---------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.governance_best_practice_definition
:members:
:show-inheritance:

datadog\_api\_client.v2.model.governance\_insight\_attributes module
--------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.governance_insight_attributes
:members:
:show-inheritance:

datadog\_api\_client.v2.model.governance\_insight\_audit\_compute module
------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.governance_insight_audit_compute
:members:
:show-inheritance:

datadog\_api\_client.v2.model.governance\_insight\_audit\_query module
----------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.governance_insight_audit_query
:members:
:show-inheritance:

datadog\_api\_client.v2.model.governance\_insight\_data module
--------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.governance_insight_data
:members:
:show-inheritance:

datadog\_api\_client.v2.model.governance\_insight\_event\_compute module
------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.governance_insight_event_compute
:members:
:show-inheritance:

datadog\_api\_client.v2.model.governance\_insight\_event\_query module
----------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.governance_insight_event_query
:members:
:show-inheritance:

datadog\_api\_client.v2.model.governance\_insight\_metric\_query module
-----------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.governance_insight_metric_query
:members:
:show-inheritance:

datadog\_api\_client.v2.model.governance\_insight\_percentage\_query module
---------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.governance_insight_percentage_query
:members:
:show-inheritance:

datadog\_api\_client.v2.model.governance\_insight\_query\_config module
-----------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.governance_insight_query_config
:members:
:show-inheritance:

datadog\_api\_client.v2.model.governance\_insight\_resource\_type module
------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.governance_insight_resource_type
:members:
:show-inheritance:

datadog\_api\_client.v2.model.governance\_insight\_usage\_query module
----------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.governance_insight_usage_query
:members:
:show-inheritance:

datadog\_api\_client.v2.model.governance\_insights\_response module
-------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.governance_insights_response
:members:
:show-inheritance:

datadog\_api\_client.v2.model.grey\_noise\_api\_key module
----------------------------------------------------------

Expand Down
14 changes: 14 additions & 0 deletions examples/v2/governance-insights/ListGovernanceInsights.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""
List governance insights returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.governance_insights_api import GovernanceInsightsApi

configuration = Configuration()
configuration.unstable_operations["list_governance_insights"] = True
with ApiClient(configuration) as api_client:
api_instance = GovernanceInsightsApi(api_client)
response = api_instance.list_governance_insights()

print(response)
1 change: 1 addition & 0 deletions src/datadog_api_client/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ def __init__(
"v2.upsert_and_publish_form_version": False,
"v2.upsert_form_version": False,
"v2.update_org_saml_configurations": False,
"v2.list_governance_insights": False,
"v2.create_hamr_org_connection": False,
"v2.get_hamr_org_connection": False,
"v2.delete_entity_integration_config": False,
Expand Down
98 changes: 98 additions & 0 deletions src/datadog_api_client/v2/api/governance_insights_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import Any, Dict, List, Union

from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint
from datadog_api_client.configuration import Configuration
from datadog_api_client.model_utils import (
UnsetType,
unset,
)
from datadog_api_client.v2.model.governance_insights_response import GovernanceInsightsResponse


class GovernanceInsightsApi:
"""
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.
"""

def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient(Configuration())
self.api_client = api_client

self._list_governance_insights_endpoint = _Endpoint(
settings={
"response_type": (GovernanceInsightsResponse,),
"auth": ["apiKeyAuth", "appKeyAuth"],
"endpoint_path": "/api/v2/governance/insights",
"operation_id": "list_governance_insights",
"http_method": "GET",
"version": "v2",
},
params_map={
"with_values": {
"openapi_types": (bool,),
"attribute": "withValues",
"location": "query",
},
"org_uuid": {
"openapi_types": (str,),
"attribute": "orgUuid",
"location": "query",
},
"filter_product": {
"openapi_types": ([str],),
"attribute": "filter[product]",
"location": "query",
"collection_format": "multi",
},
},
headers_map={
"accept": ["application/json"],
},
api_client=api_client,
)

def list_governance_insights(
self,
*,
with_values: Union[bool, UnsetType] = unset,
org_uuid: Union[str, UnsetType] = unset,
filter_product: Union[List[str], UnsetType] = unset,
) -> GovernanceInsightsResponse:
"""List governance insights.

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.

:param with_values: Whether to compute and include the current and previous value of each insight.
Defaults to ``false`` , in which case only insight metadata is returned.
:type with_values: bool, optional
:param org_uuid: 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.
:type org_uuid: str, optional
:param filter_product: Restrict the results to insights belonging to the given products. May be repeated to
filter by multiple products. Matching is case-insensitive.
:type filter_product: [str], optional
:rtype: GovernanceInsightsResponse
"""
kwargs: Dict[str, Any] = {}
if with_values is not unset:
kwargs["with_values"] = with_values

if org_uuid is not unset:
kwargs["org_uuid"] = org_uuid

if filter_product is not unset:
kwargs["filter_product"] = filter_product

return self._list_governance_insights_endpoint.call_with_http_info(**kwargs)
2 changes: 2 additions & 0 deletions src/datadog_api_client/v2/apis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
from datadog_api_client.v2.api.forms_api import FormsApi
from datadog_api_client.v2.api.gcp_integration_api import GCPIntegrationApi
from datadog_api_client.v2.api.google_chat_integration_api import GoogleChatIntegrationApi
from datadog_api_client.v2.api.governance_insights_api import GovernanceInsightsApi
from datadog_api_client.v2.api.high_availability_multi_region_api import HighAvailabilityMultiRegionApi
from datadog_api_client.v2.api.ip_allowlist_api import IPAllowlistApi
from datadog_api_client.v2.api.incidents_api import IncidentsApi
Expand Down Expand Up @@ -189,6 +190,7 @@
"FormsApi",
"GCPIntegrationApi",
"GoogleChatIntegrationApi",
"GovernanceInsightsApi",
"HighAvailabilityMultiRegionApi",
"IPAllowlistApi",
"IncidentsApi",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import List, Union

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
none_type,
unset,
UnsetType,
)


class GovernanceBestPracticeDefinition(ModelNormal):
@cached_property
def openapi_types(_):
return {
"category": (str,),
"deep_link": (str,),
"description": (str,),
"detection_type": (str, none_type),
"id": (str,),
"impact": (str,),
"impact_hint": (int,),
"permissions": ([str],),
"status": (str,),
"summary": (str,),
"title": (str,),
"trigger_condition": (str,),
"trigger_type": (str,),
}

attribute_map = {
"category": "category",
"deep_link": "deep_link",
"description": "description",
"detection_type": "detection_type",
"id": "id",
"impact": "impact",
"impact_hint": "impact_hint",
"permissions": "permissions",
"status": "status",
"summary": "summary",
"title": "title",
"trigger_condition": "trigger_condition",
"trigger_type": "trigger_type",
}

def __init__(
self_,
category: str,
deep_link: str,
description: str,
id: str,
impact: str,
impact_hint: int,
permissions: List[str],
status: str,
summary: str,
title: str,
trigger_condition: str,
trigger_type: str,
detection_type: Union[str, none_type, UnsetType] = unset,
**kwargs,
):
"""
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.

:param category: The value driver the best practice is grouped under, such as ``access_governance`` ,
``security`` , ``compliance`` , or ``operational_hygiene``.
:type category: str

:param deep_link: A relative link to the configuration page where the best practice can be acted upon.
:type deep_link: str

:param description: The full rationale and guidance for the best practice.
:type description: str

:param detection_type: An optional association to a control's detection type. ``null`` when not associated with a control.
:type detection_type: str, none_type, optional

:param id: The unique identifier of the best practice.
:type id: str

:param impact: The expected impact of following the best practice.
:type impact: str

:param impact_hint: A priority hint for ordering best practices by expected impact. Lower values indicate
higher priority.
:type impact_hint: int

:param permissions: The permissions required for the user to act on the best practice.
:type permissions: [str]

:param status: Whether the best practice is currently ``active`` or ``deprecated``.
:type status: str

:param summary: A one-line explanation of why this best practice matters.
:type summary: str

:param title: A short, human-readable name for the best practice.
:type title: str

:param trigger_condition: The condition that surfaces the best practice. For an ``insight`` trigger, the insight
slug; for a ``static`` trigger, a descriptive condition key.
:type trigger_condition: str

:param trigger_type: How the best practice is surfaced. ``insight`` ties it to an insight; ``static`` surfaces it
unless its condition is met.
:type trigger_type: str
"""
if detection_type is not unset:
kwargs["detection_type"] = detection_type
super().__init__(kwargs)

self_.category = category
self_.deep_link = deep_link
self_.description = description
self_.id = id
self_.impact = impact
self_.impact_hint = impact_hint
self_.permissions = permissions
self_.status = status
self_.summary = summary
self_.title = title
self_.trigger_condition = trigger_condition
self_.trigger_type = trigger_type
Loading
Loading