summaryrefslogtreecommitdiff
path: root/ironic/db/sqlalchemy
diff options
context:
space:
mode:
authorJim Rollenhagen <jim@jimrollenhagen.com>2018-07-10 14:54:20 +0000
committerJim Rollenhagen <jim@jimrollenhagen.com>2018-07-23 20:51:36 +0000
commitce1e88991e818b2185a0d77ea9e2c255c549b19d (patch)
tree1164af9e9dc283c6ea80c61780133e0be26926c7 /ironic/db/sqlalchemy
parent26fd55f7da2860d7fa71c8bbeabde72e0a74049a (diff)
downloadironic-ce1e88991e818b2185a0d77ea9e2c255c549b19d.tar.gz
Expose node.conductor_group in the REST API
This adds microversion 1.46 to allow: * returning conductor_group in the node object * specifying conductor_group in the node create API * specifying conductor_group in the node update API * allow filtering nodes by conductor_group Change-Id: I32e0333c78cfcb2d88dfd4f70f0be012dcfef407 Story: 2001795 Task: 22643
Diffstat (limited to 'ironic/db/sqlalchemy')
-rw-r--r--ironic/db/sqlalchemy/api.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/ironic/db/sqlalchemy/api.py b/ironic/db/sqlalchemy/api.py
index 9e3c9918c..c7fcaf1f7 100644
--- a/ironic/db/sqlalchemy/api.py
+++ b/ironic/db/sqlalchemy/api.py
@@ -223,7 +223,8 @@ class Connection(api.Connection):
'resource_class', 'provision_state', 'uuid', 'id',
'chassis_uuid', 'associated', 'reserved',
'reserved_by_any_of', 'provisioned_before',
- 'inspection_started_before', 'fault'}
+ 'inspection_started_before', 'fault',
+ 'conductor_group'}
unsupported_filters = set(filters).difference(supported_filters)
if unsupported_filters:
msg = _("SqlAlchemy API does not support "
@@ -231,7 +232,7 @@ class Connection(api.Connection):
raise ValueError(msg)
for field in ['console_enabled', 'maintenance', 'driver',
'resource_class', 'provision_state', 'uuid', 'id',
- 'fault']:
+ 'fault', 'conductor_group']:
if field in filters:
query = query.filter_by(**{field: filters[field]})
if 'chassis_uuid' in filters: