292e94ee2c
The MAAS API call "GET /MAAS/api/2.0/machines/" retrieves information about every machine known to MAAS, which is very slow. The API supports filtering based on hostname and mac_address (among others), and querying for power parameters for all nodes at once. This change modifies identify_baremetal_node to avoid calling refresh on the full machine list. Also, the refresh method of ResourceCollectionBase is updated to allow passing of params, which can be used to take advantage of the filtering. Note that a filtered call to refresh overwrites the resources collection to only contain the returned values. Most calls to Machines.refresh() aren't really needed at all - they are replaced with a call to Machines.empty_refresh(), which will still make sure that the API endpoint is accessible but return an empty collection. (This may get removed entirely in the future.) Change-Id: Ie58c45e1790c5c827d9d47f5582214ca519946de |
||
---|---|---|
.. | ||
maasdriver | ||
__init__.py | ||
driver.py |