summaryrefslogtreecommitdiff
path: root/ironic/db/api.py
diff options
context:
space:
mode:
authorDmitry Tantsur <dtantsur@redhat.com>2016-06-17 09:42:33 +0200
committerDmitry Tantsur <divius.inside@gmail.com>2016-06-27 09:34:03 +0200
commit088f09903b310fe66cb76f1c5bd62f1ac076dd53 (patch)
treecb1f25fe511148402406de402aaccb3831d99300 /ironic/db/api.py
parent90e3bcaeb7192381a49ae049ab5228a902c99bc3 (diff)
downloadironic-088f09903b310fe66cb76f1c5bd62f1ac076dd53.tar.gz
Add dbapi and objects functions to get a node by associated MAC addresses
Adds a new dbapi call get_node_by_port_addresses and associated objects call Node.get_by_port_addresses. The logic is the same as in "lookup" agent passthru. Will be used for a new lookup endpoint. Change-Id: Ia5549fb16cd363f3492b9ca0400177c92a1aea19 Partial-Bug: #1570841
Diffstat (limited to 'ironic/db/api.py')
-rw-r--r--ironic/db/api.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/ironic/db/api.py b/ironic/db/api.py
index f8ab5a686..c0fd52c59 100644
--- a/ironic/db/api.py
+++ b/ironic/db/api.py
@@ -604,3 +604,12 @@ class Connection(object):
:param tag: A tag string.
:returns: True if the tag exists otherwise False.
"""
+
+ @abc.abstractmethod
+ def get_node_by_port_addresses(self, addresses):
+ """Find a node by any matching port address.
+
+ :param addresses: list of port addresses (e.g. MACs).
+ :returns: Node object.
+ :raises: NodeNotFound if none or several nodes are found.
+ """