Skip to content

client.domain

Look up domain relationships and statistics.

Property

client.domain

Methods

  • alerts(domain: str) -> AlertsResults: fetch alerts related to a domain.
  • machines(domain: str) -> MachineResults: fetch machines related to a domain.
  • stats(domain: str) -> DomainStatsResults: fetch in-organization statistics for a domain.

Notes

  • This endpoint is relationship-oriented. It does not expose a domain collection listing method.

API

Domain endpoint for the Defender for Endpoint API.

Exposes DomainEndpoint for alert-related domain lookups (/api/domains/{id}/alerts, /machines, /stats) and the DomainResults / DomainStatsResults wrappers that materialise the responses.

DomainResults

DomainResults(
    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 for the /api/domains endpoint.

DomainStatsResults

DomainStatsResults(
    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 for the /api/alerts/{id}/domains/stats endpoint.

DomainEndpoint

DomainEndpoint(http: Client, auth: MSALAuth)

Endpoint for interacting with alert-related domain information.

alerts

alerts(domain: str) -> AlertsResults

Get the alerts associated with a domain.

Docs: https://learn.microsoft.com/en-us/defender-endpoint/api/get-domain-related-alerts

machines

machines(domain: str) -> MachineResults

Get the machines associated with a domain.

Docs: https://learn.microsoft.com/en-us/defender-endpoint/api/get-domain-related-machines

stats

stats(domain: str) -> DomainStatsResults

Get the in-organization stats for a domain.

Docs: https://learn.microsoft.com/en-us/defender-endpoint/api/get-domain-statistics