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

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions examples/v2/end-user-device-monitoring/GetEUDMDevice.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
Get a device returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.end_user_device_monitoring_api import EndUserDeviceMonitoringApi

configuration = Configuration()
configuration.unstable_operations["get_eudm_device"] = True
with ApiClient(configuration) as api_client:
api_instance = EndUserDeviceMonitoringApi(api_client)
response = api_instance.get_eudm_device(
device_id="device_id",
)

print(response)
14 changes: 14 additions & 0 deletions examples/v2/end-user-device-monitoring/GetEUDMDevices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""
Get all devices returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.end_user_device_monitoring_api import EndUserDeviceMonitoringApi

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

print(response)
2 changes: 2 additions & 0 deletions src/datadog_api_client/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@ def __init__(
"v2.trigger_deployment_gates_evaluation": False,
"v2.update_deployment_gate": False,
"v2.update_deployment_rule": False,
"v2.get_eudm_device": False,
"v2.get_eudm_devices": False,
"v2.clone_form": False,
"v2.create_and_publish_form": False,
"v2.create_form": False,
Expand Down
133 changes: 133 additions & 0 deletions src/datadog_api_client/v2/api/end_user_device_monitoring_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# 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.device_base_array import DeviceBaseArray
from datadog_api_client.v2.model.device_details import DeviceDetails


class EndUserDeviceMonitoringApi:
"""
Inspect devices reported by the Datadog Agent on end-user laptops, desktops,
and mobile devices, including their health, hardware, and connectivity attributes.
"""

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

self._get_eudm_device_endpoint = _Endpoint(
settings={
"response_type": (DeviceDetails,),
"auth": ["apiKeyAuth", "appKeyAuth"],
"endpoint_path": "/api/v2/eudm/devices/{device_id}",
"operation_id": "get_eudm_device",
"http_method": "GET",
"version": "v2",
},
params_map={
"device_id": {
"required": True,
"openapi_types": (str,),
"attribute": "device_id",
"location": "path",
},
},
headers_map={
"accept": ["application/json"],
},
api_client=api_client,
)

self._get_eudm_devices_endpoint = _Endpoint(
settings={
"response_type": (DeviceBaseArray,),
"auth": ["apiKeyAuth", "appKeyAuth"],
"endpoint_path": "/api/v2/eudm/devices",
"operation_id": "get_eudm_devices",
"http_method": "GET",
"version": "v2",
},
params_map={
"bssid": {
"openapi_types": ([str],),
"attribute": "bssid",
"location": "query",
"collection_format": "multi",
},
"page_limit": {
"validation": {
"inclusive_minimum": 1,
},
"openapi_types": (int,),
"attribute": "page[limit]",
"location": "query",
},
"page_cursor": {
"openapi_types": (str,),
"attribute": "page[cursor]",
"location": "query",
},
},
headers_map={
"accept": ["application/json"],
},
api_client=api_client,
)

def get_eudm_device(
self,
device_id: str,
) -> DeviceDetails:
"""Get a device.

:param device_id: Unique identifier of the device to fetch. Matches the Datadog host identifier.
:type device_id: str
:rtype: DeviceDetails
"""
kwargs: Dict[str, Any] = {}
kwargs["device_id"] = device_id

return self._get_eudm_device_endpoint.call_with_http_info(**kwargs)

def get_eudm_devices(
self,
*,
bssid: Union[List[str], UnsetType] = unset,
page_limit: Union[int, UnsetType] = unset,
page_cursor: Union[str, UnsetType] = unset,
) -> DeviceBaseArray:
"""Get all devices.

:param bssid: Filter devices to those currently associated with any of the given BSSID values.
Each value must be a MAC-48 address; repeat the parameter to pass several values.
:type bssid: [str], optional
:param page_limit: Maximum number of devices to return in one page. Must be a positive integer.
If not set, the response contains all matching devices.
:type page_limit: int, optional
:param page_cursor: Opaque cursor that selects the next page. Use the ``meta.page.after`` value
of the previous response. Devices are ordered by ID.
:type page_cursor: str, optional
:rtype: DeviceBaseArray
"""
kwargs: Dict[str, Any] = {}
if bssid is not unset:
kwargs["bssid"] = bssid

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

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

return self._get_eudm_devices_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 @@ -56,6 +56,7 @@
from datadog_api_client.v2.api.domain_allowlist_api import DomainAllowlistApi
from datadog_api_client.v2.api.downtimes_api import DowntimesApi
from datadog_api_client.v2.api.elastic_cloud_integration_api import ElasticCloudIntegrationApi
from datadog_api_client.v2.api.end_user_device_monitoring_api import EndUserDeviceMonitoringApi
from datadog_api_client.v2.api.entity_integration_configs_api import EntityIntegrationConfigsApi
from datadog_api_client.v2.api.entity_risk_scores_api import EntityRiskScoresApi
from datadog_api_client.v2.api.error_tracking_api import ErrorTrackingApi
Expand Down Expand Up @@ -217,6 +218,7 @@
"DomainAllowlistApi",
"DowntimesApi",
"ElasticCloudIntegrationApi",
"EndUserDeviceMonitoringApi",
"EntityIntegrationConfigsApi",
"EntityRiskScoresApi",
"ErrorTrackingApi",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 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

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
date,
datetime,
none_type,
UUID,
)


class ArbitraryRuleMappingTransform(ModelNormal):
@cached_property
def openapi_types(_):
return {
"mapping": (
{
str: (
bool,
date,
datetime,
dict,
float,
int,
list,
str,
UUID,
none_type,
)
},
),
"synthetic_tag": (str,),
}

