Skip to content

client.device_groups

Manage device groups defined in the Defender for Endpoint tenant.

Property

client.device_groups

Methods

  • get_all() -> DeviceGroupResults: list all device groups.
  • get(id: str) -> DeviceGroupResults: fetch one device group by ID.
  • add(payload: AddDeviceGroupsPayload) -> httpx.Response: add a new device group.
  • delete(payload: DeleteDeviceGroupsPayload) -> httpx.Response: delete a device group.
  • post(payload: PostDeviceGroupsPayload) -> httpx.Response: update a device group.

Notes

  • Read methods return lazy BaseResults subclasses; call to_dicts(), to_arrow(), or to_polars() to materialize.
  • Mutating methods (add, delete, post) return the raw httpx.Response so callers can inspect status codes or response bodies directly.
  • Payload models live in mde_client.models.action_payloads.

See also

API

DeviceGroupResults

DeviceGroupResults(
    endpoint: BaseEndpoint,
    params: dict[str, str],
    *,
    path: str | None = None,
    single: bool = False,
    files: bool = False,
    method: str = "GET",
    request_kwargs: dict[str, Any] | None = None,
    use_concurrent_skip_pagination: bool | None = None,
    skip_page_size: int | None = None,
    skip_max_concurrent: int | None = None,
)

Results from the /api/deviceGroups endpoint.

DeviceGroupsEndpoint

DeviceGroupsEndpoint(http: Client, auth: MSALAuth)

Endpoint for /api/deviceGroups.

get_all

get_all() -> DeviceGroupResults

Retrieves a list of device groups.

Docs: Null (undocumented endpoint)

get

get(id: str) -> DeviceGroupResults

Retrieves a single device group by ID.

Docs: Null (undocumented endpoint)

add

add(payload: AddDeviceGroupsPayload) -> Response

Adds AAD device groups to a device group.

TODO: Needs Testing and Validation

Docs: Null (undocumented endpoint)

delete

delete(payload: DeleteDeviceGroupsPayload) -> Response

Deletes AAD device groups from a device group.

TODO: Needs Testing and Validation

Docs: Null (undocumented endpoint)

post

post(payload: PostDeviceGroupsPayload) -> Response

Creates or updates a device group.

TODO: Needs Testing and Validation

Docs: Null (undocumented endpoint)