drydock/python/drydock_provisioner
Phil Sphicas 292e94ee2c Avoid expensive MAAS API calls
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
2021-07-28 22:56:13 +00:00
..
cli Catchup YAPF formatting 2018-09-26 08:57:51 -05:00
control Address PEP8 Failures in Drydock 2020-05-12 18:27:06 +00:00
drivers Avoid expensive MAAS API calls 2021-07-28 22:56:13 +00:00
drydock_client End user logging for audit traceabilty 2019-04-01 10:07:34 +00:00
ingester Fix: flake8 tests failing due to invalid types comparison 2019-02-11 18:16:12 +01:00
introspection Refactor build to include Go 2018-09-04 13:13:21 -05:00
objects Address PEP8 Failures in Drydock 2020-05-12 18:27:06 +00:00
orchestrator Added some validations loggs for site model 2020-07-24 18:57:21 +00:00
schemas Refactor build to include Go 2018-09-04 13:13:21 -05:00
statemgmt (fix) Use endpoint for MAAS URL 2018-11-27 12:04:38 -06:00
__init__.py Accelerate YAML operations with LibYAML 2020-09-25 08:07:49 +00:00
config.py Update node-labels through Kubernetes Provisioner 2018-09-25 17:54:59 +05:30
drydock.py End user logging for audit traceabilty 2019-04-01 10:07:34 +00:00
error.py Refactor build to include Go 2018-09-04 13:13:21 -05:00
policy.py Catchup YAPF formatting 2018-09-26 08:57:51 -05:00
util.py Refactor build to include Go 2018-09-04 13:13:21 -05:00