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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
630 changes: 630 additions & 0 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
66 changes: 66 additions & 0 deletions src/datadog_api_client/v2/model/device_base_array.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# 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, TYPE_CHECKING

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


if TYPE_CHECKING:
from datadog_api_client.v2.model.device_base_data import DeviceBaseData
from datadog_api_client.v2.model.device_base_array_links import DeviceBaseArrayLinks
from datadog_api_client.v2.model.device_base_array_meta import DeviceBaseArrayMeta


class DeviceBaseArray(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.device_base_data import DeviceBaseData
from datadog_api_client.v2.model.device_base_array_links import DeviceBaseArrayLinks
from datadog_api_client.v2.model.device_base_array_meta import DeviceBaseArrayMeta

return {
"data": ([DeviceBaseData],),
"links": (DeviceBaseArrayLinks,),
"meta": (DeviceBaseArrayMeta,),
}

attribute_map = {
"data": "data",
"links": "links",
"meta": "meta",
}

def __init__(
self_,
data: List[DeviceBaseData],
links: Union[DeviceBaseArrayLinks, UnsetType] = unset,
meta: Union[DeviceBaseArrayMeta, UnsetType] = unset,
**kwargs,
):
"""
Response body for the list devices endpoint.

:param data: List of devices matching the request.
:type data: [DeviceBaseData]

:param links: Links related to the current page of devices.
:type links: DeviceBaseArrayLinks, optional

:param meta: Metadata about the list devices response.
:type meta: DeviceBaseArrayMeta, optional
"""
if links is not unset:
kwargs["links"] = links
if meta is not unset:
kwargs["meta"] = meta
super().__init__(kwargs)

self_.data = data
43 changes: 43 additions & 0 deletions src/datadog_api_client/v2/model/device_base_array_links.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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 Union

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


class DeviceBaseArrayLinks(ModelNormal):
@cached_property
def openapi_types(_):
return {
"next": (str,),
"self": (str,),
}

attribute_map = {
"next": "next",
"self": "self",
}

def __init__(self_, next: Union[str, UnsetType] = unset, self: Union[str, UnsetType] = unset, **kwargs):
"""
Links related to the current page of devices.

:param next: URL of the next page of devices. Present only when more devices remain.
:type next: str, optional

:param self: URL of the current request.
:type self: str, optional
"""
if next is not unset:
kwargs["next"] = next
if self is not unset:
kwargs["self"] = self
super().__init__(kwargs)
42 changes: 42 additions & 0 deletions src/datadog_api_client/v2/model/device_base_array_meta.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 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 Union, TYPE_CHECKING

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


if TYPE_CHECKING:
from datadog_api_client.v2.model.device_base_array_meta_page import DeviceBaseArrayMetaPage


class DeviceBaseArrayMeta(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.device_base_array_meta_page import DeviceBaseArrayMetaPage

return {
"page": (DeviceBaseArrayMetaPage,),
}

attribute_map = {
"page": "page",
}

def __init__(self_, page: Union[DeviceBaseArrayMetaPage, UnsetType] = unset, **kwargs):
"""
Metadata about the list devices response.

:param page: Pagination information for the list devices response.
:type page: DeviceBaseArrayMetaPage, optional
"""
if page is not unset:
kwargs["page"] = page
super().__init__(kwargs)
37 changes: 37 additions & 0 deletions src/datadog_api_client/v2/model/device_base_array_meta_page.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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 Union

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


class DeviceBaseArrayMetaPage(ModelNormal):
@cached_property
def openapi_types(_):
return {
"after": (str,),
}

attribute_map = {
"after": "after",
}

def __init__(self_, after: Union[str, UnsetType] = unset, **kwargs):
"""
Pagination information for the list devices response.

:param after: Cursor to pass as ``page[cursor]`` to get the next page.
Present only when more devices remain.
:type after: str, optional
"""
if after is not unset:
kwargs["after"] = after
super().__init__(kwargs)
Loading
Loading