synology_apm.sdk.collections.hypervisors module

HypervisorCollection — collection interface for managing hypervisor inventory servers.

class synology_apm.sdk.collections.hypervisors.HypervisorCollection(session)

Bases: object

Collection interface for managing hypervisor inventory servers in APM.

Accessed via APMClient.hypervisors; should not be instantiated directly.

async list()

List all registered hypervisor inventory servers.

Returns:

ListResult of (list of Hypervisor, total count)

Return type:

ListResult[Hypervisor]

async get(hypervisor_id)

Fetch a hypervisor inventory server by ID.

Parameters:

hypervisor_id (str) – Hypervisor UUID.

Raises:

ResourceNotFoundError – The specified hypervisor does not exist.

async get_by_name(name)

Fetch a hypervisor inventory server by hostname.

Matches in order: case-insensitive hostname → case-insensitive address; returns the first match.

Parameters:

name (str) – Hostname or address.

Raises:

ResourceNotFoundError – No hypervisor with an exact match was found.