From 833e4721f9479153651ad6fb5a5a6edb1818a544 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 10 Nov 2026 20:14:28 +0000 Subject: [PATCH] Regenerate client from commit 87589c6 of spec repo --- .generator/schemas/v2/openapi.yaml | 630 ++++++++++++++++++ .../GetEUDMDevice.py | 16 + .../GetEUDMDevices.py | 14 + src/datadog_api_client/configuration.py | 2 + .../v2/api/end_user_device_monitoring_api.py | 133 ++++ src/datadog_api_client/v2/apis/__init__.py | 2 + .../v2/model/device_base_array.py | 66 ++ .../v2/model/device_base_array_links.py | 43 ++ .../v2/model/device_base_array_meta.py | 42 ++ .../v2/model/device_base_array_meta_page.py | 37 + .../v2/model/device_base_data.py | 63 ++ .../v2/model/device_base_data_attributes.py | 296 ++++++++ .../v2/model/device_details.py | 42 ++ .../v2/model/device_details_data.py | 64 ++ .../model/device_details_data_attributes.py | 419 ++++++++++++ .../v2/model/device_details_data_type.py | 35 + .../v2/model/device_employee.py | 90 +++ .../v2/model/device_geo_ip.py | 82 +++ .../v2/model/device_status.py | 48 ++ src/datadog_api_client/v2/models/__init__.py | 26 + .../test-runner-data/manifest.json | 14 + ...t-a-device-returns-not-found-response.json | 35 + .../get-all-devices-returns-ok-response.json | 18 + .../test-server-data/manifest.json | 5 + .../v2/end-user-device-monitoring.json | 69 ++ .../end_user_device_monitoring.feature | 48 ++ tests/v2/features/undo.json | 12 + 27 files changed, 2351 insertions(+) create mode 100644 examples/v2/end-user-device-monitoring/GetEUDMDevice.py create mode 100644 examples/v2/end-user-device-monitoring/GetEUDMDevices.py create mode 100644 src/datadog_api_client/v2/api/end_user_device_monitoring_api.py create mode 100644 src/datadog_api_client/v2/model/device_base_array.py create mode 100644 src/datadog_api_client/v2/model/device_base_array_links.py create mode 100644 src/datadog_api_client/v2/model/device_base_array_meta.py create mode 100644 src/datadog_api_client/v2/model/device_base_array_meta_page.py create mode 100644 src/datadog_api_client/v2/model/device_base_data.py create mode 100644 src/datadog_api_client/v2/model/device_base_data_attributes.py create mode 100644 src/datadog_api_client/v2/model/device_details.py create mode 100644 src/datadog_api_client/v2/model/device_details_data.py create mode 100644 src/datadog_api_client/v2/model/device_details_data_attributes.py create mode 100644 src/datadog_api_client/v2/model/device_details_data_type.py create mode 100644 src/datadog_api_client/v2/model/device_employee.py create mode 100644 src/datadog_api_client/v2/model/device_geo_ip.py create mode 100644 src/datadog_api_client/v2/model/device_status.py create mode 100644 tests/generated-test/test-runner-data/v2/end-user-device-monitoring/get-a-device-returns-not-found-response.json create mode 100644 tests/generated-test/test-runner-data/v2/end-user-device-monitoring/get-all-devices-returns-ok-response.json create mode 100644 tests/generated-test/test-server-data/v2/end-user-device-monitoring.json create mode 100644 tests/v2/features/end_user_device_monitoring.feature diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 7991818c67..2206c1d70b 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -43191,6 +43191,455 @@ components: format: int64 type: integer type: object + DeviceBaseArray: + description: Response body for the list devices endpoint. + properties: + data: + description: List of devices matching the request. + items: + $ref: "#/components/schemas/DeviceBaseData" + type: array + links: + $ref: "#/components/schemas/DeviceBaseArrayLinks" + meta: + $ref: "#/components/schemas/DeviceBaseArrayMeta" + required: + - data + type: object + DeviceBaseArrayLinks: + description: Links related to the current page of devices. + properties: + next: + description: URL of the next page of devices. Present only when more devices remain. + example: /api/v2/eudm/devices?page%5Bcursor%5D=TEFQVE9QLURFTU8tMDAx&page%5Blimit%5D=1 + type: string + self: + description: URL of the current request. + example: /api/v2/eudm/devices?page%5Blimit%5D=1 + type: string + type: object + DeviceBaseArrayMeta: + description: Metadata about the list devices response. + properties: + page: + $ref: "#/components/schemas/DeviceBaseArrayMetaPage" + type: object + DeviceBaseArrayMetaPage: + description: Pagination information for the list devices response. + properties: + after: + description: |- + Cursor to pass as `page[cursor]` to get the next page. + Present only when more devices remain. + example: TEFQVE9QLURFTU8tMDAx + type: string + type: object + DeviceBaseData: + description: A single device entry as returned by the list devices endpoint. + properties: + attributes: + $ref: "#/components/schemas/DeviceBaseDataAttributes" + id: + description: Unique identifier of the device. Matches the Datadog host identifier. + example: LAPTOP-DEMO-001 + type: string + type: + $ref: "#/components/schemas/DeviceDetailsDataType" + required: + - type + - id + type: object + DeviceBaseDataAttributes: + description: Common health and identity attributes shared by every End User Device Monitoring device record. + properties: + agent_key: + description: Public key of the Datadog Agent installed on the device. + type: string + agent_version: + description: Version of the Datadog Agent installed on the device. + type: string + battery_critical: + description: Whether the device's battery health has degraded to a critical level. + type: boolean + battery_max_capacity_pct: + description: Maximum battery capacity expressed as a percentage of the device's design capacity. + format: int64 + type: integer + cpu_cores: + description: Number of physical CPU cores on the device. + format: int64 + type: integer + cpu_logical_processors: + description: Number of logical CPU processors (hardware threads) on the device. + format: int64 + type: integer + cpu_model: + description: Human-readable name of the device's CPU model. + type: string + cpu_usage: + description: Average CPU usage on the device, as a percentage between 0 and 100. + format: double + type: number + disk_usage: + description: Average disk usage on the device, as a percentage between 0 and 100. + format: double + type: number + employee: + $ref: "#/components/schemas/DeviceEmployee" + geo_ip: + $ref: "#/components/schemas/DeviceGeoIP" + ip_address: + description: Last observed IPv4 or IPv6 address of the device. + type: string + issues: + description: |- + List of issue identifiers currently affecting the device. + items: + description: Identifier of a single issue currently affecting the device. + type: string + type: array + kernel_name: + description: Name of the operating system kernel running on the device. + type: string + last_reboot: + description: Timestamp of the most recent device reboot, in RFC 3339 format. + type: string + last_seen: + description: Timestamp of the most recent telemetry received from the device, in RFC 3339 format. + type: string + manufacturer: + description: Manufacturer of the device. + type: string + mem_usage: + description: Average memory usage on the device, as a percentage between 0 and 100. + format: double + type: number + memory_total_kb: + description: Total amount of physical memory available on the device, in kilobytes. + format: int64 + type: integer + model_name: + description: Marketing or product name of the device model. + type: string + model_number: + description: Manufacturer-assigned model number of the device. + type: string + os: + description: |- + Operating system family running on the device, as reported by the Datadog Agent + (for example, `macOS`, `Windows`, or `linux`). Empty when unknown. + type: string + os_version: + description: Operating system version running on the device. + type: string + resource_id: + description: Datadog resource identifier for the device. + type: string + serial_number: + description: Serial number assigned to the device by its manufacturer. + type: string + status: + $ref: "#/components/schemas/DeviceStatus" + type: + description: Hardware type of the device (for example, `laptop` or `desktop`). `unknown` when the type cannot be determined. + type: string + uptime: + description: Time elapsed since the device last booted, in seconds. + format: double + type: number + wlan_bssid: + description: |- + BSSID (MAC address of the access point) of the wireless network the device is + currently connected to. + type: string + wlan_rssi: + description: Received signal strength indicator of the device's current wireless connection, in dBm. + format: double + type: number + wlan_ssid: + description: SSID of the wireless network the device is currently connected to. + type: string + type: object + DeviceDetails: + description: Response body for the get device endpoint, returning a single device with full attribute detail. + properties: + data: + $ref: "#/components/schemas/DeviceDetailsData" + type: object + DeviceDetailsData: + description: A single device entry with full attribute detail. + properties: + attributes: + $ref: "#/components/schemas/DeviceDetailsDataAttributes" + id: + description: Unique identifier of the device. Matches the Datadog host identifier. + example: LAPTOP-DEMO-001 + type: string + type: + $ref: "#/components/schemas/DeviceDetailsDataType" + required: + - type + - id + type: object + DeviceDetailsDataAttributes: + description: |- + Extended set of attributes for a single End User Device Monitoring device, + including Cloud Network Monitoring and battery metrics. + properties: + agent_key: + description: Public key of the Datadog Agent installed on the device. + type: string + agent_version: + description: Version of the Datadog Agent installed on the device. + type: string + battery_charge_pct: + description: Current battery charge level as a percentage between 0 and 100. + format: int64 + type: integer + battery_charge_rate: + description: |- + Rate at which the battery is charging or discharging, in milliamperes. + Negative values indicate discharge. + format: int64 + type: integer + battery_critical: + description: Whether the device's battery health has degraded to a critical level. + type: boolean + battery_cycle_count: + description: Number of full charge cycles the battery has gone through. + format: int64 + type: integer + battery_max_capacity_pct: + description: Maximum battery capacity expressed as a percentage of the device's design capacity. + format: int64 + type: integer + cnm_enabled: + description: Whether Cloud Network Monitoring is enabled on the device. + type: boolean + cpu_cores: + description: Number of physical CPU cores on the device. + format: int64 + type: integer + cpu_logical_processors: + description: Number of logical CPU processors (hardware threads) on the device. + format: int64 + type: integer + cpu_model: + description: Human-readable name of the device's CPU model. + type: string + cpu_usage: + description: Average CPU usage on the device, as a percentage between 0 and 100. + format: double + type: number + disk_usage: + description: Average disk usage on the device, as a percentage between 0 and 100. + format: double + type: number + employee: + $ref: "#/components/schemas/DeviceEmployee" + geo_ip: + $ref: "#/components/schemas/DeviceGeoIP" + ip_address: + description: Last observed IPv4 or IPv6 address of the device. + type: string + issues: + description: |- + List of issue identifiers currently affecting the device. + items: + description: Identifier of a single issue currently affecting the device. + type: string + type: array + kernel_name: + description: Name of the operating system kernel running on the device. + type: string + last_reboot: + description: Timestamp of the most recent device reboot, in RFC 3339 format. + type: string + last_seen: + description: Timestamp of the most recent telemetry received from the device, in RFC 3339 format. + type: string + manufacturer: + description: Manufacturer of the device. + type: string + mem_usage: + description: Average memory usage on the device, as a percentage between 0 and 100. + format: double + type: number + memory_total_kb: + description: Total amount of physical memory available on the device, in kilobytes. + format: int64 + type: integer + model_name: + description: Marketing or product name of the device model. + type: string + model_number: + description: Manufacturer-assigned model number of the device. + type: string + os: + description: |- + Operating system family running on the device, as reported by the Datadog Agent + (for example, `macOS`, `Windows`, or `linux`). Empty when unknown. + type: string + os_version: + description: Operating system version running on the device. + type: string + packet_sent: + description: |- + Number of TCP packets sent by the device over the query window, + as reported by Cloud Network Monitoring. + format: double + type: number + resource_id: + description: Datadog resource identifier for the device. + type: string + retransmit: + description: Number of TCP packets retransmitted by the device over the query window. + format: double + type: number + retransmit_pct: + description: Percentage of sent TCP packets that were retransmitted, between 0 and 100. + format: double + type: number + serial_number: + description: Serial number assigned to the device by its manufacturer. + type: string + status: + $ref: "#/components/schemas/DeviceStatus" + tcp_canceled: + description: Number of TCP connection attempts canceled by the device over the query window. + format: double + type: number + tcp_established: + description: Number of TCP connections established by the device over the query window. + format: double + type: number + tcp_establishment_failure_pct: + description: Percentage of TCP connection attempts that failed, between 0 and 100. + format: double + type: number + tcp_establishment_failures: + description: Number of TCP connection attempts that failed over the query window. + format: double + type: number + tcp_host_unreachable: + description: Number of TCP connection attempts that failed because the host was unreachable. + format: double + type: number + tcp_network_unreachable: + description: Number of TCP connection attempts that failed because the network was unreachable. + format: double + type: number + tcp_refusals: + description: Number of TCP connection attempts refused by the remote host over the query window. + format: double + type: number + tcp_timeouts: + description: Number of TCP connection attempts that timed out over the query window. + format: double + type: number + type: + description: Hardware type of the device (for example, `laptop` or `desktop`). `unknown` when the type cannot be determined. + type: string + uptime: + description: Time elapsed since the device last booted, in seconds. + format: double + type: number + wlan_bssid: + description: |- + BSSID (MAC address of the access point) of the wireless network the device is + currently connected to. + type: string + wlan_rssi: + description: Received signal strength indicator of the device's current wireless connection, in dBm. + format: double + type: number + wlan_ssid: + description: SSID of the wireless network the device is currently connected to. + type: string + type: object + DeviceDetailsDataType: + default: devices + description: Devices resource type. + enum: + - devices + example: devices + type: string + x-enum-varnames: + - DEVICES + DeviceEmployee: + description: |- + Directory information about the employee associated with the device, + sourced from a customer reference table. + Absent when no reference table is configured or the device has no match. + properties: + city: + description: City where the employee is based. + type: string + country: + description: Country where the employee is based. + type: string + department: + description: Department the employee belongs to. + type: string + email: + description: Email address of the employee. + type: string + name: + description: Full name of the employee. + type: string + office: + description: Office the employee is assigned to. + type: string + team: + description: Team the employee belongs to. + type: string + type: object + DeviceGeoIP: + description: |- + Location derived from the device's public IP address. + Absent when no location data is available. + properties: + geo_city: + description: City resolved from the device's public IP address. + type: string + geo_country_iso_code: + description: ISO 3166-1 alpha-2 country code resolved from the device's public IP address. + type: string + geo_latitude: + description: Latitude resolved from the device's public IP address. + format: double + type: number + geo_longitude: + description: Longitude resolved from the device's public IP address. + format: double + type: number + geo_subdivision_iso_code: + description: |- + ISO 3166-2 subdivision code (for example, a state or province) + resolved from the device's public IP address. + type: string + public_ip_address: + description: Public IPv4 or IPv6 address of the device. + type: string + type: object + DeviceStatus: + description: |- + Health status of the device, computed from its issues and recent telemetry. + `inactive` means the device stopped reporting. `unknown` means no telemetry is available yet. + enum: + - healthy + - degraded + - critical + - inactive + - unknown + example: healthy + type: string + x-enum-varnames: + - HEALTHY + - DEGRADED + - CRITICAL + - INACTIVE + - UNKNOWN DeviceTagsBySource: description: Tags associated with a device from a specific source. properties: @@ -179710,6 +180159,183 @@ paths: summary: Update the state of an issue tags: - Error Tracking + /api/v2/eudm/devices: + get: + operationId: GetEUDMDevices + parameters: + - description: |- + 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. + explode: true + in: query + name: bssid + required: false + schema: + items: + example: 00:00:5e:00:53:01 + pattern: "^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$" + type: string + type: array + style: form + - description: |- + Maximum number of devices to return in one page. Must be a positive integer. + If not set, the response contains all matching devices. + in: query + name: page[limit] + required: false + schema: + example: 100 + format: int64 + minimum: 1 + type: integer + - description: |- + Opaque cursor that selects the next page. Use the `meta.page.after` value + of the previous response. Devices are ordered by ID. + in: query + name: page[cursor] + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + cpu_usage: 12.4 + disk_usage: 38.2 + issues: [] + last_seen: "2026-05-20T10:15:30Z" + manufacturer: Apple + mem_usage: 47.1 + model_name: MacBook Pro + os: macOS + os_version: macOS 15.6.1 arm64 + status: healthy + id: LAPTOP-DEMO-001 + type: devices + links: + next: /api/v2/eudm/devices?page%5Bcursor%5D=TEFQVE9QLURFTU8tMDAx&page%5Blimit%5D=1 + self: /api/v2/eudm/devices?page%5Blimit%5D=1 + meta: + page: + after: TEFQVE9QLURFTU8tMDAx + schema: + $ref: "#/components/schemas/DeviceBaseArray" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get all devices + tags: + - End User Device Monitoring + x-permission: + operator: OR + permissions: + - end_user_devices_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/eudm/devices/{device_id}: + get: + operationId: GetEUDMDevice + parameters: + - description: Unique identifier of the device to fetch. Matches the Datadog host identifier. + in: path + name: device_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + battery_charge_pct: 82 + battery_charge_rate: 1200 + battery_cycle_count: 134 + battery_max_capacity_pct: 96 + cnm_enabled: true + cpu_cores: 10 + cpu_logical_processors: 10 + cpu_model: Apple M1 Pro + cpu_usage: 12.4 + disk_usage: 38.2 + ip_address: 192.0.2.10 + issues: [] + kernel_name: Darwin + last_seen: "2026-05-20T10:15:30Z" + manufacturer: Apple + mem_usage: 47.1 + memory_total_kb: 16777216 + model_name: MacBook Pro + model_number: MacBookPro18,3 + os: macOS + os_version: macOS 15.6.1 arm64 + packet_sent: 98213.0 + retransmit: 112.0 + retransmit_pct: 0.11 + serial_number: TESTDEVICE001 + status: healthy + tcp_canceled: 1.0 + tcp_established: 1482.0 + tcp_establishment_failure_pct: 0.6 + tcp_establishment_failures: 9.0 + tcp_host_unreachable: 1.0 + tcp_network_unreachable: 0.0 + tcp_refusals: 3.0 + tcp_timeouts: 4.0 + uptime: 432000 + wlan_bssid: 00:00:5e:00:53:01 + wlan_rssi: -55.0 + wlan_ssid: corp-wifi + id: LAPTOP-DEMO-001 + type: devices + schema: + $ref: "#/components/schemas/DeviceDetails" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get a device + tags: + - End User Device Monitoring + x-permission: + operator: OR + permissions: + - end_user_devices_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/events: get: description: |- @@ -271993,6 +272619,10 @@ tags: description: Elastic Cloud integration. url: https://docs.datadoghq.com/integrations/elastic-cloud/ name: Elastic Cloud Integration + - description: |- + Inspect devices reported by the Datadog Agent on end-user laptops, desktops, + and mobile devices, including their health, hardware, and connectivity attributes. + name: End User Device Monitoring - description: Manage per-integration configurations for the Internal Developer Portal (IDP). These configurations control which external resources (for example, GitHub repositories, Jira projects, or PagerDuty services) are synced as entities into the Software Catalog. name: Entity Integration Configs - description: Retrieves security risk scores for entities in your organization. diff --git a/examples/v2/end-user-device-monitoring/GetEUDMDevice.py b/examples/v2/end-user-device-monitoring/GetEUDMDevice.py new file mode 100644 index 0000000000..b9e7a6d490 --- /dev/null +++ b/examples/v2/end-user-device-monitoring/GetEUDMDevice.py @@ -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) diff --git a/examples/v2/end-user-device-monitoring/GetEUDMDevices.py b/examples/v2/end-user-device-monitoring/GetEUDMDevices.py new file mode 100644 index 0000000000..3cec818668 --- /dev/null +++ b/examples/v2/end-user-device-monitoring/GetEUDMDevices.py @@ -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) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 9755f40f34..5ebf267eb2 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -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, diff --git a/src/datadog_api_client/v2/api/end_user_device_monitoring_api.py b/src/datadog_api_client/v2/api/end_user_device_monitoring_api.py new file mode 100644 index 0000000000..973ddbec90 --- /dev/null +++ b/src/datadog_api_client/v2/api/end_user_device_monitoring_api.py @@ -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) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index 10452dce22..e9da816e59 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -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 @@ -217,6 +218,7 @@ "DomainAllowlistApi", "DowntimesApi", "ElasticCloudIntegrationApi", + "EndUserDeviceMonitoringApi", "EntityIntegrationConfigsApi", "EntityRiskScoresApi", "ErrorTrackingApi", diff --git a/src/datadog_api_client/v2/model/device_base_array.py b/src/datadog_api_client/v2/model/device_base_array.py new file mode 100644 index 0000000000..6ebb8c145e --- /dev/null +++ b/src/datadog_api_client/v2/model/device_base_array.py @@ -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 diff --git a/src/datadog_api_client/v2/model/device_base_array_links.py b/src/datadog_api_client/v2/model/device_base_array_links.py new file mode 100644 index 0000000000..bb075e81b5 --- /dev/null +++ b/src/datadog_api_client/v2/model/device_base_array_links.py @@ -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) diff --git a/src/datadog_api_client/v2/model/device_base_array_meta.py b/src/datadog_api_client/v2/model/device_base_array_meta.py new file mode 100644 index 0000000000..b81847a209 --- /dev/null +++ b/src/datadog_api_client/v2/model/device_base_array_meta.py @@ -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) diff --git a/src/datadog_api_client/v2/model/device_base_array_meta_page.py b/src/datadog_api_client/v2/model/device_base_array_meta_page.py new file mode 100644 index 0000000000..a4bbb06032 --- /dev/null +++ b/src/datadog_api_client/v2/model/device_base_array_meta_page.py @@ -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) diff --git a/src/datadog_api_client/v2/model/device_base_data.py b/src/datadog_api_client/v2/model/device_base_data.py new file mode 100644 index 0000000000..757bd4b337 --- /dev/null +++ b/src/datadog_api_client/v2/model/device_base_data.py @@ -0,0 +1,63 @@ +# 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_data_attributes import DeviceBaseDataAttributes + from datadog_api_client.v2.model.device_details_data_type import DeviceDetailsDataType + + +class DeviceBaseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.device_base_data_attributes import DeviceBaseDataAttributes + from datadog_api_client.v2.model.device_details_data_type import DeviceDetailsDataType + + return { + "attributes": (DeviceBaseDataAttributes,), + "id": (str,), + "type": (DeviceDetailsDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + id: str, + type: DeviceDetailsDataType, + attributes: Union[DeviceBaseDataAttributes, UnsetType] = unset, + **kwargs, + ): + """ + A single device entry as returned by the list devices endpoint. + + :param attributes: Common health and identity attributes shared by every End User Device Monitoring device record. + :type attributes: DeviceBaseDataAttributes, optional + + :param id: Unique identifier of the device. Matches the Datadog host identifier. + :type id: str + + :param type: Devices resource type. + :type type: DeviceDetailsDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/device_base_data_attributes.py b/src/datadog_api_client/v2/model/device_base_data_attributes.py new file mode 100644 index 0000000000..1d9275b4f8 --- /dev/null +++ b/src/datadog_api_client/v2/model/device_base_data_attributes.py @@ -0,0 +1,296 @@ +# 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_employee import DeviceEmployee + from datadog_api_client.v2.model.device_geo_ip import DeviceGeoIP + from datadog_api_client.v2.model.device_status import DeviceStatus + + +class DeviceBaseDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.device_employee import DeviceEmployee + from datadog_api_client.v2.model.device_geo_ip import DeviceGeoIP + from datadog_api_client.v2.model.device_status import DeviceStatus + + return { + "agent_key": (str,), + "agent_version": (str,), + "battery_critical": (bool,), + "battery_max_capacity_pct": (int,), + "cpu_cores": (int,), + "cpu_logical_processors": (int,), + "cpu_model": (str,), + "cpu_usage": (float,), + "disk_usage": (float,), + "employee": (DeviceEmployee,), + "geo_ip": (DeviceGeoIP,), + "ip_address": (str,), + "issues": ([str],), + "kernel_name": (str,), + "last_reboot": (str,), + "last_seen": (str,), + "manufacturer": (str,), + "mem_usage": (float,), + "memory_total_kb": (int,), + "model_name": (str,), + "model_number": (str,), + "os": (str,), + "os_version": (str,), + "resource_id": (str,), + "serial_number": (str,), + "status": (DeviceStatus,), + "type": (str,), + "uptime": (float,), + "wlan_bssid": (str,), + "wlan_rssi": (float,), + "wlan_ssid": (str,), + } + + attribute_map = { + "agent_key": "agent_key", + "agent_version": "agent_version", + "battery_critical": "battery_critical", + "battery_max_capacity_pct": "battery_max_capacity_pct", + "cpu_cores": "cpu_cores", + "cpu_logical_processors": "cpu_logical_processors", + "cpu_model": "cpu_model", + "cpu_usage": "cpu_usage", + "disk_usage": "disk_usage", + "employee": "employee", + "geo_ip": "geo_ip", + "ip_address": "ip_address", + "issues": "issues", + "kernel_name": "kernel_name", + "last_reboot": "last_reboot", + "last_seen": "last_seen", + "manufacturer": "manufacturer", + "mem_usage": "mem_usage", + "memory_total_kb": "memory_total_kb", + "model_name": "model_name", + "model_number": "model_number", + "os": "os", + "os_version": "os_version", + "resource_id": "resource_id", + "serial_number": "serial_number", + "status": "status", + "type": "type", + "uptime": "uptime", + "wlan_bssid": "wlan_bssid", + "wlan_rssi": "wlan_rssi", + "wlan_ssid": "wlan_ssid", + } + + def __init__( + self_, + agent_key: Union[str, UnsetType] = unset, + agent_version: Union[str, UnsetType] = unset, + battery_critical: Union[bool, UnsetType] = unset, + battery_max_capacity_pct: Union[int, UnsetType] = unset, + cpu_cores: Union[int, UnsetType] = unset, + cpu_logical_processors: Union[int, UnsetType] = unset, + cpu_model: Union[str, UnsetType] = unset, + cpu_usage: Union[float, UnsetType] = unset, + disk_usage: Union[float, UnsetType] = unset, + employee: Union[DeviceEmployee, UnsetType] = unset, + geo_ip: Union[DeviceGeoIP, UnsetType] = unset, + ip_address: Union[str, UnsetType] = unset, + issues: Union[List[str], UnsetType] = unset, + kernel_name: Union[str, UnsetType] = unset, + last_reboot: Union[str, UnsetType] = unset, + last_seen: Union[str, UnsetType] = unset, + manufacturer: Union[str, UnsetType] = unset, + mem_usage: Union[float, UnsetType] = unset, + memory_total_kb: Union[int, UnsetType] = unset, + model_name: Union[str, UnsetType] = unset, + model_number: Union[str, UnsetType] = unset, + os: Union[str, UnsetType] = unset, + os_version: Union[str, UnsetType] = unset, + resource_id: Union[str, UnsetType] = unset, + serial_number: Union[str, UnsetType] = unset, + status: Union[DeviceStatus, UnsetType] = unset, + type: Union[str, UnsetType] = unset, + uptime: Union[float, UnsetType] = unset, + wlan_bssid: Union[str, UnsetType] = unset, + wlan_rssi: Union[float, UnsetType] = unset, + wlan_ssid: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Common health and identity attributes shared by every End User Device Monitoring device record. + + :param agent_key: Public key of the Datadog Agent installed on the device. + :type agent_key: str, optional + + :param agent_version: Version of the Datadog Agent installed on the device. + :type agent_version: str, optional + + :param battery_critical: Whether the device's battery health has degraded to a critical level. + :type battery_critical: bool, optional + + :param battery_max_capacity_pct: Maximum battery capacity expressed as a percentage of the device's design capacity. + :type battery_max_capacity_pct: int, optional + + :param cpu_cores: Number of physical CPU cores on the device. + :type cpu_cores: int, optional + + :param cpu_logical_processors: Number of logical CPU processors (hardware threads) on the device. + :type cpu_logical_processors: int, optional + + :param cpu_model: Human-readable name of the device's CPU model. + :type cpu_model: str, optional + + :param cpu_usage: Average CPU usage on the device, as a percentage between 0 and 100. + :type cpu_usage: float, optional + + :param disk_usage: Average disk usage on the device, as a percentage between 0 and 100. + :type disk_usage: float, optional + + :param employee: Directory information about the employee associated with the device, + sourced from a customer reference table. + Absent when no reference table is configured or the device has no match. + :type employee: DeviceEmployee, optional + + :param geo_ip: Location derived from the device's public IP address. + Absent when no location data is available. + :type geo_ip: DeviceGeoIP, optional + + :param ip_address: Last observed IPv4 or IPv6 address of the device. + :type ip_address: str, optional + + :param issues: List of issue identifiers currently affecting the device. + :type issues: [str], optional + + :param kernel_name: Name of the operating system kernel running on the device. + :type kernel_name: str, optional + + :param last_reboot: Timestamp of the most recent device reboot, in RFC 3339 format. + :type last_reboot: str, optional + + :param last_seen: Timestamp of the most recent telemetry received from the device, in RFC 3339 format. + :type last_seen: str, optional + + :param manufacturer: Manufacturer of the device. + :type manufacturer: str, optional + + :param mem_usage: Average memory usage on the device, as a percentage between 0 and 100. + :type mem_usage: float, optional + + :param memory_total_kb: Total amount of physical memory available on the device, in kilobytes. + :type memory_total_kb: int, optional + + :param model_name: Marketing or product name of the device model. + :type model_name: str, optional + + :param model_number: Manufacturer-assigned model number of the device. + :type model_number: str, optional + + :param os: Operating system family running on the device, as reported by the Datadog Agent + (for example, ``macOS`` , ``Windows`` , or ``linux`` ). Empty when unknown. + :type os: str, optional + + :param os_version: Operating system version running on the device. + :type os_version: str, optional + + :param resource_id: Datadog resource identifier for the device. + :type resource_id: str, optional + + :param serial_number: Serial number assigned to the device by its manufacturer. + :type serial_number: str, optional + + :param status: Health status of the device, computed from its issues and recent telemetry. + ``inactive`` means the device stopped reporting. ``unknown`` means no telemetry is available yet. + :type status: DeviceStatus, optional + + :param type: Hardware type of the device (for example, ``laptop`` or ``desktop`` ). ``unknown`` when the type cannot be determined. + :type type: str, optional + + :param uptime: Time elapsed since the device last booted, in seconds. + :type uptime: float, optional + + :param wlan_bssid: BSSID (MAC address of the access point) of the wireless network the device is + currently connected to. + :type wlan_bssid: str, optional + + :param wlan_rssi: Received signal strength indicator of the device's current wireless connection, in dBm. + :type wlan_rssi: float, optional + + :param wlan_ssid: SSID of the wireless network the device is currently connected to. + :type wlan_ssid: str, optional + """ + if agent_key is not unset: + kwargs["agent_key"] = agent_key + if agent_version is not unset: + kwargs["agent_version"] = agent_version + if battery_critical is not unset: + kwargs["battery_critical"] = battery_critical + if battery_max_capacity_pct is not unset: + kwargs["battery_max_capacity_pct"] = battery_max_capacity_pct + if cpu_cores is not unset: + kwargs["cpu_cores"] = cpu_cores + if cpu_logical_processors is not unset: + kwargs["cpu_logical_processors"] = cpu_logical_processors + if cpu_model is not unset: + kwargs["cpu_model"] = cpu_model + if cpu_usage is not unset: + kwargs["cpu_usage"] = cpu_usage + if disk_usage is not unset: + kwargs["disk_usage"] = disk_usage + if employee is not unset: + kwargs["employee"] = employee + if geo_ip is not unset: + kwargs["geo_ip"] = geo_ip + if ip_address is not unset: + kwargs["ip_address"] = ip_address + if issues is not unset: + kwargs["issues"] = issues + if kernel_name is not unset: + kwargs["kernel_name"] = kernel_name + if last_reboot is not unset: + kwargs["last_reboot"] = last_reboot + if last_seen is not unset: + kwargs["last_seen"] = last_seen + if manufacturer is not unset: + kwargs["manufacturer"] = manufacturer + if mem_usage is not unset: + kwargs["mem_usage"] = mem_usage + if memory_total_kb is not unset: + kwargs["memory_total_kb"] = memory_total_kb + if model_name is not unset: + kwargs["model_name"] = model_name + if model_number is not unset: + kwargs["model_number"] = model_number + if os is not unset: + kwargs["os"] = os + if os_version is not unset: + kwargs["os_version"] = os_version + if resource_id is not unset: + kwargs["resource_id"] = resource_id + if serial_number is not unset: + kwargs["serial_number"] = serial_number + if status is not unset: + kwargs["status"] = status + if type is not unset: + kwargs["type"] = type + if uptime is not unset: + kwargs["uptime"] = uptime + if wlan_bssid is not unset: + kwargs["wlan_bssid"] = wlan_bssid + if wlan_rssi is not unset: + kwargs["wlan_rssi"] = wlan_rssi + if wlan_ssid is not unset: + kwargs["wlan_ssid"] = wlan_ssid + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/device_details.py b/src/datadog_api_client/v2/model/device_details.py new file mode 100644 index 0000000000..5a4ffe8298 --- /dev/null +++ b/src/datadog_api_client/v2/model/device_details.py @@ -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_details_data import DeviceDetailsData + + +class DeviceDetails(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.device_details_data import DeviceDetailsData + + return { + "data": (DeviceDetailsData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[DeviceDetailsData, UnsetType] = unset, **kwargs): + """ + Response body for the get device endpoint, returning a single device with full attribute detail. + + :param data: A single device entry with full attribute detail. + :type data: DeviceDetailsData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/device_details_data.py b/src/datadog_api_client/v2/model/device_details_data.py new file mode 100644 index 0000000000..dbb0f1cc69 --- /dev/null +++ b/src/datadog_api_client/v2/model/device_details_data.py @@ -0,0 +1,64 @@ +# 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_details_data_attributes import DeviceDetailsDataAttributes + from datadog_api_client.v2.model.device_details_data_type import DeviceDetailsDataType + + +class DeviceDetailsData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.device_details_data_attributes import DeviceDetailsDataAttributes + from datadog_api_client.v2.model.device_details_data_type import DeviceDetailsDataType + + return { + "attributes": (DeviceDetailsDataAttributes,), + "id": (str,), + "type": (DeviceDetailsDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + id: str, + type: DeviceDetailsDataType, + attributes: Union[DeviceDetailsDataAttributes, UnsetType] = unset, + **kwargs, + ): + """ + A single device entry with full attribute detail. + + :param attributes: Extended set of attributes for a single End User Device Monitoring device, + including Cloud Network Monitoring and battery metrics. + :type attributes: DeviceDetailsDataAttributes, optional + + :param id: Unique identifier of the device. Matches the Datadog host identifier. + :type id: str + + :param type: Devices resource type. + :type type: DeviceDetailsDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/device_details_data_attributes.py b/src/datadog_api_client/v2/model/device_details_data_attributes.py new file mode 100644 index 0000000000..51013afb3a --- /dev/null +++ b/src/datadog_api_client/v2/model/device_details_data_attributes.py @@ -0,0 +1,419 @@ +# 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_employee import DeviceEmployee + from datadog_api_client.v2.model.device_geo_ip import DeviceGeoIP + from datadog_api_client.v2.model.device_status import DeviceStatus + + +class DeviceDetailsDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.device_employee import DeviceEmployee + from datadog_api_client.v2.model.device_geo_ip import DeviceGeoIP + from datadog_api_client.v2.model.device_status import DeviceStatus + + return { + "agent_key": (str,), + "agent_version": (str,), + "battery_charge_pct": (int,), + "battery_charge_rate": (int,), + "battery_critical": (bool,), + "battery_cycle_count": (int,), + "battery_max_capacity_pct": (int,), + "cnm_enabled": (bool,), + "cpu_cores": (int,), + "cpu_logical_processors": (int,), + "cpu_model": (str,), + "cpu_usage": (float,), + "disk_usage": (float,), + "employee": (DeviceEmployee,), + "geo_ip": (DeviceGeoIP,), + "ip_address": (str,), + "issues": ([str],), + "kernel_name": (str,), + "last_reboot": (str,), + "last_seen": (str,), + "manufacturer": (str,), + "mem_usage": (float,), + "memory_total_kb": (int,), + "model_name": (str,), + "model_number": (str,), + "os": (str,), + "os_version": (str,), + "packet_sent": (float,), + "resource_id": (str,), + "retransmit": (float,), + "retransmit_pct": (float,), + "serial_number": (str,), + "status": (DeviceStatus,), + "tcp_canceled": (float,), + "tcp_established": (float,), + "tcp_establishment_failure_pct": (float,), + "tcp_establishment_failures": (float,), + "tcp_host_unreachable": (float,), + "tcp_network_unreachable": (float,), + "tcp_refusals": (float,), + "tcp_timeouts": (float,), + "type": (str,), + "uptime": (float,), + "wlan_bssid": (str,), + "wlan_rssi": (float,), + "wlan_ssid": (str,), + } + + attribute_map = { + "agent_key": "agent_key", + "agent_version": "agent_version", + "battery_charge_pct": "battery_charge_pct", + "battery_charge_rate": "battery_charge_rate", + "battery_critical": "battery_critical", + "battery_cycle_count": "battery_cycle_count", + "battery_max_capacity_pct": "battery_max_capacity_pct", + "cnm_enabled": "cnm_enabled", + "cpu_cores": "cpu_cores", + "cpu_logical_processors": "cpu_logical_processors", + "cpu_model": "cpu_model", + "cpu_usage": "cpu_usage", + "disk_usage": "disk_usage", + "employee": "employee", + "geo_ip": "geo_ip", + "ip_address": "ip_address", + "issues": "issues", + "kernel_name": "kernel_name", + "last_reboot": "last_reboot", + "last_seen": "last_seen", + "manufacturer": "manufacturer", + "mem_usage": "mem_usage", + "memory_total_kb": "memory_total_kb", + "model_name": "model_name", + "model_number": "model_number", + "os": "os", + "os_version": "os_version", + "packet_sent": "packet_sent", + "resource_id": "resource_id", + "retransmit": "retransmit", + "retransmit_pct": "retransmit_pct", + "serial_number": "serial_number", + "status": "status", + "tcp_canceled": "tcp_canceled", + "tcp_established": "tcp_established", + "tcp_establishment_failure_pct": "tcp_establishment_failure_pct", + "tcp_establishment_failures": "tcp_establishment_failures", + "tcp_host_unreachable": "tcp_host_unreachable", + "tcp_network_unreachable": "tcp_network_unreachable", + "tcp_refusals": "tcp_refusals", + "tcp_timeouts": "tcp_timeouts", + "type": "type", + "uptime": "uptime", + "wlan_bssid": "wlan_bssid", + "wlan_rssi": "wlan_rssi", + "wlan_ssid": "wlan_ssid", + } + + def __init__( + self_, + agent_key: Union[str, UnsetType] = unset, + agent_version: Union[str, UnsetType] = unset, + battery_charge_pct: Union[int, UnsetType] = unset, + battery_charge_rate: Union[int, UnsetType] = unset, + battery_critical: Union[bool, UnsetType] = unset, + battery_cycle_count: Union[int, UnsetType] = unset, + battery_max_capacity_pct: Union[int, UnsetType] = unset, + cnm_enabled: Union[bool, UnsetType] = unset, + cpu_cores: Union[int, UnsetType] = unset, + cpu_logical_processors: Union[int, UnsetType] = unset, + cpu_model: Union[str, UnsetType] = unset, + cpu_usage: Union[float, UnsetType] = unset, + disk_usage: Union[float, UnsetType] = unset, + employee: Union[DeviceEmployee, UnsetType] = unset, + geo_ip: Union[DeviceGeoIP, UnsetType] = unset, + ip_address: Union[str, UnsetType] = unset, + issues: Union[List[str], UnsetType] = unset, + kernel_name: Union[str, UnsetType] = unset, + last_reboot: Union[str, UnsetType] = unset, + last_seen: Union[str, UnsetType] = unset, + manufacturer: Union[str, UnsetType] = unset, + mem_usage: Union[float, UnsetType] = unset, + memory_total_kb: Union[int, UnsetType] = unset, + model_name: Union[str, UnsetType] = unset, + model_number: Union[str, UnsetType] = unset, + os: Union[str, UnsetType] = unset, + os_version: Union[str, UnsetType] = unset, + packet_sent: Union[float, UnsetType] = unset, + resource_id: Union[str, UnsetType] = unset, + retransmit: Union[float, UnsetType] = unset, + retransmit_pct: Union[float, UnsetType] = unset, + serial_number: Union[str, UnsetType] = unset, + status: Union[DeviceStatus, UnsetType] = unset, + tcp_canceled: Union[float, UnsetType] = unset, + tcp_established: Union[float, UnsetType] = unset, + tcp_establishment_failure_pct: Union[float, UnsetType] = unset, + tcp_establishment_failures: Union[float, UnsetType] = unset, + tcp_host_unreachable: Union[float, UnsetType] = unset, + tcp_network_unreachable: Union[float, UnsetType] = unset, + tcp_refusals: Union[float, UnsetType] = unset, + tcp_timeouts: Union[float, UnsetType] = unset, + type: Union[str, UnsetType] = unset, + uptime: Union[float, UnsetType] = unset, + wlan_bssid: Union[str, UnsetType] = unset, + wlan_rssi: Union[float, UnsetType] = unset, + wlan_ssid: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Extended set of attributes for a single End User Device Monitoring device, + including Cloud Network Monitoring and battery metrics. + + :param agent_key: Public key of the Datadog Agent installed on the device. + :type agent_key: str, optional + + :param agent_version: Version of the Datadog Agent installed on the device. + :type agent_version: str, optional + + :param battery_charge_pct: Current battery charge level as a percentage between 0 and 100. + :type battery_charge_pct: int, optional + + :param battery_charge_rate: Rate at which the battery is charging or discharging, in milliamperes. + Negative values indicate discharge. + :type battery_charge_rate: int, optional + + :param battery_critical: Whether the device's battery health has degraded to a critical level. + :type battery_critical: bool, optional + + :param battery_cycle_count: Number of full charge cycles the battery has gone through. + :type battery_cycle_count: int, optional + + :param battery_max_capacity_pct: Maximum battery capacity expressed as a percentage of the device's design capacity. + :type battery_max_capacity_pct: int, optional + + :param cnm_enabled: Whether Cloud Network Monitoring is enabled on the device. + :type cnm_enabled: bool, optional + + :param cpu_cores: Number of physical CPU cores on the device. + :type cpu_cores: int, optional + + :param cpu_logical_processors: Number of logical CPU processors (hardware threads) on the device. + :type cpu_logical_processors: int, optional + + :param cpu_model: Human-readable name of the device's CPU model. + :type cpu_model: str, optional + + :param cpu_usage: Average CPU usage on the device, as a percentage between 0 and 100. + :type cpu_usage: float, optional + + :param disk_usage: Average disk usage on the device, as a percentage between 0 and 100. + :type disk_usage: float, optional + + :param employee: Directory information about the employee associated with the device, + sourced from a customer reference table. + Absent when no reference table is configured or the device has no match. + :type employee: DeviceEmployee, optional + + :param geo_ip: Location derived from the device's public IP address. + Absent when no location data is available. + :type geo_ip: DeviceGeoIP, optional + + :param ip_address: Last observed IPv4 or IPv6 address of the device. + :type ip_address: str, optional + + :param issues: List of issue identifiers currently affecting the device. + :type issues: [str], optional + + :param kernel_name: Name of the operating system kernel running on the device. + :type kernel_name: str, optional + + :param last_reboot: Timestamp of the most recent device reboot, in RFC 3339 format. + :type last_reboot: str, optional + + :param last_seen: Timestamp of the most recent telemetry received from the device, in RFC 3339 format. + :type last_seen: str, optional + + :param manufacturer: Manufacturer of the device. + :type manufacturer: str, optional + + :param mem_usage: Average memory usage on the device, as a percentage between 0 and 100. + :type mem_usage: float, optional + + :param memory_total_kb: Total amount of physical memory available on the device, in kilobytes. + :type memory_total_kb: int, optional + + :param model_name: Marketing or product name of the device model. + :type model_name: str, optional + + :param model_number: Manufacturer-assigned model number of the device. + :type model_number: str, optional + + :param os: Operating system family running on the device, as reported by the Datadog Agent + (for example, ``macOS`` , ``Windows`` , or ``linux`` ). Empty when unknown. + :type os: str, optional + + :param os_version: Operating system version running on the device. + :type os_version: str, optional + + :param packet_sent: Number of TCP packets sent by the device over the query window, + as reported by Cloud Network Monitoring. + :type packet_sent: float, optional + + :param resource_id: Datadog resource identifier for the device. + :type resource_id: str, optional + + :param retransmit: Number of TCP packets retransmitted by the device over the query window. + :type retransmit: float, optional + + :param retransmit_pct: Percentage of sent TCP packets that were retransmitted, between 0 and 100. + :type retransmit_pct: float, optional + + :param serial_number: Serial number assigned to the device by its manufacturer. + :type serial_number: str, optional + + :param status: Health status of the device, computed from its issues and recent telemetry. + ``inactive`` means the device stopped reporting. ``unknown`` means no telemetry is available yet. + :type status: DeviceStatus, optional + + :param tcp_canceled: Number of TCP connection attempts canceled by the device over the query window. + :type tcp_canceled: float, optional + + :param tcp_established: Number of TCP connections established by the device over the query window. + :type tcp_established: float, optional + + :param tcp_establishment_failure_pct: Percentage of TCP connection attempts that failed, between 0 and 100. + :type tcp_establishment_failure_pct: float, optional + + :param tcp_establishment_failures: Number of TCP connection attempts that failed over the query window. + :type tcp_establishment_failures: float, optional + + :param tcp_host_unreachable: Number of TCP connection attempts that failed because the host was unreachable. + :type tcp_host_unreachable: float, optional + + :param tcp_network_unreachable: Number of TCP connection attempts that failed because the network was unreachable. + :type tcp_network_unreachable: float, optional + + :param tcp_refusals: Number of TCP connection attempts refused by the remote host over the query window. + :type tcp_refusals: float, optional + + :param tcp_timeouts: Number of TCP connection attempts that timed out over the query window. + :type tcp_timeouts: float, optional + + :param type: Hardware type of the device (for example, ``laptop`` or ``desktop`` ). ``unknown`` when the type cannot be determined. + :type type: str, optional + + :param uptime: Time elapsed since the device last booted, in seconds. + :type uptime: float, optional + + :param wlan_bssid: BSSID (MAC address of the access point) of the wireless network the device is + currently connected to. + :type wlan_bssid: str, optional + + :param wlan_rssi: Received signal strength indicator of the device's current wireless connection, in dBm. + :type wlan_rssi: float, optional + + :param wlan_ssid: SSID of the wireless network the device is currently connected to. + :type wlan_ssid: str, optional + """ + if agent_key is not unset: + kwargs["agent_key"] = agent_key + if agent_version is not unset: + kwargs["agent_version"] = agent_version + if battery_charge_pct is not unset: + kwargs["battery_charge_pct"] = battery_charge_pct + if battery_charge_rate is not unset: + kwargs["battery_charge_rate"] = battery_charge_rate + if battery_critical is not unset: + kwargs["battery_critical"] = battery_critical + if battery_cycle_count is not unset: + kwargs["battery_cycle_count"] = battery_cycle_count + if battery_max_capacity_pct is not unset: + kwargs["battery_max_capacity_pct"] = battery_max_capacity_pct + if cnm_enabled is not unset: + kwargs["cnm_enabled"] = cnm_enabled + if cpu_cores is not unset: + kwargs["cpu_cores"] = cpu_cores + if cpu_logical_processors is not unset: + kwargs["cpu_logical_processors"] = cpu_logical_processors + if cpu_model is not unset: + kwargs["cpu_model"] = cpu_model + if cpu_usage is not unset: + kwargs["cpu_usage"] = cpu_usage + if disk_usage is not unset: + kwargs["disk_usage"] = disk_usage + if employee is not unset: + kwargs["employee"] = employee + if geo_ip is not unset: + kwargs["geo_ip"] = geo_ip + if ip_address is not unset: + kwargs["ip_address"] = ip_address + if issues is not unset: + kwargs["issues"] = issues + if kernel_name is not unset: + kwargs["kernel_name"] = kernel_name + if last_reboot is not unset: + kwargs["last_reboot"] = last_reboot + if last_seen is not unset: + kwargs["last_seen"] = last_seen + if manufacturer is not unset: + kwargs["manufacturer"] = manufacturer + if mem_usage is not unset: + kwargs["mem_usage"] = mem_usage + if memory_total_kb is not unset: + kwargs["memory_total_kb"] = memory_total_kb + if model_name is not unset: + kwargs["model_name"] = model_name + if model_number is not unset: + kwargs["model_number"] = model_number + if os is not unset: + kwargs["os"] = os + if os_version is not unset: + kwargs["os_version"] = os_version + if packet_sent is not unset: + kwargs["packet_sent"] = packet_sent + if resource_id is not unset: + kwargs["resource_id"] = resource_id + if retransmit is not unset: + kwargs["retransmit"] = retransmit + if retransmit_pct is not unset: + kwargs["retransmit_pct"] = retransmit_pct + if serial_number is not unset: + kwargs["serial_number"] = serial_number + if status is not unset: + kwargs["status"] = status + if tcp_canceled is not unset: + kwargs["tcp_canceled"] = tcp_canceled + if tcp_established is not unset: + kwargs["tcp_established"] = tcp_established + if tcp_establishment_failure_pct is not unset: + kwargs["tcp_establishment_failure_pct"] = tcp_establishment_failure_pct + if tcp_establishment_failures is not unset: + kwargs["tcp_establishment_failures"] = tcp_establishment_failures + if tcp_host_unreachable is not unset: + kwargs["tcp_host_unreachable"] = tcp_host_unreachable + if tcp_network_unreachable is not unset: + kwargs["tcp_network_unreachable"] = tcp_network_unreachable + if tcp_refusals is not unset: + kwargs["tcp_refusals"] = tcp_refusals + if tcp_timeouts is not unset: + kwargs["tcp_timeouts"] = tcp_timeouts + if type is not unset: + kwargs["type"] = type + if uptime is not unset: + kwargs["uptime"] = uptime + if wlan_bssid is not unset: + kwargs["wlan_bssid"] = wlan_bssid + if wlan_rssi is not unset: + kwargs["wlan_rssi"] = wlan_rssi + if wlan_ssid is not unset: + kwargs["wlan_ssid"] = wlan_ssid + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/device_details_data_type.py b/src/datadog_api_client/v2/model/device_details_data_type.py new file mode 100644 index 0000000000..468cbccc22 --- /dev/null +++ b/src/datadog_api_client/v2/model/device_details_data_type.py @@ -0,0 +1,35 @@ +# 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 datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class DeviceDetailsDataType(ModelSimple): + """ + Devices resource type. + + :param value: If omitted defaults to "devices". Must be one of ["devices"]. + :type value: str + """ + + allowed_values = { + "devices", + } + DEVICES: ClassVar["DeviceDetailsDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +DeviceDetailsDataType.DEVICES = DeviceDetailsDataType("devices") diff --git a/src/datadog_api_client/v2/model/device_employee.py b/src/datadog_api_client/v2/model/device_employee.py new file mode 100644 index 0000000000..cb689a7e51 --- /dev/null +++ b/src/datadog_api_client/v2/model/device_employee.py @@ -0,0 +1,90 @@ +# 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 DeviceEmployee(ModelNormal): + @cached_property + def openapi_types(_): + return { + "city": (str,), + "country": (str,), + "department": (str,), + "email": (str,), + "name": (str,), + "office": (str,), + "team": (str,), + } + + attribute_map = { + "city": "city", + "country": "country", + "department": "department", + "email": "email", + "name": "name", + "office": "office", + "team": "team", + } + + def __init__( + self_, + city: Union[str, UnsetType] = unset, + country: Union[str, UnsetType] = unset, + department: Union[str, UnsetType] = unset, + email: Union[str, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + office: Union[str, UnsetType] = unset, + team: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Directory information about the employee associated with the device, + sourced from a customer reference table. + Absent when no reference table is configured or the device has no match. + + :param city: City where the employee is based. + :type city: str, optional + + :param country: Country where the employee is based. + :type country: str, optional + + :param department: Department the employee belongs to. + :type department: str, optional + + :param email: Email address of the employee. + :type email: str, optional + + :param name: Full name of the employee. + :type name: str, optional + + :param office: Office the employee is assigned to. + :type office: str, optional + + :param team: Team the employee belongs to. + :type team: str, optional + """ + if city is not unset: + kwargs["city"] = city + if country is not unset: + kwargs["country"] = country + if department is not unset: + kwargs["department"] = department + if email is not unset: + kwargs["email"] = email + if name is not unset: + kwargs["name"] = name + if office is not unset: + kwargs["office"] = office + if team is not unset: + kwargs["team"] = team + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/device_geo_ip.py b/src/datadog_api_client/v2/model/device_geo_ip.py new file mode 100644 index 0000000000..7e1c4c95d4 --- /dev/null +++ b/src/datadog_api_client/v2/model/device_geo_ip.py @@ -0,0 +1,82 @@ +# 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 DeviceGeoIP(ModelNormal): + @cached_property + def openapi_types(_): + return { + "geo_city": (str,), + "geo_country_iso_code": (str,), + "geo_latitude": (float,), + "geo_longitude": (float,), + "geo_subdivision_iso_code": (str,), + "public_ip_address": (str,), + } + + attribute_map = { + "geo_city": "geo_city", + "geo_country_iso_code": "geo_country_iso_code", + "geo_latitude": "geo_latitude", + "geo_longitude": "geo_longitude", + "geo_subdivision_iso_code": "geo_subdivision_iso_code", + "public_ip_address": "public_ip_address", + } + + def __init__( + self_, + geo_city: Union[str, UnsetType] = unset, + geo_country_iso_code: Union[str, UnsetType] = unset, + geo_latitude: Union[float, UnsetType] = unset, + geo_longitude: Union[float, UnsetType] = unset, + geo_subdivision_iso_code: Union[str, UnsetType] = unset, + public_ip_address: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Location derived from the device's public IP address. + Absent when no location data is available. + + :param geo_city: City resolved from the device's public IP address. + :type geo_city: str, optional + + :param geo_country_iso_code: ISO 3166-1 alpha-2 country code resolved from the device's public IP address. + :type geo_country_iso_code: str, optional + + :param geo_latitude: Latitude resolved from the device's public IP address. + :type geo_latitude: float, optional + + :param geo_longitude: Longitude resolved from the device's public IP address. + :type geo_longitude: float, optional + + :param geo_subdivision_iso_code: ISO 3166-2 subdivision code (for example, a state or province) + resolved from the device's public IP address. + :type geo_subdivision_iso_code: str, optional + + :param public_ip_address: Public IPv4 or IPv6 address of the device. + :type public_ip_address: str, optional + """ + if geo_city is not unset: + kwargs["geo_city"] = geo_city + if geo_country_iso_code is not unset: + kwargs["geo_country_iso_code"] = geo_country_iso_code + if geo_latitude is not unset: + kwargs["geo_latitude"] = geo_latitude + if geo_longitude is not unset: + kwargs["geo_longitude"] = geo_longitude + if geo_subdivision_iso_code is not unset: + kwargs["geo_subdivision_iso_code"] = geo_subdivision_iso_code + if public_ip_address is not unset: + kwargs["public_ip_address"] = public_ip_address + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/device_status.py b/src/datadog_api_client/v2/model/device_status.py new file mode 100644 index 0000000000..20146d4e85 --- /dev/null +++ b/src/datadog_api_client/v2/model/device_status.py @@ -0,0 +1,48 @@ +# 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 datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class DeviceStatus(ModelSimple): + """ + Health status of the device, computed from its issues and recent telemetry. + `inactive` means the device stopped reporting. `unknown` means no telemetry is available yet. + + :param value: Must be one of ["healthy", "degraded", "critical", "inactive", "unknown"]. + :type value: str + """ + + allowed_values = { + "healthy", + "degraded", + "critical", + "inactive", + "unknown", + } + HEALTHY: ClassVar["DeviceStatus"] + DEGRADED: ClassVar["DeviceStatus"] + CRITICAL: ClassVar["DeviceStatus"] + INACTIVE: ClassVar["DeviceStatus"] + UNKNOWN: ClassVar["DeviceStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +DeviceStatus.HEALTHY = DeviceStatus("healthy") +DeviceStatus.DEGRADED = DeviceStatus("degraded") +DeviceStatus.CRITICAL = DeviceStatus("critical") +DeviceStatus.INACTIVE = DeviceStatus("inactive") +DeviceStatus.UNKNOWN = DeviceStatus("unknown") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index b0d9271981..78a68630c9 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -3270,6 +3270,19 @@ from datadog_api_client.v2.model.detailed_finding_type import DetailedFindingType from datadog_api_client.v2.model.device_attributes import DeviceAttributes from datadog_api_client.v2.model.device_attributes_interface_statuses import DeviceAttributesInterfaceStatuses +from datadog_api_client.v2.model.device_base_array import DeviceBaseArray +from datadog_api_client.v2.model.device_base_array_links import DeviceBaseArrayLinks +from datadog_api_client.v2.model.device_base_array_meta import DeviceBaseArrayMeta +from datadog_api_client.v2.model.device_base_array_meta_page import DeviceBaseArrayMetaPage +from datadog_api_client.v2.model.device_base_data import DeviceBaseData +from datadog_api_client.v2.model.device_base_data_attributes import DeviceBaseDataAttributes +from datadog_api_client.v2.model.device_details import DeviceDetails +from datadog_api_client.v2.model.device_details_data import DeviceDetailsData +from datadog_api_client.v2.model.device_details_data_attributes import DeviceDetailsDataAttributes +from datadog_api_client.v2.model.device_details_data_type import DeviceDetailsDataType +from datadog_api_client.v2.model.device_employee import DeviceEmployee +from datadog_api_client.v2.model.device_geo_ip import DeviceGeoIP +from datadog_api_client.v2.model.device_status import DeviceStatus from datadog_api_client.v2.model.device_tags_by_source import DeviceTagsBySource from datadog_api_client.v2.model.devices_list_data import DevicesListData from datadog_api_client.v2.model.dns_metric_key import DnsMetricKey @@ -16282,6 +16295,19 @@ "DetailedFindingType", "DeviceAttributes", "DeviceAttributesInterfaceStatuses", + "DeviceBaseArray", + "DeviceBaseArrayLinks", + "DeviceBaseArrayMeta", + "DeviceBaseArrayMetaPage", + "DeviceBaseData", + "DeviceBaseDataAttributes", + "DeviceDetails", + "DeviceDetailsData", + "DeviceDetailsDataAttributes", + "DeviceDetailsDataType", + "DeviceEmployee", + "DeviceGeoIP", + "DeviceStatus", "DeviceTagsBySource", "DevicesListData", "DnsMetricKey", diff --git a/tests/generated-test/test-runner-data/manifest.json b/tests/generated-test/test-runner-data/manifest.json index fe4dd6aa23..4620b31977 100644 --- a/tests/generated-test/test-runner-data/manifest.json +++ b/tests/generated-test/test-runner-data/manifest.json @@ -5649,6 +5649,20 @@ "scenario": "Update a downtime returns \"OK\" response", "version": "v2" }, + { + "feature": "End User Device Monitoring", + "feature_file": "../../v2/features/end_user_device_monitoring.feature", + "file": "v2/end-user-device-monitoring/get-a-device-returns-not-found-response.json", + "scenario": "Get a device returns \"Not Found\" response", + "version": "v2" + }, + { + "feature": "End User Device Monitoring", + "feature_file": "../../v2/features/end_user_device_monitoring.feature", + "file": "v2/end-user-device-monitoring/get-all-devices-returns-ok-response.json", + "scenario": "Get all devices returns \"OK\" response", + "version": "v2" + }, { "feature": "Error Tracking", "feature_file": "../../v2/features/error_tracking.feature", diff --git a/tests/generated-test/test-runner-data/v2/end-user-device-monitoring/get-a-device-returns-not-found-response.json b/tests/generated-test/test-runner-data/v2/end-user-device-monitoring/get-a-device-returns-not-found-response.json new file mode 100644 index 0000000000..81cee7568d --- /dev/null +++ b/tests/generated-test/test-runner-data/v2/end-user-device-monitoring/get-a-device-returns-not-found-response.json @@ -0,0 +1,35 @@ +{ + "api": "EndUserDeviceMonitoring", + "expected_status": 404, + "feature": "End User Device Monitoring", + "id": "v2/End User Device Monitoring/Get a device returns \"Not Found\" response", + "operation_id": "GetEUDMDevice", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "device_id", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "not_found" + }, + "style": null + } + ], + "path": "/api/v2/eudm/devices/{device_id}" + }, + "scenario": "Get a device returns \"Not Found\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/tests/generated-test/test-runner-data/v2/end-user-device-monitoring/get-all-devices-returns-ok-response.json b/tests/generated-test/test-runner-data/v2/end-user-device-monitoring/get-all-devices-returns-ok-response.json new file mode 100644 index 0000000000..bfb96d83cc --- /dev/null +++ b/tests/generated-test/test-runner-data/v2/end-user-device-monitoring/get-all-devices-returns-ok-response.json @@ -0,0 +1,18 @@ +{ + "api": "EndUserDeviceMonitoring", + "expected_status": 200, + "feature": "End User Device Monitoring", + "id": "v2/End User Device Monitoring/Get all devices returns \"OK\" response", + "operation_id": "GetEUDMDevices", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [], + "path": "/api/v2/eudm/devices" + }, + "scenario": "Get all devices returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/tests/generated-test/test-server-data/manifest.json b/tests/generated-test/test-server-data/manifest.json index 5616419906..651d02c689 100644 --- a/tests/generated-test/test-server-data/manifest.json +++ b/tests/generated-test/test-server-data/manifest.json @@ -300,6 +300,11 @@ "file": "v2/downtimes.json", "version": "v2" }, + { + "feature": "End User Device Monitoring", + "file": "v2/end-user-device-monitoring.json", + "version": "v2" + }, { "feature": "Error Tracking", "file": "v2/error-tracking.json", diff --git a/tests/generated-test/test-server-data/v2/end-user-device-monitoring.json b/tests/generated-test/test-server-data/v2/end-user-device-monitoring.json new file mode 100644 index 0000000000..b735ee3aad --- /dev/null +++ b/tests/generated-test/test-server-data/v2/end-user-device-monitoring.json @@ -0,0 +1,69 @@ +{ + "feature": "End User Device Monitoring", + "recordings": [ + { + "feature": "End User Device Monitoring", + "frozen_at": "2026-05-26T22:33:26.244Z", + "interactions": [ + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/eudm/devices/not_found", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Not Found", + "status": 404 + } + } + ], + "scenario": "Get a device returns \"Not Found\" response", + "version": "v2" + }, + { + "feature": "End User Device Monitoring", + "frozen_at": "2026-05-26T22:33:27.236Z", + "interactions": [ + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/eudm/devices", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[{\"id\":\"LAPTOP-DEMO-001\",\"type\":\"devices\",\"attributes\":{\"agent_key\":\"00000000000000000000000000000000\",\"agent_version\":\"7.72.2\",\"cpu_model\":\"Apple M1 Pro\",\"cpu_cores\":10,\"cpu_logical_processors\":10,\"cpu_usage\":11.4,\"mem_usage\":47.1,\"memory_total_kb\":16777216,\"disk_usage\":38.2,\"ip_address\":\"192.0.2.10\",\"issues\":[],\"kernel_name\":\"Darwin\",\"last_seen\":\"2026-05-26T22:49:00Z\",\"manufacturer\":\"Apple\",\"model_name\":\"MacBook Pro\",\"model_number\":\"MacBookPro18,3\",\"os\":\"macOS\",\"os_version\":\"macOS 15.6.1 arm64\",\"resource_id\":\"10000000000001\",\"serial_number\":\"TESTDEVICE001\",\"status\":\"healthy\",\"type\":\"laptop\",\"uptime\":432000.0,\"wlan_bssid\":\"00:00:5e:00:53:01\",\"wlan_rssi\":-55.0,\"wlan_ssid\":\"corp-wifi\"}},{\"id\":\"LAPTOP-DEMO-002\",\"type\":\"devices\",\"attributes\":{\"agent_key\":\"00000000000000000000000000000000\",\"agent_version\":\"7.72.2\",\"cpu_model\":\"Intel(R) Core(TM) i7-1185G7\",\"cpu_cores\":4,\"cpu_logical_processors\":8,\"cpu_usage\":76.2,\"mem_usage\":81.5,\"memory_total_kb\":16777216,\"disk_usage\":62.4,\"ip_address\":\"192.0.2.11\",\"issues\":[\"high-cpu\",\"high-memory\"],\"kernel_name\":\"WindowsNT\",\"last_seen\":\"2026-05-26T22:48:30Z\",\"manufacturer\":\"Dell Inc.\",\"model_name\":\"Latitude 5420\",\"model_number\":\"Latitude 5420\",\"os\":\"Windows\",\"os_version\":\"Windows 11 Pro 10.0 Build 22631\",\"resource_id\":\"10000000000002\",\"serial_number\":\"TESTDEVICE002\",\"status\":\"degraded\",\"type\":\"laptop\",\"uptime\":86400.0,\"wlan_bssid\":\"00:00:5e:00:53:02\",\"wlan_rssi\":-72.5,\"wlan_ssid\":\"corp-wifi\"}},{\"id\":\"LAPTOP-DEMO-003\",\"type\":\"devices\",\"attributes\":{\"agent_key\":\"00000000000000000000000000000000\",\"agent_version\":\"7.71.0\",\"cpu_model\":\"Intel(R) Core(TM) i5-1135G7\",\"cpu_cores\":4,\"cpu_logical_processors\":8,\"cpu_usage\":92.8,\"mem_usage\":95.2,\"memory_total_kb\":8388608,\"disk_usage\":96.5,\"ip_address\":\"198.51.100.10\",\"issues\":[\"critical-cpu\",\"critical-memory\",\"critical-disk\"],\"kernel_name\":\"WindowsNT\",\"last_seen\":\"2026-05-26T22:47:00Z\",\"manufacturer\":\"Lenovo\",\"model_name\":\"ThinkPad X1 Carbon\",\"model_number\":\"20XW\",\"os\":\"Windows\",\"os_version\":\"Windows 10 Pro 10.0 Build 19045\",\"resource_id\":\"10000000000003\",\"serial_number\":\"TESTDEVICE003\",\"status\":\"critical\",\"type\":\"laptop\",\"uptime\":7200.0,\"wlan_bssid\":\"00:00:5e:00:53:03\",\"wlan_rssi\":-81.0,\"wlan_ssid\":\"guest-network\"}},{\"id\":\"DESKTOP-DEMO-001\",\"type\":\"devices\",\"attributes\":{\"agent_key\":\"00000000000000000000000000000000\",\"agent_version\":\"7.72.2\",\"cpu_model\":\"AMD Ryzen 7 5800X\",\"cpu_cores\":8,\"cpu_logical_processors\":16,\"cpu_usage\":8.3,\"mem_usage\":32.0,\"memory_total_kb\":33554432,\"disk_usage\":41.7,\"ip_address\":\"192.0.2.20\",\"issues\":[],\"kernel_name\":\"WindowsNT\",\"last_seen\":\"2026-05-26T22:49:00Z\",\"manufacturer\":\"Custom\",\"model_name\":\"Workstation\",\"model_number\":\"\",\"os\":\"Windows\",\"os_version\":\"Windows 11 Pro 10.0 Build 26100\",\"resource_id\":\"10000000000004\",\"serial_number\":\"TESTDEVICE004\",\"status\":\"healthy\",\"type\":\"desktop\",\"uptime\":1209600.0,\"wlan_bssid\":\"\",\"wlan_ssid\":\"\"}},{\"id\":\"LAPTOP-DEMO-004\",\"type\":\"devices\",\"attributes\":{\"agent_key\":\"00000000000000000000000000000000\",\"agent_version\":\"7.72.2\",\"battery_max_capacity_pct\":73,\"cpu_model\":\"Apple M2\",\"cpu_cores\":8,\"cpu_logical_processors\":8,\"cpu_usage\":22.1,\"mem_usage\":55.0,\"memory_total_kb\":16777216,\"disk_usage\":51.0,\"ip_address\":\"192.0.2.21\",\"issues\":[\"low-battery-capacity\"],\"kernel_name\":\"Darwin\",\"last_seen\":\"2026-05-26T22:49:00Z\",\"manufacturer\":\"Apple\",\"model_name\":\"MacBook Air\",\"model_number\":\"Mac14,2\",\"os\":\"macOS\",\"os_version\":\"macOS 26.4.1 arm64\",\"resource_id\":\"10000000000005\",\"serial_number\":\"TESTDEVICE005\",\"status\":\"degraded\",\"type\":\"laptop\",\"uptime\":14400.0,\"wlan_bssid\":\"00:00:5e:00:53:05\",\"wlan_rssi\":-62.0,\"wlan_ssid\":\"home-network\"}},{\"id\":\"LAPTOP-DEMO-005\",\"type\":\"devices\",\"attributes\":{\"agent_key\":\"00000000000000000000000000000000\",\"agent_version\":\"7.70.0\",\"ip_address\":\"203.0.113.10\",\"issues\":[],\"kernel_name\":\"WindowsNT\",\"last_seen\":\"2026-05-20T08:15:00Z\",\"manufacturer\":\"HP\",\"model_name\":\"EliteBook 840\",\"model_number\":\"G9\",\"os\":\"Windows\",\"os_version\":\"Windows 11 Pro 10.0 Build 22621\",\"resource_id\":\"10000000000006\",\"serial_number\":\"TESTDEVICE006\",\"status\":\"inactive\",\"type\":\"laptop\",\"wlan_ssid\":\"\",\"wlan_bssid\":\"\"}},{\"id\":\"DESKTOP-DEMO-002\",\"type\":\"devices\",\"attributes\":{\"agent_key\":\"00000000000000000000000000000000\",\"agent_version\":\"7.72.2\",\"cpu_cores\":16,\"cpu_logical_processors\":32,\"cpu_model\":\"AMD Ryzen 9 7950X\",\"cpu_usage\":14.6,\"mem_usage\":28.4,\"memory_total_kb\":67108864,\"disk_usage\":22.1,\"ip_address\":\"198.51.100.20\",\"issues\":[],\"kernel_name\":\"Linux\",\"last_seen\":\"2026-05-26T22:49:00Z\",\"manufacturer\":\"Custom\",\"model_name\":\"Workstation\",\"model_number\":\"\",\"os\":\"linux\",\"os_version\":\"Ubuntu 24.04 LTS\",\"resource_id\":\"10000000000007\",\"serial_number\":\"TESTDEVICE007\",\"status\":\"healthy\",\"type\":\"desktop\",\"uptime\":2592000.0}},{\"id\":\"DEVICE-DEMO-UNKNOWN\",\"type\":\"devices\",\"attributes\":{\"agent_key\":\"00000000000000000000000000000000\",\"agent_version\":\"7.65.0\",\"ip_address\":\"203.0.113.20\",\"issues\":[\"recent-restart\"],\"last_seen\":\"2026-05-26T22:35:00Z\",\"os\":\"\",\"os_version\":\"\",\"resource_id\":\"10000000000008\",\"status\":\"healthy\",\"type\":\"unknown\"}}],\"meta\":{\"page\":{}},\"links\":{\"self\":\"/api/v2/eudm/devices\"}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "Get all devices returns \"OK\" response", + "version": "v2" + } + ], + "schema_version": 1, + "version": "v2" +} diff --git a/tests/v2/features/end_user_device_monitoring.feature b/tests/v2/features/end_user_device_monitoring.feature new file mode 100644 index 0000000000..cddff39a3d --- /dev/null +++ b/tests/v2/features/end_user_device_monitoring.feature @@ -0,0 +1,48 @@ +@endpoint(end-user-device-monitoring) @endpoint(end-user-device-monitoring-v2) +Feature: End User Device Monitoring + Inspect devices reported by the Datadog Agent on end-user laptops, + desktops, and mobile devices, including their health, hardware, and + connectivity attributes. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "EndUserDeviceMonitoring" API + + @generated @skip @team:ddoghq/eudm-experiences + Scenario: Get a device returns "Bad Request" response + Given operation "GetEUDMDevice" enabled + And new "GetEUDMDevice" request + And request contains "device_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @team:ddoghq/eudm-experiences + Scenario: Get a device returns "Not Found" response + Given operation "GetEUDMDevice" enabled + And new "GetEUDMDevice" request + And request contains "device_id" parameter with value "not_found" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:ddoghq/eudm-experiences + Scenario: Get a device returns "OK" response + Given operation "GetEUDMDevice" enabled + And new "GetEUDMDevice" request + And request contains "device_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:ddoghq/eudm-experiences + Scenario: Get all devices returns "Bad Request" response + Given operation "GetEUDMDevices" enabled + And new "GetEUDMDevices" request + When the request is sent + Then the response status is 400 Bad Request + + @team:ddoghq/eudm-experiences + Scenario: Get all devices returns "OK" response + Given operation "GetEUDMDevices" enabled + And new "GetEUDMDevices" request + When the request is sent + Then the response status is 200 OK diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index ecd54435b6..d92af14e39 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -2771,6 +2771,18 @@ "type": "idempotent" } }, + "GetEUDMDevices": { + "tag": "End User Device Monitoring", + "undo": { + "type": "safe" + } + }, + "GetEUDMDevice": { + "tag": "End User Device Monitoring", + "undo": { + "type": "safe" + } + }, "ListEvents": { "tag": "Events", "undo": {