attribute_map = {
"mapping": "mapping",
"synthetic_tag": "synthetic_tag",
}

def __init__(self_, mapping: Dict[str, Any], synthetic_tag: str, **kwargs):
"""
Only supported for ``proportional_timeseries`` and ``even_timeseries`` rules. Creates a synthetic tag from timeseries input rows before ``tag_transforms`` are applied.

:param mapping: Recursive mapping node. Each ``match_on_values`` branch contains a value and a nested node.
:type mapping: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}

:param synthetic_tag: The name of the synthetic tag created by the mapping.
:type synthetic_tag: str
"""
super().__init__(kwargs)

self_.mapping = mapping
self_.synthetic_tag = synthetic_tag
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
from datadog_api_client.v2.model.arbitrary_rule_response_data_attributes_costs_to_allocate_items import (
ArbitraryRuleResponseDataAttributesCostsToAllocateItems,
)
from datadog_api_client.v2.model.arbitrary_rule_response_data_attributes_rule_category import (
ArbitraryRuleResponseDataAttributesRuleCategory,
)
from datadog_api_client.v2.model.arbitrary_rule_response_data_attributes_strategy import (
ArbitraryRuleResponseDataAttributesStrategy,
)
Expand All @@ -35,6 +38,9 @@ def openapi_types(_):
from datadog_api_client.v2.model.arbitrary_rule_response_data_attributes_costs_to_allocate_items import (
ArbitraryRuleResponseDataAttributesCostsToAllocateItems,
)
from datadog_api_client.v2.model.arbitrary_rule_response_data_attributes_rule_category import (
ArbitraryRuleResponseDataAttributesRuleCategory,
)
from datadog_api_client.v2.model.arbitrary_rule_response_data_attributes_strategy import (
ArbitraryRuleResponseDataAttributesStrategy,
)
Expand All @@ -43,31 +49,39 @@ def openapi_types(_):
"costs_to_allocate": ([ArbitraryRuleResponseDataAttributesCostsToAllocateItems],),
"created": (datetime,),
"enabled": (bool,),
"is_ootb": (bool,),
"last_modified_user_uuid": (str,),
"order_id": (int,),
"processing_status": (str,),
"provider": ([str],),
"rejected": (bool,),
"rule_category": (ArbitraryRuleResponseDataAttributesRuleCategory,),
"rule_name": (str,),
"strategy": (ArbitraryRuleResponseDataAttributesStrategy,),
"type": (str,),
"updated": (datetime,),
"valid_from_date": (datetime,),
"valid_through_date": (datetime,),
"version": (int,),
}

attribute_map = {
"costs_to_allocate": "costs_to_allocate",
"created": "created",
"enabled": "enabled",
"is_ootb": "is_ootb",
"last_modified_user_uuid": "last_modified_user_uuid",
"order_id": "order_id",
"processing_status": "processing_status",
"provider": "provider",
"rejected": "rejected",
"rule_category": "rule_category",
"rule_name": "rule_name",
"strategy": "strategy",
"type": "type",
"updated": "updated",
"valid_from_date": "valid_from_date",
"valid_through_date": "valid_through_date",
"version": "version",
}

Expand All @@ -84,8 +98,12 @@ def __init__(
type: str,
updated: datetime,
version: int,
is_ootb: Union[bool, UnsetType] = unset,
processing_status: Union[str, UnsetType] = unset,
rejected: Union[bool, UnsetType] = unset,
rule_category: Union[ArbitraryRuleResponseDataAttributesRuleCategory, UnsetType] = unset,
valid_from_date: Union[datetime, UnsetType] = unset,
valid_through_date: Union[datetime, UnsetType] = unset,
**kwargs,
):
"""
Expand All @@ -100,6 +118,9 @@ def __init__(
:param enabled: The ``attributes`` ``enabled``.
:type enabled: bool

:param is_ootb: Whether the rule is an out-of-the-box rule provided by Datadog. Omitted when ``false``.
:type is_ootb: bool, optional

:param last_modified_user_uuid: The ``attributes`` ``last_modified_user_uuid``.
:type last_modified_user_uuid: str

Expand All @@ -115,6 +136,9 @@ def __init__(
:param rejected: The ``attributes`` ``rejected``.
:type rejected: bool, optional

:param rule_category: Rule category. Omitted for custom rules.
:type rule_category: ArbitraryRuleResponseDataAttributesRuleCategory, optional

:param rule_name: The ``attributes`` ``rule_name``.
:type rule_name: str

Expand All @@ -127,13 +151,27 @@ def __init__(
:param updated: The ``attributes`` ``updated``.
:type updated: datetime

:param valid_from_date: The first date the rule applies to. Omitted when the rule has no start date.
:type valid_from_date: datetime, optional

:param valid_through_date: The last date the rule applies to. Omitted when the rule has no end date.
:type valid_through_date: datetime, optional

:param version: The ``attributes`` ``version``.
:type version: int
"""
if is_ootb is not unset:
kwargs["is_ootb"] = is_ootb
if processing_status is not unset:
kwargs["processing_status"] = processing_status
if rejected is not unset:
kwargs["rejected"] = rejected
if rule_category is not unset:
kwargs["rule_category"] = rule_category
if valid_from_date is not unset:
kwargs["valid_from_date"] = valid_from_date
if valid_through_date is not unset:
kwargs["valid_through_date"] = valid_through_date
super().__init__(kwargs)

self_.costs_to_allocate = costs_to_allocate
Expand Down
Loading
Loading